summaryrefslogtreecommitdiff
path: root/generators.c
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2008-08-13 23:11:19 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2008-08-13 23:11:19 +0200
commit5a020e6640b2723a57176e6596ea665442d53672 (patch)
tree818b324754678a526085a8cdac76ec4793955db5 /generators.c
parent3fadc8b6863a267884e242b9e6303cfd117fce4e (diff)
downloadcataract-5a020e6640b2723a57176e6596ea665442d53672.tar.xz
Fix up meta tags, add support for author tag
Diffstat (limited to 'generators.c')
-rw-r--r--generators.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/generators.c b/generators.c
index 654e01a..0a07eb8 100644
--- a/generators.c
+++ b/generators.c
@@ -327,6 +327,13 @@ write_html_album (TGallerySetup *setup,
str_replace (&b, "<!-- $(FOOTER) -->", s1, NULL);
g_free (s1);
}
+ if (strstr (b, "<!-- $(META_GENERATOR) -->")) {
+ s1 = g_strdup_printf ("Cataract Gallery Generator v%s", APP_VERSION);
+ str_replace (&b, "<!-- $(META_GENERATOR) -->", s1, NULL);
+ g_free (s1);
+ }
+ if (strstr (b, "<!-- $(META_AUTHOR) -->") && setup->meta_author)
+ str_replace (&b, "<!-- $(META_AUTHOR) -->", setup->meta_author, NULL);
if (strstr (b, "<!-- $(TOTAL_ITEMS) -->")) {
s1 = g_strdup_printf ("%d", items->items->len);
str_replace (&b, "<!-- $(TOTAL_ITEMS) -->", s1, NULL);
@@ -749,12 +756,19 @@ write_html_image (TGallerySetup *setup,
str_replace (&b, "<!-- $(LINK_PREV) -->", "index.html", NULL);
}
- if (strstr (b, "<!-- $(FOOTER) -->")) {
+ if (strstr (b, "<!-- $(FOOTER) -->") && setup->footer) {
s1 = g_strdup (setup->footer);
fix_entities (&s1);
str_replace (&b, "<!-- $(FOOTER) -->", s1, NULL);
g_free (s1);
}
+ if (strstr (b, "<!-- $(META_GENERATOR) -->")) {
+ s1 = g_strdup_printf ("Cataract Gallery Generator v%s", APP_VERSION);
+ str_replace (&b, "<!-- $(META_GENERATOR) -->", s1, NULL);
+ g_free (s1);
+ }
+ if (strstr (b, "<!-- $(META_AUTHOR) -->") && setup->meta_author)
+ str_replace (&b, "<!-- $(META_AUTHOR) -->", setup->meta_author, NULL);
if (! fputs (b, fout)) {
fprintf (stderr, "write_html_image: error writing to file \"%s\": %s\n", dst, strerror (errno));