Remove html suffixes

This commit is contained in:
Alexis Hassler 2019-06-20 22:21:51 +02:00
parent a05643fc76
commit 07f1eca644
17 changed files with 55 additions and 31 deletions

View File

@ -1,10 +1,33 @@
RewriteEngine On
# ################
# RSS
# ################
RewriteCond %{QUERY_STRING} ^title=Special:Newpages\&feed=rss$
RewriteRule ^index\.php$ /feed.xml? [R=301,L]
RewriteRule ^index\.php$ https://%{HTTP_HOST}/feed.xml [R=301,NE,QSD,L]
# ################
# Conmpanion pages
# ################
RewriteCond %{QUERY_STRING} ^title=Sp%C3%A9cial:Nouvelles_pages&feed=rss$
RewriteRule ^index\.php$ /feed.xml? [R=301,L]
RewriteRule ^index\.php$ https://%{HTTP_HOST}/feed.xml [R=301,NE,QSD,L]
RewriteCond %{QUERY_STRING} ^title=Special:Export/(.*)$
RewriteRule ^index\.php$ https://%{HTTP_HOST}/%1 [R=301,NE,QSD,L]
RewriteCond %{QUERY_STRING} ^title=Sp%C3%A9cial:Exporter/(.*)$
RewriteRule ^index\.php$ https://%{HTTP_HOST}/%1 [R=301,NE,QSD,L]
RewriteCond %{QUERY_STRING} ^title=Discussion:(.*)$
RewriteRule ^index\.php$ https://%{HTTP_HOST}/%1 [R=301,NE,QSD,L]
# ################
# Main pages
# ################
RewriteCond %{QUERY_STRING} [^&?]*?=([^&?]*)[&]?(.*)
RewriteRule ^index\.php$ /%1.html?%2 [R=301,L]
RewriteRule ^index\.php$ https://%{HTTP_HOST}/%1?%2 [R=301,NE,L]
# ################
# Error pages
# ################
ErrorDocument 404 https://%{HTTP_HOST}/404

View File

@ -11,8 +11,8 @@ menu: ['global']
{%- assign page_name = page_name | append: " - " | append: page.title -%}
{%- endif -%}
<li>
<a href="{{ page.url }}.html">{{ page_name }}</a>&nbsp; [{{ page.bytes }} bytes]
{%- if page.author_full -%}&nbsp;(by <a href="{{ page.author_full.url }}.html">{{ page.author_full.name }}</a>) {%- endif -%}
<a href="{{ page.url }}">{{ page_name }}</a>&nbsp; [{{ page.bytes }} bytes]
{%- if page.author_full -%}&nbsp;(by <a href="{{ page.author_full.url }}">{{ page.author_full.name }}</a>) {%- endif -%}
</li>
{%- endfor -%}
</ul>

View File

@ -13,6 +13,6 @@ menu: ['global']
{%- endif -%}
{%- endfor -%}
<li><a href="/{{ site.data.i18n[site.lang].prefix.tag }}{{ tag }}.html">{{ tag }}</a> ({{counter}} pages)</li>
<li><a href="/{{ site.data.i18n[site.lang].prefix.tag }}{{ tag }}">{{ tag }}</a> ({{counter}} pages)</li>
{%- endfor -%}
</ul>

View File

@ -7,7 +7,7 @@ menu: ['global']
{%- for source_page in site.data.wiki_redirects -%}
<li>
{%- assign redirect_page = source_page.redirect_target -%}
<a href="{{ source_page.url }}.html">{{ source_page.id }}</a><a href="{{ redirect_page.url }}.html">{{ redirect_page.title }}</a>
<a href="{{ source_page.url }}">{{ source_page.id }}</a><a href="{{ redirect_page.url }}">{{ redirect_page.title }}</a>
</li>
{%- endfor -%}
</ul>

View File

@ -6,7 +6,7 @@ menu: ['global']
<ul>
{%- for author in site.data.authors -%}
<li>
<a href="{{ author.url }}.html">{{ author.name }}</a> (<a href="{{ author.contributions_url }}.html">{{author.contributions_count}} pages</a>)
<a href="{{ author.url }}">{{ author.name }}</a> (<a href="{{ author.contributions_url }}">{{author.contributions_count}} pages</a>)
</li>
{%- endfor -%}
</ul>

View File

@ -7,7 +7,7 @@ menu: ['global']
<ol>
{%- for page in long_pages limit:50 -%}
<li>
<a href="{{ page.url }}.html">{{ page.title }}</a>&nbsp; [{{ page.bytes }} bytes]
<a href="{{ page.url }}">{{ page.title }}</a>&nbsp; [{{ page.bytes }} bytes]
</li>
{%- endfor -%}
</ol>

View File

@ -7,7 +7,7 @@ menu: ['global']
<ul>
{%- for page in recent_changes limit:20 -%}
<li>
<a href="{{ page.url }}.html">{{ page.title }}</a>
<a href="{{ page.url }}">{{ page.title }}</a>
&nbsp;- {{ page.modified }}
</li>
{%- endfor -%}

View File

@ -7,7 +7,7 @@ menu: ['global']
<ol>
{%- for page in long_pages limit:50 -%}
<li>
<a href="{{ page.url }}.html">{{ page.title }}</a>&nbsp; [{{ page.bytes }} bytes]
<a href="{{ page.url }}">{{ page.title }}</a>&nbsp; [{{ page.bytes }} bytes]
</li>
{%- endfor -%}
</ol>

View File

@ -7,14 +7,15 @@ layout: null
<title>{{ site.title }}</title>
<description>{{ site.description }}</description>
<link>{{ site.url }}</link>
{% for post in site.data.wiki_pages reversed%}
{% assign wiki_pages = site.data.wiki_pages | sort: 'created' %}
{% for post in wiki_pages reversed%}
{% unless post.draft %}
<item>
<title>{{ post.title | xml_escape }}</title>
<description>{{ post.description | xml_escape | truncate: 300 }}</description>
<description>{{ post.excerpt | strip_html }}</description>
<pubDate>{{ post.created | date_to_xmlschema }}</pubDate>
<link>{{ post.url | prepend: site.url | append: '.html'}}</link>
<guid isPermaLink="true">{{ post.url | prepend: site.url | append: '.html' }}</guid>
<link>{{ post.url | prepend: site.url}}</link>
<guid isPermaLink="true">{{ post.url | prepend: site.url }}</guid>
</item>
{% endunless %}
{% endfor %}

View File

@ -4,7 +4,7 @@ title: Tags
---
<ul>
{% for tag in site.data.wiki_tags %}
<li id="n-tag-{{ tag }}"><a href="/{{ site.data.i18n[site.lang].prefix.tag }}{{ tag }}.html">{{ tag }}</a></li>
<li id="n-tag-{{ tag }}"><a href="/{{ site.data.i18n[site.lang].prefix.tag }}{{ tag }}">{{ tag }}</a></li>
<ul>
{% for other_page in site.data.wiki_pages %}
{% if other_page.tags contains tag %}

View File

@ -2,7 +2,7 @@
<h3>{{ site.data.i18n[site.lang].label.global_pages }}</h3>
<ul class="portlet-body">
{%- for link in site.data.i18n[site.lang].global_pages -%}
<li><a href="{{link.url}}.html">{{link.text}}</a></li>
<li><a href="{{link.url}}">{{link.text}}</a></li>
{%- endfor -%}
</ul>
</div>

View File

@ -1,3 +1,3 @@
<div id="logo">
<a href="/{{ site.data.i18n[site.lang].home }}.html" style="background-image: url({{ site.data.i18n[site.lang].logo }});" title="{{ site.data.i18n[site.lang].label.main_page }}"></a>
<a href="/{{ site.data.i18n[site.lang].home }}" style="background-image: url({{ site.data.i18n[site.lang].logo }});" title="{{ site.data.i18n[site.lang].label.main_page }}"></a>
</div>

View File

@ -4,11 +4,11 @@
<div class="portlet-body">
<ul>
{%- for tag in page.tags -%}
<li id="n-tag-{{ tag }}"><a href="/{{ site.data.i18n[site.lang].prefix.tag }}{{ tag }}.html">{{ tag }}</a></li>
<li id="n-tag-{{ tag }}"><a href="/{{ site.data.i18n[site.lang].prefix.tag }}{{ tag }}">{{ tag }}</a></li>
<ul>
{%- for other_page in site.data.wiki_pages -%}
{%- if other_page.tags contains tag and other_page.id != page.id -%}
<li><a href="{{ other_page.url }}.html">{{ other_page.title }}</a></li>
<li><a href="{{ other_page.url }}">{{ other_page.title }}</a></li>
{%- endif -%}
{%- endfor -%}
</ul>

View File

@ -5,7 +5,7 @@ menu: ['global']
<ul class="columns">
{%- for doc in page.author_full.contributions -%}
<li>
<a href="{{ doc.url }}.html">{{ doc.title }}</a>
<a href="{{ doc.url }}">{{ doc.title }}</a>
</li>
{%- endfor -%}
</ul>

View File

@ -11,7 +11,7 @@
<div class="redirectMsg">
<p>{{ site.data.i18n[site.lang].label.redirect }} :</p>
<ul class="redirectText">
<li><a href="{{ redirect_page.url }}.html" title="{{ redirect_page.name }}">{{ redirect_page.title }}</a></li>
<li><a href="{{ redirect_page.url }}" title="{{ redirect_page.name }}">{{ redirect_page.title }}</a></li>
</ul>
</div>
</div>

View File

@ -11,12 +11,12 @@ module Jekyll
def initialize(site, author)
@site = site
@base = site.source
@name = "#{author['contributions_url']}.html"
@name = "#{author['contributions_url']}"
self.process(@name)
self.read_yaml(File.join(@base, '_layouts'), 'contributions.html')
self.read_yaml(File.join(@base, '_layouts'), 'contributions')
self.data['author_full'] = author
self.data['title'] = "Contributions by <a href=\"/#{site.data['i18n'][site.config['lang']]['prefix']['user']}#{author['id']}.html\">#{author['name']}</a>"
self.data['title'] = "Contributions by <a href=\"/#{site.data['i18n'][site.config['lang']]['prefix']['user']}#{author['id']}\">#{author['name']}</a>"
end
end
end

View File

@ -249,10 +249,10 @@ References:
# Examples
* Example of a [new page](New.html)
* Example of a [legacy page](Old.html)
* Example of a [redirected page](Redirect.html)
* Example of a [user page](./User:Alexis.html)
* Example of a [new page](New)
* Example of a [legacy page](Old)
* Example of a [redirected page](Redirect)
* Example of a [user page](./User:Alexis)
* [RSS](feed.xml) feed of new pages
* Example of a [tag page](./Tag:Example.html)
* [All tags page](./tags.html)
* Example of a [tag page](./Tag:Example)
* [All tags page](./tags)