From b8810561b40311fe49dd54cabb35f573906e79d2 Mon Sep 17 00:00:00 2001 From: Duncan Bayne Date: Mon, 23 Sep 2024 16:07:05 +1000 Subject: [PATCH] Add OpenGraph images to directories and generated files --- README.md | 9 +++- dev-config/halp-config.pl | 4 +- html/templates/page.html.tpl | 6 +++ lib/Halp/Generator.pm | 39 ++++++++++++++++-- t/expected/gemini/feed.xml | 4 +- t/expected/www/.static/images/opengraph.jpg | Bin 0 -> 178281 bytes ...023-05-07_first-article.html.opengraph.jpg | Bin 0 -> 20885806 bytes .../www/blog/2023-05-07_first-article.html | 5 ++- .../www/blog/2023-05-07_second-article.html | 5 ++- t/expected/www/blog/feed.xml | 4 +- t/expected/www/blog/index.html | 5 ++- t/expected/www/feed.xml | 6 +-- t/expected/www/index.html | 5 ++- t/expected/www/miscellaneous/feed.xml | 4 +- t/expected/www/miscellaneous/index.html | 5 ++- t/expected/www/projects/.opengraph.jpg | Bin 0 -> 144545 bytes t/expected/www/projects/feed.xml | 4 +- t/expected/www/projects/halp/feed.xml | 4 +- t/expected/www/projects/halp/index.html | 5 ++- t/expected/www/projects/index.html | 5 ++- .../www/projects/unicomp-overhaul/feed.xml | 4 +- .../www/projects/unicomp-overhaul/index.html | 5 ++- t/fixtures/www/.static/images/opengraph.jpg | Bin 0 -> 178281 bytes ...023-05-07_first-article.html.opengraph.jpg | Bin 0 -> 20885806 bytes t/fixtures/www/projects/.opengraph.jpg | Bin 0 -> 144545 bytes 25 files changed, 97 insertions(+), 31 deletions(-) create mode 100644 t/expected/www/.static/images/opengraph.jpg create mode 100644 t/expected/www/blog/.2023-05-07_first-article.html.opengraph.jpg create mode 100644 t/expected/www/projects/.opengraph.jpg create mode 100644 t/fixtures/www/.static/images/opengraph.jpg create mode 100644 t/fixtures/www/blog/.2023-05-07_first-article.html.opengraph.jpg create mode 100644 t/fixtures/www/projects/.opengraph.jpg diff --git a/README.md b/README.md index fb864ed..3c6307f 100644 --- a/README.md +++ b/README.md @@ -31,12 +31,17 @@ $ prove -rv t halp is licensed under the GNU Affero General Public License 3.0. - ## credits * [Brad Taunt](https://bt.ht/) for an excellent [suggestion on how to approach site navigation without hamburger menus](https://btxx.org/posts/hamburgers). * [Mateus V. Farias](https://github.com/fariasmateuss) for [favicon-generator](https://github.com/fariasmateuss/favicon-generator). -* The Avatar image in the test data is ["Ang and Momo"](https://www.deviantart.com/art-of-li/art/Ang-and-Momo-1017030845) by [Art of Li](https://www.deviantart.com/art-of-li/), licensed under [CC BY-NC-ND 3.0](https://creativecommons.org/licenses/by-nc-nd/3.0/). + +### test images + +* ["Ang and Momo"](https://www.deviantart.com/art-of-li/art/Ang-and-Momo-1017030845) by [Art of Li](https://www.deviantart.com/art-of-li/), licensed under [CC BY-NC-ND 3.0](https://creativecommons.org/licenses/by-nc-nd/3.0/). +* ["Flatlay Crafts"](https://stocksnap.io/photo/flatlay-crafts-OLQPVNTGXR) by [Kelly Ishmael](https://stocksnap.io/author/kellyishmael), licensed under [CC0](https://creativecommons.org/public-domain/cc0/). +* ["IBM PC-5150"](https://commons.wikimedia.org/wiki/File:IBM_PC-5150.JPG) by [Jordiferrer](https://commons.wikimedia.org/wiki/User:Jordiferrer), licensed under [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/deed.en). +* ["IMG_9976"](https://www.flickr.com/photos/54568729@N00/9636183501) by [Jason Scott](https://www.flickr.com/photos/textfiles/), licensed under [CC BY 2.0](https://creativecommons.org/licenses/by/2.0/). ## FAQ diff --git a/dev-config/halp-config.pl b/dev-config/halp-config.pl index 6f2c588..9b8d118 100644 --- a/dev-config/halp-config.pl +++ b/dev-config/halp-config.pl @@ -7,13 +7,13 @@ domain => 'example.com', gemini => { - host => '0.0.0.0', + host => 'http://0.0.0.0:8080', input_path => './t/fixtures/gemini', output_path => './tmp/gemini' }, web => { - host => '0.0.0.0', + host => 'http://0.0.0.0:8080', input_path => './t/fixtures/www', output_path => './tmp/www' } diff --git a/html/templates/page.html.tpl b/html/templates/page.html.tpl index 47314cc..5db33ac 100644 --- a/html/templates/page.html.tpl +++ b/html/templates/page.html.tpl @@ -21,6 +21,12 @@ + + { + if ($image_url ne "") { + $OUT .= "\n"; + } + }