hugo-theme-next/layouts/_default/baseof.html
2022-05-28 15:48:52 +08:00

57 lines
2.1 KiB
HTML

{{- $P := .Site.Params -}}
{{- $lang := replaceRE "-([a-z]+)" (upper (substr .Site.Language -3)) .Site.Language -}}
{{- .Scratch.Set "lang" $lang -}}
{{- $vendors := .Site.Data.resources.vendors -}}
{{- $pluginVen := $P.vendors.plugins -}}
{{- $pluginCDN := index $vendors $pluginVen -}}
{{- .Scratch.Set "pluginCDN" $pluginCDN -}}
{{ $posts := len .Site.RegularPages }}
{{- .Scratch.Set "posts" $posts -}}
<!DOCTYPE html>
<html lang="{{ $lang }}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
{{ hugo.Generator }}
<link rel="shortcut icon" type="image/x-icon" href="{{ $P.favicon.icon }}">
<link rel="icon" type="image/x-icon" href="{{ $P.favicon.icon }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ $P.favicon.small }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ $P.favicon.medium }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ $P.favicon.appleTouchIcon }}">
{{- partial "head.html" (dict "P" $P "Page" .Page "Scratch" .Scratch) }}
<title>{{ .Title | default .Site.Title }}</title>
<noscript>
<link rel="stylesheet" href="/css/noscript.css">
</noscript>
</head>
<body itemscope itemtype="http://schema.org/WebPage" {{ if $P.motion.enable }} class="use-motion" {{ end }}>
<div class="headband"></div>
<main class="main">
<header class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner">
{{- partial "header" (dict "P" $P "Page" .Page "Scratch" .Scratch) }}
</div>
<!-- Sidebar -->
{{- if ne $P.sidebar.display "remove" }}
{{- partial "sidebar" (dict "P" $P "Page" .Page "Scratch" .Scratch) }}
{{- end }}
</header>
<!-- Widgets -->
{{ partial "widgets" (dict "P" $P) }}
<div class="main-inner">
<!-- Submenu,Content,Comment -->
{{- block "main" . }}{{- end }}
</div>
</main>
<footer class="footer">
<div class="footer-inner">
{{- partial "footer" (dict "P" $P "Page" .Page "Scratch" .Scratch) }}
</div>
</footer>
{{- partial "scripts" (dict "P" $P "Page" .Page "Scratch" .Scratch) }}
</body>
</html>