]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.c
extra-head-content: introduce another option for meta tags
[ps-cgit] / cgit.c
diff --git a/cgit.c b/cgit.c
index 223dfc8164b913d36a97534d48ab89fb4a650a70..e2d789101f302a6ad4b580146e1615968a7a91e9 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -23,7 +23,7 @@ static void add_mimetype(const char *name, const char *value)
 {
        struct string_list_item *item;
 
-       item = string_list_insert(&ctx.cfg.mimetypes, xstrdup(name));
+       item = string_list_insert(&ctx.cfg.mimetypes, name);
        item->util = xstrdup(value);
 }
 
@@ -46,6 +46,8 @@ static void repo_config(struct cgit_repo *repo, const char *name, const char *va
                repo->homepage = xstrdup(value);
        else if (!strcmp(name, "defbranch"))
                repo->defbranch = xstrdup(value);
+       else if (!strcmp(name, "extra-head-content"))
+               repo->extra_head_content = xstrdup(value);
        else if (!strcmp(name, "snapshots"))
                repo->snapshots = ctx.cfg.snapshots & cgit_parse_snapshots_mask(value);
        else if (!strcmp(name, "enable-commit-graph"))
@@ -414,7 +416,7 @@ static void prepare_context(void)
        ctx.page.modified = time(NULL);
        ctx.page.expires = ctx.page.modified;
        ctx.page.etag = NULL;
-       memset(&ctx.cfg.mimetypes, 0, sizeof(struct string_list));
+       string_list_init(&ctx.cfg.mimetypes, 1);
        if (ctx.env.script_name)
                ctx.cfg.script_name = xstrdup(ctx.env.script_name);
        if (ctx.env.query_string)
@@ -797,6 +799,8 @@ static void print_repo(FILE *f, struct cgit_repo *repo)
        }
        if (repo->defbranch)
                fprintf(f, "repo.defbranch=%s\n", repo->defbranch);
+       if (repo->extra_head_content)
+               fprintf(f, "repo.extra-head-content=%s\n", repo->extra_head_content);
        if (repo->module_link)
                fprintf(f, "repo.module-link=%s\n", repo->module_link);
        if (repo->section)