diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-03-07 21:46:27 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-03-07 21:46:27 +0100 |
| commit | 0f3fcf7c383271a3762b52e38309bc18fca49aec (patch) | |
| tree | 50587cfd0f39fa932cadb4d6703d847c2220224c /src/generators.c | |
| parent | 895513e06150927cf5db6600ca164bdae15d4d75 (diff) | |
| download | cataract-0f3fcf7c383271a3762b52e38309bc18fca49aec.tar.xz | |
Favicon support
Diffstat (limited to 'src/generators.c')
| -rw-r--r-- | src/generators.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/generators.c b/src/generators.c index e07a880..992370a 100644 --- a/src/generators.c +++ b/src/generators.c @@ -356,6 +356,14 @@ write_html_album (TGallerySetup *setup, g_free (s1); s1 = s2; } + if (setup->favicon_file && strlen (setup->favicon_file) > 0) { + if (setup->favicon_type) + s2 = g_strdup_printf ("%s\t<link rel=\"icon\" type=\"%s\" href=\"%s\" />\n", s1, setup->favicon_type, setup->favicon_file); + else + s2 = g_strdup_printf ("%s\t<link rel=\"icon\" href=\"%s\" />\n", s1, setup->favicon_file); + g_free (s1); + s1 = s2; + } replace_table_add_key (global_replace_table, "CGG_META_TAGS", s1); g_free (s1); @@ -805,6 +813,14 @@ write_html_image (TGallerySetup *setup, g_free (s1); s1 = s2; } + if (setup->favicon_file && strlen (setup->favicon_file) > 0) { + if (setup->favicon_type) + s2 = g_strdup_printf ("%s\t<link rel=\"icon\" type=\"%s\" href=\"%s\" />\n", s1, setup->favicon_type, setup->favicon_file); + else + s2 = g_strdup_printf ("%s\t<link rel=\"icon\" href=\"%s\" />\n", s1, setup->favicon_file); + g_free (s1); + s1 = s2; + } replace_table_add_key (replace_table, "CGG_META_TAGS", s1); g_free (s1); @@ -950,6 +966,18 @@ build_tree (TGallerySetup *setup, g_free (s2); if (setup->verbose) printf (" done.\n"); + if (setup->favicon_file && strlen (setup->favicon_file) > 0) { + if (setup->verbose) printf ("Writing '%s' ...", setup->favicon_file); + s3 = g_path_get_dirname (setup->setup_xml_path); + s1 = g_strconcat (s3, "/", setup->favicon_file, NULL); + s2 = g_strconcat (dst_dir, "/", setup->favicon_file, NULL); + copy_file (s1, s2); + g_free (s1); + g_free (s2); + g_free (s3); + if (setup->verbose) printf (" done.\n"); + } + /* Prepare target thumbnail directory */ thumb_dir = g_strconcat (dst_dir, "/", THUMBNAIL_DIR, NULL); |
