feat(webui): preload css, syntax is only for blobs

Amolith and Crush created

Implements: bug-0fb4c59
Co-authored-by: Crush <crush@charm.land>

Change summary

pkg/web/templates/base.html | 7 ++++++-
pkg/web/templates/blob.html | 4 ++++
2 files changed, 10 insertions(+), 1 deletion(-)

Detailed changes

pkg/web/templates/base.html 🔗

@@ -11,9 +11,14 @@
   {{if .Description}}<meta property="og:description" content="{{.Description}}">{{end}}
   <meta property="og:type" content="website">
   <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🍦</text></svg>">
+
+  <link rel="preload" href="/static/pico-2.1.1-pink.min.css" as="style">
+  <link rel="preload" href="/static/overrides.css?v=1" as="style">
+
   <link rel="stylesheet" href="/static/pico-2.1.1-pink.min.css">
   <link rel="stylesheet" href="/static/overrides.css?v=1">
-  <link rel="stylesheet" href="/static/syntax.css?v=1">
+
+  {{block "page-styles" .}}{{end}}
 </head>
 <body class="container">
   <a href="#main-content" class="skip-link">Skip to main content</a>

pkg/web/templates/blob.html 🔗

@@ -1,3 +1,7 @@
+{{define "page-styles"}}
+  <link rel="stylesheet" href="/static/syntax.css?v=1">
+{{end}}
+
 {{define "content"}}
 <nav aria-label="breadcrumb">
   <ul>