-rw-r--r-- | cgit.h | 1 | ||||
-rw-r--r-- | cgitrc | 5 | ||||
-rw-r--r-- | shared.c | 3 | ||||
-rw-r--r-- | ui-shared.c | 2 |
4 files changed, 11 insertions, 0 deletions
@@ -141,2 +141,3 @@ extern char *cgit_cache_root; extern char *cgit_repo_group; +extern char *cgit_robots; @@ -10,2 +10,7 @@ +## This variable can be used to override the default value for "robots" +## meta-tag. If unset, the meta-tag isn't generated. +#robots=index, nofollow + + ## Set allowed snapshot types by default. Can be overridden per repo @@ -28,2 +28,3 @@ char *cgit_cache_root = CGIT_CACHE_ROOT; char *cgit_repo_group = NULL; +char *cgit_robots = "index, nofollow"; @@ -199,2 +200,4 @@ void cgit_global_config_cb(const char *name, const char *value) cgit_renamelimit = atoi(value); + else if (!strcmp(name, "robots")) + cgit_robots = xstrdup(value); else if (!strcmp(name, "repo.group")) diff --git a/ui-shared.c b/ui-shared.c index 5192800..2f771da 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -366,2 +366,4 @@ void cgit_print_docstart(char *title, struct cacheitem *item) htmlf("<meta name='generator' content='cgit %s'/>\n", cgit_version); + if (cgit_robots && *cgit_robots) + htmlf("<meta name='robots' content='%s'/>\n", cgit_robots); html("<link rel='stylesheet' type='text/css' href='"); |