halo-theme-Single/header.ftl

111 lines
5.0 KiB
Plaintext
Raw Normal View History

2022-04-12 23:07:27 +08:00
<#macro head title>
<!DOCTYPE html>
<html lang="zh">
<head>
2022-04-14 21:48:19 +08:00
<title>${title}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="renderer" content="webkit" />
<meta name="format-detection" content="telephone=no,email=no,adress=no"/>
<meta http-equiv="Cache-Control" content="no-siteapp">
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
2022-04-12 23:07:27 +08:00
<meta name="keywords" content="${meta_keywords!}"/>
<meta name="description" content="${meta_description!}" />
<#--<meta name="theme-color" content="#4285f4">-->
<meta name="theme-color" media="(prefers-color-scheme: light)" content="white">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="black">
<#-- 导航面包蟹-->
<meta property="og:image" content="${options.blog_favicon!}">
<meta property="og:description" content="${meta_description!}">
<meta property="og:type" content="website">
<meta property="og:locale" content="zh_CN">
2022-04-14 21:48:19 +08:00
<meta property="og:site_name" content="${blog_title!}">
<meta property="og:url" content="${blog_url!}">
<meta property="og:title" content="${title!} ${blog_title!}">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="author" content="${user.nickname!}">
<meta http-equiv="x-dns-prefetch-control" content="on">
<meta name="site" content="${blog_url!}">
<meta property="twitter:partner" content="ogwp">
<link rel="canonical" href="${blog_url!}">
<link rel="apple-touch-icon" sizes="180x180" href="${options.blog_favicon!}">
2022-04-14 21:48:19 +08:00
<link rel="alternate" type="application/rss+xml" title="atom 1.0" href="${atom_url!}">
2022-04-12 23:07:27 +08:00
<link href="${theme_base!}/source/css/kico.css" rel="stylesheet" type="text/css"/>
<link href="${theme_base!}/source/css/single.css" rel="stylesheet" type="text/css"/>
<link href="${theme_base!}/source/css/font-awesome-animation.min.css" rel="stylesheet" type="text/css"/>
<link href="https://fastly.jsdelivr.net/gh/FortAwesome/Font-Awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<link rel="preload stylesheet" as="style" href="${theme_base!}/source/plugins/prism/prism.css">
<link rel="preload stylesheet" as="style" href="${theme_base!}/source/plugins/prism/themes/prism-${settings.Code_highlighting!}.css">
2022-04-14 21:48:19 +08:00
<@global.head />
2022-05-27 01:33:50 +08:00
<#if !(options.blog_favicon?? && options.blog_favicon!='')>
2022-04-14 21:48:19 +08:00
<link rel="shortcut icon" type="images/x-icon" href="${theme_base!}/source/images/icon.png" sizes="192x192"/>
</#if>
<#-- 背景图片-->
<#if settings.background?? && settings.background!=''>
<style>body:before{content: ''; background-image: url(${settings.background!})}</style>
</#if>
<#-- 自定css-->
<#if settings.custom_css?? && settings.custom_css!=''>
${custom_css!}
2022-04-14 21:48:19 +08:00
</#if>
2022-04-12 23:07:27 +08:00
</head>
<#-- 夜间模式 -->
<body
<#if (settings.night_mode?? && settings.night_mode == '2')>
class="dark-theme"
<#elseif (settings.night_mode?? && settings.night_mode == '1')>
<#assign currentDateTime = .now>
<#assign hour=currentDateTime?string("HH") >
<#if (hour?eval >=20|| hour?eval <=6) >
class="dark-theme"
</#if>
</#if>
>
2022-04-12 23:07:27 +08:00
<header>
<div class="head-title">
<h4>${blog_title!}</h4>
</div>
<div class="head-action">
<div class="toggle-btn"></div>
<div class="light-btn"></div>
<div class="search-btn"></div>
</div>
<form class="head-search" method="get" action="/search" role="search">
<input class="text" type="search" name="keyword" placeholder="搜索什么呢つ﹏⊂" required>
2022-04-14 21:48:19 +08:00
</form>
2022-04-12 23:07:27 +08:00
<nav class="head-menu">
<@menuTag method="tree">
<#list menus?sort_by('priority') as menu>
<#if menu.children?? && menu.children?size gt 0>
<div class="has-child">
</#if >
<a <#if menu.url?? && menu.url?trim?length gt 0> href="${menu.url!}" target="${menu.target!}" </#if>>
<span class="faa-parent animated-hover">
<#if menu.icon?? && menu.icon?trim?length gt 0>
<i class="${menu.icon}" aria-hidden="true"></i>
</#if>${menu.name}
</span>
</a>
<#if menu.children?? && menu.children?size gt 0>
<div class="sub-menu">
<#list menu.children?sort_by('priority') as child>
<a href="${child.url!}" target="${child.target!}">
<span class="faa-parent animated-hover">
<#if child.icon?? && child.icon?trim?length gt 1>
<i class="${child.icon}" aria-hidden="true"></i>
</#if>${child.name}
</span>
</a>
</#list>
</div >
</#if>
<#if menu.children?? && menu.children?size gt 0>
</div >
</#if >
</#list>
2022-04-12 23:07:27 +08:00
</@menuTag>
</nav>
</header>
</#macro>