mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
🔧 Chore: inject a theme meta tag in the HTML head on the home page only
This commit is contained in:
@@ -3,8 +3,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.LanguageCode }}">
|
||||
<head>
|
||||
{{ if (eq .Kind "home") | and (ne .Site.Params.disableThemeInject true) }}
|
||||
<meta name="theme" content='FixIt {{ .Scratch.Get "version" }}'>
|
||||
{{ end }}
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
|
||||
<meta name="robots" content="noodp" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
||||
<title>
|
||||
@@ -19,7 +22,6 @@
|
||||
{{- /* Check theme isDark before body rendering */ -}}
|
||||
{{- $theme := .Site.Params.defaulttheme -}}
|
||||
<script type="text/javascript">(window.localStorage && localStorage.getItem('theme') ? localStorage.getItem('theme') === 'dark' : ('{{ $theme }}' === 'auto' ? window.matchMedia('(prefers-color-scheme: dark)').matches : '{{ $theme }}' === 'dark')) && document.body.setAttribute('theme', 'dark');</script>
|
||||
|
||||
{{- /* Body wrapper */ -}}
|
||||
<div class="wrapper">
|
||||
{{- partial "header.html" . -}}
|
||||
|
||||
Reference in New Issue
Block a user