Set external CSS fromtmatter data as array

This commit is contained in:
Leilukin 2025-05-09 16:52:45 +08:00
parent 7382f250a6
commit 1c3100f747
4 changed files with 13 additions and 21 deletions

View File

@ -13,15 +13,6 @@
{{ include "partials/fonts.vto" }}
<!-- CSS -->
{{ include "partials/css.vto" }}
{{ if hasTooltips }}
<link rel="stylesheet" href="/assets/css/tooltips.css">
{{ /if }}
{{ if externalCss }}
{{ for file of externalCss }}
<link rel="stylesheet" href="{{ externalCss }}">
{{ /for }}
{{ /if }}
<style>{{ getBundle "css" }}</style>
<!-- Favicon -->
{{ favicon }}
<!-- Verifications -->
@ -29,16 +20,7 @@
<link rel="me" href="https://github.com/Leilukin">
<link rel="authorization_endpoint" href="https://indieauth.com/auth">
<!-- JavaScript -->
<script src="{{ getBundleFileUrl 'js' }}" defer></script>
{{ if toc }}
<script src="{{'/assets/js/details-utils.js'}}" defer></script>
{{ /if }}
{{ if hasCodeBlock }}
<script src="/assets/js/copycode.js" defer></script>
{{ /if }}
{{ if hasTooltips }}
<script src="/assets/js/tooltips.js" defer></script>
{{ /if }}
{{ include "partials/js.vto" }}
<title>
{{- title ? `${title} | ` : '' -}}

View File

@ -16,7 +16,7 @@
{{ /if }}
{{ if externalCss }}
{{ for file of externalCss }}
<link rel="stylesheet" href="{{ externalCss }}">
<link rel="stylesheet" href="{{ file }}">
{{ /for }}
{{ /if }}
<style>{{ getBundle "css" }}</style>

View File

@ -0,0 +1,10 @@
<script src="{{ getBundleFileUrl 'js' }}" defer></script>
{{ if toc }}
<script src="{{'/assets/js/details-utils.js'}}" defer></script>
{{ /if }}
{{ if hasCodeBlock }}
<script src="/assets/js/copycode.js" defer></script>
{{ /if }}
{{ if hasTooltips }}
<script src="/assets/js/tooltips.js" defer></script>
{{ /if }}

View File

@ -1,6 +1,6 @@
---
title: Search
externalCss: "/pagefind/pagefind-ui.css"
externalCss: ["/pagefind/pagefind-ui.css"]
eleventyComputed:
desc: Search {{ sitemeta.siteName }}.
---