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" }} {{ include "partials/fonts.vto" }}
<!-- CSS --> <!-- CSS -->
{{ include "partials/css.vto" }} {{ 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 -->
{{ favicon }} {{ favicon }}
<!-- Verifications --> <!-- Verifications -->
@ -29,16 +20,7 @@
<link rel="me" href="https://github.com/Leilukin"> <link rel="me" href="https://github.com/Leilukin">
<link rel="authorization_endpoint" href="https://indieauth.com/auth"> <link rel="authorization_endpoint" href="https://indieauth.com/auth">
<!-- JavaScript --> <!-- JavaScript -->
<script src="{{ getBundleFileUrl 'js' }}" defer></script> {{ include "partials/js.vto" }}
{{ 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 }}
<title> <title>
{{- title ? `${title} | ` : '' -}} {{- title ? `${title} | ` : '' -}}

View File

@ -16,7 +16,7 @@
{{ /if }} {{ /if }}
{{ if externalCss }} {{ if externalCss }}
{{ for file of externalCss }} {{ for file of externalCss }}
<link rel="stylesheet" href="{{ externalCss }}"> <link rel="stylesheet" href="{{ file }}">
{{ /for }} {{ /for }}
{{ /if }} {{ /if }}
<style>{{ getBundle "css" }}</style> <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 title: Search
externalCss: "/pagefind/pagefind-ui.css" externalCss: ["/pagefind/pagefind-ui.css"]
eleventyComputed: eleventyComputed:
desc: Search {{ sitemeta.siteName }}. desc: Search {{ sitemeta.siteName }}.
--- ---