_includes: add Cloudflare's base.html

This commit is contained in:
Aminda Suomalainen 2019-08-08 19:50:16 +03:00
parent caac604cdd
commit 85201505fc
No known key found for this signature in database
GPG Key ID: 0C207F07B2F32B67

11
_includes/base.html Normal file
View File

@ -0,0 +1,11 @@
<!-- 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. -->