Tweak base URL system

This commit is contained in:
Jesper Hess 2016-11-08 23:09:59 +01:00
parent 870e07ee8f
commit 377d676080
Signed by: graffen
GPG key ID: 351A89E40D763F0F
3 changed files with 5 additions and 9 deletions

View file

@ -1,7 +1,3 @@
<!-- _includes/base.html --> {% capture lvl %}{{ page.url | append:'index.html' | split:'/' | size }}{% endcapture %}
{% assign base = '' %} {% capture base %}{% for i in (3..lvl) %}../{% endfor %}{% endcapture %}
{% assign depth = page.url | split: '/' | size | minus: 1 %} <!-- {{ base }} -->
{% if depth <= 1 %}{% assign base = '.' %}
{% elsif depth == 2 %}{% assign base = '..' %}
{% elsif depth == 3 %}{% assign base = '../..' %}
{% elsif depth == 4 %}{% assign base = '../../..' %}{% endif %}

View file

@ -7,7 +7,7 @@
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title> <title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}"> <meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
<link rel="stylesheet" href="{{base}}/css/main.css"> <link rel="stylesheet" href="{{base}}css/main.css">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: base}}"> <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: base}}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{base}}feed.xml" /> <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{base}}feed.xml" />
</head> </head>

View file

@ -79,4 +79,4 @@ The following keys have been deprecated for one reason or another. Please don't
[sshkey_signed]:graffen-ssh-key.txt.asc [sshkey_signed]:graffen-ssh-key.txt.asc
[bitcointrezor]:https://bitcointrezor.com [bitcointrezor]:https://bitcointrezor.com
[transitionnotice]:transition-notice.html [transitionnotice]:transition-notice.html
[keysigningpolicy]:keysigning/policy/ [keysigningpolicy]:keysigning/policy/index.html