adding page based preload option, making preload of monospaced font in posts default to avoid CLS
This commit is contained in:
parent
22ce4d84a3
commit
39a447db6f
2 changed files with 15 additions and 0 deletions
|
|
@ -40,6 +40,16 @@
|
||||||
crossorigin
|
crossorigin
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- preloads in page data -->
|
||||||
|
{% if preloads -%}
|
||||||
|
<!-- prettier-ignore -->
|
||||||
|
<link rel="preload"
|
||||||
|
href="{{ preloads.href }}"
|
||||||
|
as="{{ preloads.as }}"
|
||||||
|
{% if preloads.type %}type={{ preloads.type }}{% endif %}{% if preloads.imagesrcset %}imagesrcset="{{ preloads.imagesrcset }}" {% endif %}
|
||||||
|
{% if preloads.crossorigin %}crossorigin{% endif %} />
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<!-- defered js -->
|
<!-- defered js -->
|
||||||
<script type="module" src="/assets/app.js" defer></script>
|
<script type="module" src="/assets/app.js" defer></script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
---
|
---
|
||||||
layout: base
|
layout: base
|
||||||
|
preloads:
|
||||||
|
href: '/assets/fonts/robotomono/robotomono-variablefont_wght-webfont.woff2'
|
||||||
|
as: 'font'
|
||||||
|
type: 'font/woff2'
|
||||||
|
crossorigin: true
|
||||||
---
|
---
|
||||||
|
|
||||||
<article class="region blog">
|
<article class="region blog">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue