summaryrefslogtreecommitdiff
path: root/generators.c
diff options
context:
space:
mode:
Diffstat (limited to 'generators.c')
-rw-r--r--generators.c46
1 files changed, 36 insertions, 10 deletions
diff --git a/generators.c b/generators.c
index 0a07eb8..904d407 100644
--- a/generators.c
+++ b/generators.c
@@ -327,13 +327,26 @@ 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);
+ if (strstr (b, "<!-- $(CGG_META_TAGS) -->")) {
+ s1 = g_strdup_printf ("\t<meta name=\"generator\" content=\"Cataract Gallery Generator v%s\" />\n", APP_VERSION);
+ if (setup->meta_author) {
+ s2 = g_strdup_printf ("%s\t<meta name=\"author\" content=\"%s\" />\n", s1, setup->meta_author);
+ g_free (s1);
+ s1 = s2;
+ }
+ if (setup->meta_description) {
+ s2 = g_strdup_printf ("%s\t<meta name=\"description\" content=\"%s\" />\n", s1, setup->meta_description);
+ g_free (s1);
+ s1 = s2;
+ }
+ if (setup->meta_keywords) {
+ s2 = g_strdup_printf ("%s\t<meta name=\"keywords\" content=\"%s\" />\n", s1, setup->meta_keywords);
+ g_free (s1);
+ s1 = s2;
+ }
+ str_replace (&b, "<!-- $(CGG_META_TAGS) -->", 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);
@@ -762,13 +775,26 @@ write_html_image (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);
+ if (strstr (b, "<!-- $(CGG_META_TAGS) -->")) {
+ s1 = g_strdup_printf ("\t<meta name=\"generator\" content=\"Cataract Gallery Generator v%s\" />\n", APP_VERSION);
+ if (setup->meta_author) {
+ s2 = g_strdup_printf ("%s\t\t<meta name=\"author\" content=\"%s\" />\n", s1, setup->meta_author);
+ g_free (s1);
+ s1 = s2;
+ }
+ if (setup->meta_description) {
+ s2 = g_strdup_printf ("%s\t<meta name=\"description\" content=\"%s\" />\n", s1, setup->meta_description);
+ g_free (s1);
+ s1 = s2;
+ }
+ if (setup->meta_keywords) {
+ s2 = g_strdup_printf ("%s\t<meta name=\"keywords\" content=\"%s\" />\n", s1, setup->meta_keywords);
+ g_free (s1);
+ s1 = s2;
+ }
+ str_replace (&b, "<!-- $(CGG_META_TAGS) -->", 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));