- Commit
- 467299ca9758bb0ad61a9fd84032d96ca28078cf
- Parent
- 7623565867713b656c20c8de550003885a1a8cf3
- Author
- Pablo <pablo-escobar@riseup.net>
- Date
Moved a constant to a different file
Moved the intro message of index.html to a separate file
Custum build of stapix for tikz.pablopie.xyz
Moved a constant to a different file
Moved the intro message of index.html to a separate file
2 files changed, 10 insertions, 6 deletions
Status | File Name | N° Changes | Insertions | Deletions |
Added | src/intro.html | 7 | 7 | 0 |
Modified | src/main.rs | 9 | 3 | 6 |
diff --git a/src/intro.html b/src/intro.html @@ -0,0 +1,7 @@ +<h1>TikZ Gallery</h1> +<p> +A gallery with ready-made mathematical drawings for use in LaTeX documents and +Beamer presentations — as well as their source code! Please see +<a href=\"/using.html\">Using This Gallery</a> for information on how to +include pictures from this gallery in your documents. +</p>
diff --git a/src/main.rs b/src/main.rs @@ -34,10 +34,8 @@ const PAGE_TITLE: &str = "TikZ Gallery"; const AUTHOR: &str = "Pablo"; const LICENSE: &str = "GPLv3"; -const INTRO_MSG: &str = "A gallery with ready-made mathematical drawings for -use in LaTeX documents and Beamer presentations — as well as their source -code! Please see <a href=\"/using.html\">Using This Gallery</a> for information -on how to include pictures from this gallery in your documents."; +/// HTML to be inserted in the beginning of index.html during generation +const INTRO_MSG: &str = include_str!("intro.html"); /// WebP image quality const WEBP_IMAGE_QUALITY: f32 = 90.0; @@ -277,8 +275,7 @@ fn render_index(pics: &Vec<GalleryEntry>) -> io::Result<()> { writeln!(f, "<body>")?; writeln!(f, "<main>")?; - writeln!(f, "<h1>{PAGE_TITLE}</h1>")?; - writeln!(f, "<p>\n{}\n</p>", INTRO_MSG)?; + writeln!(f, "{}", INTRO_MSG)?; writeln!(f, "<div id=\"gallery\" role=\"feed\">")?;