diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/main/about/channels.html | 9 | ||||
-rw-r--r-- | templates/robots.txt | 14 | ||||
-rw-r--r-- | templates/sitemap.xml | 64 | ||||
-rw-r--r-- | templates/wiki/base.html | 3 | ||||
-rw-r--r-- | templates/wiki/page_view.html | 5 |
5 files changed, 82 insertions, 13 deletions
diff --git a/templates/main/about/channels.html b/templates/main/about/channels.html index 4b4aab9c..ac3d95b5 100644 --- a/templates/main/about/channels.html +++ b/templates/main/about/channels.html @@ -254,15 +254,6 @@ </tbody> </table> - <h2>Minecraft</h2> - - <p> - Channels in this section are strictly related to - <a href="{{ url_for("wiki.page", page="minecraft") }}">our Minecraft server</a> - while discussion - is quite laid back, we do not allow users to advertise their own servers and prefer that they - make use of the voice channels here for game-related voice chat. - </p> - <h2>Voice</h2> <p> diff --git a/templates/robots.txt b/templates/robots.txt new file mode 100644 index 00000000..fa61be5e --- /dev/null +++ b/templates/robots.txt @@ -0,0 +1,14 @@ +{# robots.txt is a little picky about whitespace and newlines - that's why the below looks kind of bad.#} +{% if rules is defined and rules %} +{% for user_agent, disallowed in rules.items() %} +User-agent: {{ user_agent }} +{% for rule in rules %} +Disallow: {{ rule }} +{% endfor %} +{% endfor %} +{% else %} +User-agent: * +Disallow: +{% endif %} + +Sitemap: {{ sitemap_url }} diff --git a/templates/sitemap.xml b/templates/sitemap.xml new file mode 100644 index 00000000..3d63d3a9 --- /dev/null +++ b/templates/sitemap.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<urlset + xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" + xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" + xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" + xmlns:video="http://www.google.com/schemas/sitemap-video/1.1" +> + +{% for url in urls %} + <url> + <loc>{{ url.url }}</loc> + + {% if url.images is defined %} + {% for image in url.images %} + <image:image> + <image:loc>{{ image.url }}</image:loc> + <image:caption>{{ image.caption }}</image:caption> + </image:image> + {% endfor %} + {% endif %} + + {% if url.videos is defined %} + {% for video in url.videos %} + <video:video> + <video:description>{{ video.description }}</video:description> + <video:title>{{ video.title }}</video:title> + + <video:content_loc>{{ video.url }}</video:content_loc> + <video:player_loc>{{ video.player_url }}</video:player_loc> + <video:thumbnail_loc>{{ video.thumbnail_url }}</video:thumbnail_loc> + </video:video> + {% endfor %} + {% endif %} + + {% if url.news_items is defined %} + {% for item in url.news_items %} + <news:news> + <news:publication> + <news:name>Python Discord: {{ item.section }}</news:name> + <news:language>en</news:language> + </news:publication> + + <news:genres>PressRelease, Blog</news:genres> + <news:publication_date>{{ item.date }}</news:publication_date> + <news:title>{{ item.title }}</news:title> + <news:keywords>{{ ", ".join(item.keywords) }}</news:keywords> + </news:news> + {% endfor %} + {% endif %} + + {% if url.last_modified is defined %} + <lastmod>{{ url.last_modified }}</lastmod> + {% endif %} + + {% if url.change_frequency is defined %} + <changefreq>{{ url.change_frequency }}</changefreq> + {% endif %} + + {% if url.priority is defined %} + <priority>{{ "{0:.1f}".format(url.priority) }}</priority> + {% endif %} + </url> +{% endfor %} +</urlset> diff --git a/templates/wiki/base.html b/templates/wiki/base.html index 0e5e9733..038ee5a2 100644 --- a/templates/wiki/base.html +++ b/templates/wiki/base.html @@ -67,9 +67,6 @@ <li><a href="{{ url_for("wiki.page", page="contributing") }}"> <i class="uk-icon fas fa-fw fa-code-branch"></i> Contributing </a></li> - <li><a href="{{ url_for("wiki.page", page="minecraft") }}"> - <i class="uk-icon fas fa-fw fa-cube"></i> Minecraft - </a></li> {% set ACTIONABLE_PAGES = [ "wiki.page", "wiki.edit", "wiki.history.show", diff --git a/templates/wiki/page_view.html b/templates/wiki/page_view.html index c660ed6d..aa560390 100644 --- a/templates/wiki/page_view.html +++ b/templates/wiki/page_view.html @@ -1,7 +1,10 @@ {% extends "wiki/base.html" %} {% block title %}Wiki | {{ data["title"] }}{% endblock %} {% block og_title %}Wiki | {{ data["title"] }}{% endblock %} -{% block og_description %}{% endblock %} + +{# To be safe about whitespace formatting on various platforms, we do everything one one line here #} +{% block og_description %}{% if data.rst.startswith(".. header::") %}{{ data.text.split("\n", 1)[0] }}{% endif %}{% endblock %} + {% block page_classes %}uses-rst{% endblock %} {% block content %} |