From 5a020e6640b2723a57176e6596ea665442d53672 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Wed, 13 Aug 2008 23:11:19 +0200 Subject: Fix up meta tags, add support for author tag --- cgg.c | 3 --- config.h | 4 ++++ generators.c | 16 +++++++++++++++- sample/src/setup.xml | 5 +++++ setup.c | 4 ++++ setup.h | 1 + templates/template-album.tmpl | 8 ++------ templates/template-index.tmpl | 10 +++------- templates/template-view_photo.tmpl | 8 ++------ 9 files changed, 36 insertions(+), 23 deletions(-) diff --git a/cgg.c b/cgg.c index 086f003..1e8a250 100644 --- a/cgg.c +++ b/cgg.c @@ -32,9 +32,6 @@ -#define APP_VERSION "0.99.0" -#define APP_BUILD_DATE "2008-07-27" - /* diff --git a/config.h b/config.h index 3ce3d89..bf9e613 100644 --- a/config.h +++ b/config.h @@ -24,3 +24,7 @@ #define IMG_ORIG_DIR "_orig" #define SETUP_XML "setup.xml" + +#define APP_VERSION "0.99.0" +#define APP_BUILD_DATE "2008-07-27" + 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, "", s1, NULL); g_free (s1); } + if (strstr (b, "")) { + s1 = g_strdup_printf ("Cataract Gallery Generator v%s", APP_VERSION); + str_replace (&b, "", s1, NULL); + g_free (s1); + } + if (strstr (b, "") && setup->meta_author) + str_replace (&b, "", setup->meta_author, NULL); if (strstr (b, "")) { s1 = g_strdup_printf ("%d", items->items->len); str_replace (&b, "", s1, NULL); @@ -749,12 +756,19 @@ write_html_image (TGallerySetup *setup, str_replace (&b, "", "index.html", NULL); } - if (strstr (b, "")) { + if (strstr (b, "") && setup->footer) { s1 = g_strdup (setup->footer); fix_entities (&s1); str_replace (&b, "", s1, NULL); g_free (s1); } + if (strstr (b, "")) { + s1 = g_strdup_printf ("Cataract Gallery Generator v%s", APP_VERSION); + str_replace (&b, "", s1, NULL); + g_free (s1); + } + if (strstr (b, "") && setup->meta_author) + str_replace (&b, "", setup->meta_author, NULL); if (! fputs (b, fout)) { fprintf (stderr, "write_html_image: error writing to file \"%s\": %s\n", dst, strerror (errno)); diff --git a/sample/src/setup.xml b/sample/src/setup.xml index 8f4b632..5cca5d8 100644 --- a/sample/src/setup.xml +++ b/sample/src/setup.xml @@ -28,6 +28,11 @@ + + + John Doe + +