stapix

Yet another static page generator for photo galleries

Commit
a04a36556115decbc4b689d32b65fdcdcd403280
Parent
9a727c8f1158bfe85fa19948ea286d99bdc8ab01
Author
Pablo <pablo-escobar@riseup.net>
Date

Added some examples to the repo

Added a folder with example configuration files

The example pictures were taken from Wikimedia Commons

Also integrated the examples into the README and the error messages

Diffstat

8 files changed, 58 insertions, 17 deletions

Status File Name N° Changes Insertions Deletions
Modified .gitignore 2 1 1
Modified README.md 20 12 8
Added examples/config.yml 33 33 0
Added examples/photos/iss-trails.jpg 0 0 0
Added examples/photos/pia-19048.jpg 0 0 0
Added examples/photos/solar-eclipse.jpg 0 0 0
Added examples/photos/victoria-crater.jpg 0 0 0
Modified src/main.rs 20 12 8
diff --git a/.gitignore b/.gitignore
@@ -1,2 +1,2 @@
 /target
-/site
+/examples/site
diff --git a/README.md b/README.md
@@ -32,15 +32,19 @@ The configuration file `config.yml` should consist of a list of struct entries
 describing the contents of each picture, such as in the following example:
 
 ```yaml
-- path: ./path/to/first.jpg
-  alt: "Text alternative for the first photo"
-  author: John Doe
+- path: examples/photos/iss-trails.jpg
+  alt: "A long exposure shot of star trails, framed by the ISS on the top and
+  by the surface of Earth on the bottom. Thunderstorms dot the landscape while
+  the orange glare of cities drifts across Earth and a faint a green-yellow
+  light hugs the horizon."
   license: PD
-- path: ./path/to/second.png
-  alt: "Text alternative for the second photo"
-  author: Jane Doe
-  license: CC-BY-SA-4
-...
+  author: Don Pettit
+
+- path: examples/photos/solar-eclipse.jpg
+  alt: "A total solar eclipse. The moon blocks out the sun and creates a
+  stunning ring of colorful red light against the black background."
+  license: CC-BY-SA-3
+  author: Luc Viatour
 ```
 
 Each entry in the list should contain the following fields:
diff --git a/examples/config.yml b/examples/config.yml
@@ -0,0 +1,33 @@
+- path: ./photos/iss-trails.jpg
+  alt: "A long exposure shot of star trails, framed by a space station on the
+    top and by the surface of Earth on the bottom. Thunderstorms dot the
+    landscape while the orange glare of cities drifts across Earth and a faint
+    a green-yellow light hugs the horizon."
+  caption: "Star trails at the International Space Station"
+  license: PD
+  author: Don Pettit
+  author-url: https://en.wikipedia.org/wiki/Donald_Pettit
+
+- path: ./photos/victoria-crater.jpg
+  alt: "A top-down view of a large crater spanning across the peach Martian
+    wasteland"
+  caption: "Victoria crater, Mars"
+  license: PD
+  author: NASA / JPL / University of Arizona
+  author-url: http://photojournal.jpl.nasa.gov
+
+- path: ./photos/solar-eclipse.jpg
+  alt: "A solar eclipse. The moon blocks out the sun and creates a stunning
+    ring of colorful red light against the black background."
+  caption: "Total Solar eclipse, 1999"
+  license: CC-BY-SA-3
+  author: Luc Viatour
+  author-url: https://lucnix.be/
+
+- path: ./photos/pia-19048.jpg
+  alt: "The puzzling, fascinating surface of a moon looms large in the dark
+    void. Long, linear cracks and ridges crisscross the surface of the moon."
+  caption: "Jupiter's icy moon Europa"
+  license: PD
+  author: NASA / JPL / SETI Institute
+  author-url: http://photojournal.jpl.nasa.gov
diff --git a/examples/photos/iss-trails.jpg b/examples/photos/iss-trails.jpg
Binary files differ.
diff --git a/examples/photos/pia-19048.jpg b/examples/photos/pia-19048.jpg
Binary files differ.
diff --git a/examples/photos/solar-eclipse.jpg b/examples/photos/solar-eclipse.jpg
Binary files differ.
diff --git a/examples/photos/victoria-crater.jpg b/examples/photos/victoria-crater.jpg
Binary files differ.
diff --git a/src/main.rs b/src/main.rs
@@ -107,15 +107,19 @@ macro_rules! usage_config {
     () => {
         eprintln!("{usage_header_msg} The YAML configuration file should look like this:",
                   usage_header_msg = "[USAGE]".yellow().bold());
-        eprintln!("    - {path_attr} ./path/to/first.jpg
-      {alt_attr} \"Text alternative for the first photo\"
-      {author_attr} John Doe
+        eprintln!("    - {path_attr} examples/photos/iss-trails.jpg
+      {alt_attr} \"A long exposure shot of star trails, framed by the ISS on the top and
+        by the surface of Earth on the bottom. Thunderstorms dot the landscape
+        while the orange glare of cities drifts across Earth and a faint a
+        green-yellow light hugs the horizon.\"
       {license_attr} PD
-    - {path_attr} ./path/to/second.png
-      {alt_attr} \"Text alternative for the second photo\"
-      {author_attr} Jane Doe
-      {license_attr} CC-BY-SA-4
-    ...",
+      {author_attr} Don Pettit
+
+    - {path_attr} examples/photos/solar-eclipse.jpg
+      {alt_attr} \"A total solar eclipse. The moon blocks out the sun and creates a
+      stunning ring of colorful red light against the black background.\"
+      {license_attr} CC-BY-SA-3
+      {author_attr} Luc Viatour",
                   path_attr = "path:".green(), alt_attr = "alt:".green(),
                   author_attr = "author:".green(),
                   license_attr = "license:".green());