feat: impove i18n and clean code
This commit is contained in:
@@ -2,13 +2,14 @@
|
||||
<div class="copyright">
|
||||
©
|
||||
{{ with .Site.Params.since }}
|
||||
<span itemprop="copyrightYear">{{.}} - {{ now.Year }}</span>
|
||||
<span itemprop="copyrightYear">{{ if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year }}</span>
|
||||
{{ end }}
|
||||
{{ if .Site.Params.author }}
|
||||
<span class="author" itemprop="copyrightHolder"><a href="{{ .Site.BaseURL }}">{{ .Site.Params.author }}</a> |
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ if .Site.Params.author }}
|
||||
<span class="author" itemprop="copyrightHolder"><a href="{{ .Site.BaseURL }}">{{ .Site.Params.author }}</a> | </span>
|
||||
{{ end }}
|
||||
|
||||
<span>Crafted with ❤️ by <a href="https://github.com/Fastbyte01/KeepIt" target="_blank" rel="external nofollow noopener noreffer">KeepIt</a> & <a href="https://gohugo.io/" target="_blank" rel="external nofollow noopener noreffer">Hugo</a></span>
|
||||
<span>{{ (printf (T "powered") `<a href="https://gohugo.io/" target="_blank" rel="external nofollow noopener noreffer">Hugo</a>`) | safeHTML }} | {{ T "theme" }}<a href="https://github.com/dillonzq/KeepIt" target="_blank" rel="external nofollow noopener noreffer">KeepIt</a></span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
@@ -1,48 +1,39 @@
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html;charset=utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="robots" content="noodp"/>
|
||||
{{ with .Site.Params.google_verification }}<meta name="google-site-verification" content="{{ . }}" />{{ end }}
|
||||
{{ with .Site.Params.bing_verification }}<meta name="msvalidate.01" content="{{ . }}" />{{end}}
|
||||
{{ with .Site.Params.yandex_verification }}<meta name="yandex-verification" content="{{ . }}" />{{ end }}
|
||||
{{ with .Site.Params.pinterest_verification }}<meta name="p:domain_verify" content="{{ . }}"/>{{ end }}
|
||||
{{ with .Site.Params.baidu_verification }}<meta name=”baidu-site-verification” content="{{ . }}" />{{ end }}
|
||||
{{ if .PrevInSection }}<link rel="prev" href="{{.PrevInSection.Permalink}}" />{{end}}
|
||||
{{ if .NextInSection}}<link rel="next" href="{{ .NextInSection.Permalink }}" />{{end}}
|
||||
<link rel="canonical" href="{{ .Permalink }}" />
|
||||
<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
||||
<link rel="manifest" href="/site.webmanifest">
|
||||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
<title>
|
||||
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
|
||||
{{ if .IsHome }}
|
||||
{{ .Site.Title }}
|
||||
{{ else if .Params.heading }}
|
||||
{{ .Params.heading }}
|
||||
{{ else }}
|
||||
{{ .Title }} | {{ .Site.Title }}
|
||||
{{ end }}
|
||||
</title>
|
||||
<meta name="title" content="{{ if .IsHome }}{{ .Site.Title }}{{ else if .Params.heading }}{{ .Params.heading }}{{ else }}{{ .Title }} | {{ .Site.Title }}{{ end}}">
|
||||
{{ partial "css" . }}
|
||||
{{ with .OutputFormats.Get "RSS" }}
|
||||
<link rel="alternate" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ site.Title }}">
|
||||
<link rel="feed" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ site.Title }}">
|
||||
{{ end }}
|
||||
{{- template "_internal/twitter_cards.html" . }}
|
||||
{{ partial "seo_schema" . }}
|
||||
</head>
|
||||
{{ $cdn_url := ""}}
|
||||
{{ if eq ( getenv "HUGO_ENV" ) "production" }}
|
||||
{{ with .Site.Params.cdn_url }}
|
||||
{{ $cdn_url = .}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ .Scratch.Set "cdn_url" $cdn_url }}
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="robots" content="noodp" />
|
||||
{{ with .Site.Params.google_verification }}
|
||||
<meta name="google-site-verification" content="{{ . }}" />
|
||||
{{ end }}
|
||||
{{ with .Site.Params.bing_verification }}
|
||||
<meta name="msvalidate.01" content="{{ . }}" />
|
||||
{{end}}
|
||||
{{ with .Site.Params.yandex_verification }}
|
||||
<meta name="yandex-verification" content="{{ . }}" />
|
||||
{{ end }}
|
||||
{{ with .Site.Params.pinterest_verification }}
|
||||
<meta name="p:domain_verify" content="{{ . }}" />
|
||||
{{ end }}
|
||||
{{ with .Site.Params.baidu_verification }}
|
||||
<meta name=”baidu-site-verification” content="{{ . }}" />
|
||||
{{ end }}
|
||||
{{ if .PrevInSection }}
|
||||
<link rel="prev" href="{{.PrevInSection.Permalink}}" />
|
||||
{{ end }}
|
||||
{{ if .NextInSection}}
|
||||
<link rel="next" href="{{ .NextInSection.Permalink }}" />
|
||||
{{end}}
|
||||
<link rel="canonical" href="{{ .Permalink }}" />
|
||||
<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
||||
<link rel="manifest" href="/site.webmanifest">
|
||||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
{{ partial "css" . }}
|
||||
{{ with .OutputFormats.Get "RSS" }}
|
||||
<link rel="alternate" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ site.Title }}">
|
||||
<link rel="feed" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ site.Title }}">
|
||||
{{ end }}
|
||||
{{ template "_internal/twitter_cards.html" . }}
|
||||
{{ partial "seo_schema" . }}
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
<nav class="navbar">
|
||||
<div class="container">
|
||||
<div class="navbar-header header-logo">
|
||||
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
||||
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
||||
</div>
|
||||
|
||||
<div class="menu navbar-right">
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
<a class="menu-item{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}" href="{{ .URL }}" title="{{ .Title }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
<a href="javascript:void(0);" class="theme-switch"><i class="iconfont icon-sun"></i></a>
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
<a class="menu-item{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{ end }}" href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
<a href="javascript:void(0);" class="theme-switch"><i class="iconfont icon-sun"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<nav class="navbar-mobile" id="nav-mobile" style="display: none">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
@@ -20,12 +22,12 @@
|
||||
<span></span><span></span><span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="menu" id="mobile-menu">
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
<a class="menu-item{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}" href="{{ .URL }}" title="{{ .Title }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
|
||||
<div class="menu" id="mobile-menu">
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
<a class="menu-item{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{ end }}" href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@@ -18,6 +18,5 @@
|
||||
{{ end }}
|
||||
<div class="social-links">
|
||||
{{ partial "social.html" . }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
{{ if .IsPage }}
|
||||
|
||||
{{ if $postHasImages }}
|
||||
<link href="//lib.baomitu.com/lightgallery/1.6.12/css/lightgallery.min.css" rel="stylesheet">
|
||||
{{ $vendorscript := slice $jquery $lazysizes $prettify $dynamic $main $lihtGallery $lihtGallery_init | resources.Concat "/js/vendor_gallery.js" | resources.Minify }}
|
||||
<link crossorigin="anonymous" integrity="sha384-yziQACfvCVwLqVFLqkWBYRO3XeA4EqzfXKGwaWnenYn5XzqfJFlFdKEmvutIQdKb" href="https://lib.baomitu.com/lightgallery/1.6.12/css/lightgallery.min.css" rel="stylesheet">
|
||||
{{ $vendorscript := slice $jquery $lazysizes $prettify $dynamic $main $lihtGallery $lihtGallery_init | resources.Concat "/js/vendor_gallery.js" | resources.Minify }}
|
||||
<script src="{{ printf "%s%s" $cdn_url $vendorscript.RelPermalink }}" async="" ></script>
|
||||
{{ else }}
|
||||
{{ $vendorscript := slice $jquery $prettify $dynamic $main | resources.Concat "/js/vendor_no_gallery.js" | resources.Minify }}
|
||||
<script src="{{ printf "%s%s" $cdn_url $vendorscript.RelPermalink }}" async=""></script>
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ else }}
|
||||
{{ $main := slice $jquery $main | resources.Concat "/js/vendor_main.js" | resources.Minify}}
|
||||
<script src="{{ printf "%s%s" $cdn_url $main.RelPermalink }}" async=""></script>
|
||||
|
||||
@@ -1,29 +1,31 @@
|
||||
{{ $pag := $.Paginator }}
|
||||
{{ if gt $pag.TotalPages 1 }}
|
||||
<ul class="pagination">
|
||||
{{ with $pag.First }}
|
||||
{{ end }}
|
||||
|
||||
{{ $.Scratch.Set "__paginator.ellipsed" false }}
|
||||
{{ range $pag.Pagers }}
|
||||
{{ $right := sub .TotalPages .PageNumber }}
|
||||
{{ $showNumber := or (le .PageNumber 1) (eq $right 0) }}
|
||||
{{ $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 3)) (lt .PageNumber (add $pag.PageNumber 3))) }}
|
||||
{{ if $showNumber }}
|
||||
{{ if gt $pag.TotalPages 1 }}
|
||||
<ul class="pagination">
|
||||
{{ with $pag.First }}
|
||||
{{ end }}
|
||||
|
||||
{{ $.Scratch.Set "__paginator.ellipsed" false }}
|
||||
{{ $.Scratch.Set "__paginator.shouldEllipse" false }}
|
||||
{{ else }}
|
||||
{{ $.Scratch.Set "__paginator.shouldEllipse" (not ($.Scratch.Get "__paginator.ellipsed") ) }}
|
||||
{{ $.Scratch.Set "__paginator.ellipsed" true }}
|
||||
{{ end }}
|
||||
{{ if $showNumber }}
|
||||
<li class="page-item {{ if eq . $pag }}active{{ end }}">
|
||||
<span class="page-link">
|
||||
<a href="{{ .URL }}">{{ .PageNumber }}</a></li>
|
||||
</span>
|
||||
{{ else if ($.Scratch.Get "__paginator.shouldEllipse") }}
|
||||
<li class="page-item "><span class="page-link" aria-hidden="true">…</span></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ range $pag.Pagers }}
|
||||
{{ $right := sub .TotalPages .PageNumber }}
|
||||
{{ $showNumber := or (le .PageNumber 1) (eq $right 0) }}
|
||||
{{ $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 3)) (lt .PageNumber (add $pag.PageNumber 3))) }}
|
||||
{{ if $showNumber }}
|
||||
{{ $.Scratch.Set "__paginator.ellipsed" false }}
|
||||
{{ $.Scratch.Set "__paginator.shouldEllipse" false }}
|
||||
{{ else }}
|
||||
{{ $.Scratch.Set "__paginator.shouldEllipse" (not ($.Scratch.Get "__paginator.ellipsed") ) }}
|
||||
{{ $.Scratch.Set "__paginator.ellipsed" true }}
|
||||
{{ end }}
|
||||
{{ if $showNumber }}
|
||||
<li class="page-item {{ if eq . $pag }}active{{ end }}">
|
||||
<span class="page-link">
|
||||
<a href="{{ .URL }}">{{ .PageNumber }}</a>
|
||||
</span>
|
||||
</li>
|
||||
{{ else if ($.Scratch.Get "__paginator.shouldEllipse") }}
|
||||
<li class="page-item "><span class="page-link" aria-hidden="true">…</span></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user