Browse Source

_includes: base.html: remove comments & head.html: refer to css with {{base}}

remotes/blesmrt/master
Mikaela Suomalainen 3 months ago
parent
commit
1e7c02fed7
Signed by: Mikaela Suomalainen <mikaela+git@mikaela.info> GPG Key ID: 0C207F07B2F32B67
2 changed files with 2 additions and 7 deletions
  1. +0
    -6
      _includes/base.html
  2. +2
    -1
      _includes/head.html

+ 0
- 6
_includes/base.html View File

@@ -1,11 +1,5 @@
<!-- Cloudflare recommends these for IPFS at https://developers.cloudflare.com/distributed-web/ipfs-gateway/updating-for-ipfs/ -->

{% assign depth = page.url | split: '/' | size | minus: 1 %}
{% if depth <= 1 %}{% assign base = '.' %}
{% elsif depth == 2 %}{% assign base = '..' %}
{% elsif depth == 3 %}{% assign base = '../..' %}
{% elsif depth == 4 %}{% assign base = '../../..' %}{% endif %}

<!-- if anything has to link to root, it should use `{%- include base.html -%}`
and normal `/css/main.css` etc. should become `{{base}}/css/main.css`
says the page above. base.html ends here. -->

+ 2
- 1
_includes/head.html View File

@@ -1,3 +1,4 @@
{%- include base.html -%}
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -11,7 +12,7 @@
<link rel="openid.delegate" href="https://mikaela.info/" />
<link rel="openid.server" href="https://openid.indieauth.com/openid" />

<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
<link rel="stylesheet" href="{{ "{{base}}/css/main.css" | prepend: site.baseurl }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/blog/feed.xml" | prepend: site.baseurl | prepend: site.url }}" />
<link rel="alternate" type="application/rss+xml" title="{{ site.title }} - in English" href="{{ "/blog/feed.en.xml" | prepend: site.baseurl | prepend: site.url }}" />

Loading…
Cancel
Save