diff --git a/src/main.rs b/src/main.rs
@@ -293,7 +293,13 @@ fn render_index(pics: &Vec<Picture>) -> io::Result<()> {
writeln!(f, "</ul>")?;
writeln!(f, "</main>")?;
- write_footer(&mut f)?;
+ writeln!(f, "<footer>")?;
+ writeln!(
+ f,
+ "made with 💛 by <a role=\"author\" href=\"https://pablopie.xyz\">@pablo</a>"
+ )?;
+ writeln!(f, "</footer>")?;
+
writeln!(f, "</body>")?;
writeln!(f, "</html>")
}
@@ -340,28 +346,12 @@ fn render_pic_page(pic: &Picture) -> io::Result<()> {
name = Escaped(&pic.file_name))?;
}
writeln!(f, "<div id=\"picture-container\">")?;
- writeln!(f, "<div id=\"picture-frame\">")?;
writeln!(
f,
"<img alt=\"{alt}\" src=\"/{PHOTOS_PATH}/{file_name}\">",
alt = Escaped(&pic.alt),
file_name = Escaped(&pic.file_name)
)?;
- writeln!(f, "<div>")?;
- if let Some(url) = &pic.author_url {
- writeln!(f, "by <a role=\"author\" href=\"{url}\">{author}</a>",
- author = Escaped(&pic.author))?;
- } else {
- writeln!(f, "by {author}", author = Escaped(&pic.author))?;
- }
- if let Some(license) = &pic.license {
- writeln!(f, "(licensed under <a role=\"license\" href=\"{url}\">{license}</a>)",
- url = license.url())?;
- } else {
- writeln!(f, "(public domain)")?;
- }
- writeln!(f, "</div>")?;
- writeln!(f, "</div>")?;
writeln!(f, "</div>")?;
if let Some(caption) = &pic.caption {
writeln!(f, "<figcaption>")?;
@@ -371,7 +361,23 @@ fn render_pic_page(pic: &Picture) -> io::Result<()> {
writeln!(f, "</figure>")?;
writeln!(f, "</main>")?;
- write_footer(&mut f)?;
+ writeln!(f, "<footer>")?;
+ write!(f, "original work by ")?;
+ if let Some(url) = &pic.author_url {
+ writeln!(f, "<a role=\"author\" href=\"{url}\">{author}</a>",
+ author = Escaped(&pic.author))?;
+ } else {
+ writeln!(f, "{}", Escaped(&pic.author))?;
+ }
+ writeln!(f, "<br>")?;
+ if let Some(license) = &pic.license {
+ writeln!(f, "licensed under <a role=\"license\" href=\"{url}\">{license}</a>",
+ url = license.url())?;
+ } else {
+ writeln!(f, "this is public domain")?;
+ }
+ writeln!(f, "</footer>")?;
+
writeln!(f, "</body>")?;
writeln!(f, "</html>")
}
@@ -385,15 +391,6 @@ fn write_nav(f: &mut File) -> io::Result<()> {
writeln!(f, "</header>")
}
-fn write_footer(f: &mut File) -> io::Result<()> {
- writeln!(f, "<footer>")?;
- writeln!(
- f,
- "made with 💛 by <a role=\"author\" href=\"https://pablopie.xyz\">@pablo</a>"
- )?;
- writeln!(f, "</footer>")
-}
-
/// Prints the common head elements to a given file
fn write_head(f: &mut File) -> io::Result<()> {
writeln!(