Browse Source

_includes: add Cloudflare's base.html

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

+ 11
- 0
_includes/base.html 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. -->

Loading…
Cancel
Save