diff options
author | nodiscc <nodiscc@gmail.com> | 2018-08-30 19:36:22 +0200 |
---|---|---|
committer | nodiscc <nodiscc@gmail.com> | 2018-09-09 16:21:03 +0200 |
commit | 2b4f391559586af734d5d5cb5886aa78c4f9557d (patch) | |
tree | d5a01fc5fa08a08b7f5082205751cc14c97205fc | |
parent | f28b73b21f705102f8536cd16ea28122aa870e49 (diff) | |
download | Shaarli-2b4f391559586af734d5d5cb5886aa78c4f9557d.tar.gz Shaarli-2b4f391559586af734d5d5cb5886aa78c4f9557d.tar.zst Shaarli-2b4f391559586af734d5d5cb5886aa78c4f9557d.zip |
add "noindex, nofollow" HTML robots meta-tag to documentation pages
- Customize the "readthedocs" mkdocs theme: https://www.mkdocs.org/user-guide/styling-your-docs/#customizing-a-theme
- Adds a '<meta name="robots" content="noindex, nofollow">' HTML tag on each page
- Do not include robots directive on readthedocs.org, only in local builds
-rw-r--r-- | doc/custom_theme/main.html | 25 | ||||
-rw-r--r-- | mkdocs.yml | 4 |
2 files changed, 28 insertions, 1 deletions
diff --git a/doc/custom_theme/main.html b/doc/custom_theme/main.html new file mode 100644 index 00000000..69b398f6 --- /dev/null +++ b/doc/custom_theme/main.html | |||
@@ -0,0 +1,25 @@ | |||
1 | {% extends "base.html" %} | ||
2 | |||
3 | {# | ||
4 | The entry point for the ReadTheDocs Theme. | ||
5 | |||
6 | Any theme customisations should override this file to redefine blocks defined in | ||
7 | the various templates. The custom theme should only need to define a main.html | ||
8 | which `{% extends "base.html" %}` and defines various blocks which will replace | ||
9 | the blocks defined in base.html and its included child templates. | ||
10 | #} | ||
11 | |||
12 | {%- block site_meta %} | ||
13 | <meta charset="utf-8"> | ||
14 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
15 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
16 | |||
17 | {%- if 'media.readthedocs.org' not in config.extra_css[0] %} | ||
18 | <meta name="robots" content="noindex, nofollow"> | ||
19 | {%- endif %} | ||
20 | |||
21 | {% if page and page.is_homepage %}<meta name="description" content="{{ config.site_description }}">{% endif %} | ||
22 | {% if config.site_author %}<meta name="author" content="{{ config.site_author }}">{% endif %} | ||
23 | {% if config.site_favicon %}<link rel="shortcut icon" href="{{ config.site_favicon|url }}"> | ||
24 | {% else %}<link rel="shortcut icon" href="{{ 'img/favicon.ico'|url }}">{% endif %} | ||
25 | {%- endblock %} | ||
@@ -2,7 +2,9 @@ site_name: Shaarli Documentation | |||
2 | repo_url: https://github.com/shaarli/Shaarli | 2 | repo_url: https://github.com/shaarli/Shaarli |
3 | edit_uri: edit/master/doc/md | 3 | edit_uri: edit/master/doc/md |
4 | site_description: The personal, minimalist, super-fast, database free, bookmarking service | 4 | site_description: The personal, minimalist, super-fast, database free, bookmarking service |
5 | theme: readthedocs | 5 | theme: |
6 | name: readthedocs | ||
7 | custom_dir: doc/custom_theme/ | ||
6 | docs_dir: doc/md | 8 | docs_dir: doc/md |
7 | site_dir: doc/html | 9 | site_dir: doc/html |
8 | # Disable strict mode until ReadTheDocs provides up-to-date MkDocs settings: | 10 | # Disable strict mode until ReadTheDocs provides up-to-date MkDocs settings: |