blog/themes/farallon/layouts/partials/head.html

39 lines
1.9 KiB
HTML

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,minimum-scale=1">
<meta name="description"
content="{{ if .IsHome }}{{ $.Site.Params.description }}{{ else if .IsPage }}{{ .Params.description}}{{ else }}{{ .Description }}{{ end }}" />
{{ $styles := resources.Get "scss/app.scss" | toCSS | minify | fingerprint }}
{{ if .IsPage }}
<meta property="og:title" content="{{ .Page.Title }}">
<meta property="og:url" content="{{ .Page.Permalink }}">
<meta property="og:image" content="{{ .Params.cover}}">
<meta property="og:description" content="{{ .Params.description}}">
<meta property="og:type" content="article">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image:src" content="{{ .Params.cover}}">
<meta name="twitter:title" content="{{ .Page.Title }}">
<meta name="twitter:description" content="{{ .Params.description}}">
{{ end }}
<link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}" media="screen">
<script src="//cdn.jkjoy.cn/highlight/prism.js"></script>
<link rel="stylesheet" href="//cdn.jkjoy.cn/highlight/prism.css" />
<script>
document.addEventListener('DOMContentLoaded', function () {
var defaultLanguage = 'javascript'; // 设置默认语言
document.querySelectorAll('pre code').forEach(function (block) {
if (!block.classList.length) {
block.classList.add('language-' + defaultLanguage);
}
});
Prism.highlightAll();
});
</script>
{{ $favicon := resources.Get "images/favicon.png" }}
<link type="image/vnd.microsoft.icon" href="{{ $.Site.Params.icon }}" rel="shortcut icon">
{{ if .OutputFormats.Get "RSS" }}
{{ with .OutputFormats.Get "RSS" }}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
<link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="{{ $.Site.Title }}" />
{{ end }}
{{ end }}