Merge branch 'develop'

This commit is contained in:
凡梦星尘
2022-06-16 21:02:32 +08:00
19 changed files with 192 additions and 47 deletions

View File

@@ -4,7 +4,16 @@
{{- define "main_inner_class" }}{{.Data.Plural}} posts-expand{{ end -}}
{{- define "main" }}
<div class="post-block" lang="{{ .Site.LanguageCode }}">
<dive class="post-body">
<div class="post-header">
<h1>
{{- if eq .Data.Plural "categories" }}
{{- T "CateTitle" }}
{{- else if eq .Data.Plural "tags" }}
{{- T "TagTitle" }}
{{- end }}
</h1>
</div>
<div class="post-body">
{{- if eq .Data.Plural "categories" }}
{{ $cats := .Site.Taxonomies.categories }}
<div class="category-all-page">
@@ -33,7 +42,9 @@
{{ $randNums := (seq 10) }}
{{- range $name, $items := $tags }}
<a class="tag-cloud-{{ index (shuffle $randNums) 0 }}" href="{{ "/tags/" | relLangURL }}{{ $name | urlize | lower }}">{{ $name }}
<span class="tag-list-count"><sup>({{ len $items }})</sup></span>
<span class="tag-list-count">
<sup>({{ len $items }})</sup>
</span>
</a>
{{- end }}
</div>

View File

@@ -0,0 +1,6 @@
<script type="text/javascript" src="//sidecar.gitter.im/dist/sidecar.v1.js" async></script>
<script type="text/javascript">
((window.gitter = {}).chat = {}).options = {
room: {{ .Site.Params.gitter.room }}
};
</script>

View File

@@ -22,4 +22,12 @@
{{- $scss = $scss | resources.ExecuteAsTemplate "main.scss" . }}
{{- $css := $scss | toCSS (dict "targetPath" "/css/main.css" "outputStyle" "expanded") }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
<link rel="stylesheet" href="/css/hover.css">
<link rel="stylesheet" href="/css/hover.css">
{{- if .IsPage }}
<style type="text/css">
.post-footer hr:after {
content: "{{ .Site.Params.postFooter.endLineTip }}";
}
</style>
{{- end }}

View File

@@ -13,7 +13,7 @@
<img class="custom-logo-image" src="{{ .Site.Params.customLogo }}" alt="{{ $title }}">
{{- end }}
<a href="{{ .Site.BaseURL }}" class="brand" rel="start">
<a href="{{ "/" | relLangURL }}" class="brand" rel="start">
<i class="logo-line"></i>
<h1 class="site-title">{{ $title }}</h1>
<i class="logo-line"></i>

View File

@@ -6,7 +6,7 @@
{{- $active := or ($curP.IsMenuCurrent "main" .) ($curP.HasMenuCurrent "main" .) }}
{{- $active = or $active (eq .URL "/")}}
<li class="menu-item menu-item-{{ .Identifier }}">
<a href="{{ .URL }}" class="hvr-icon-pulse {{if $active }} menu-item-active{{ end }}" rel="section">
<a href="{{ .URL | relLangURL }}" class="hvr-icon-pulse {{if $active }} menu-item-active{{ end }}" rel="section">
{{- if $ms.icons }}<i class="fa fa-{{ .Pre }} hvr-icon"></i>{{ end }}{{- .Name }}
{{- if and $ms.badges (eq .Identifier "archives" ) }}
<span class="badge">{{ $.Scratch.Get "postsCount" }}</span>

View File

@@ -2,7 +2,7 @@
{{- if $.IsHome }}
{{- if and .Site.Params.readMoreBtn (not .Params.Expand) }}
<div class="post-button">
<a class="btn" href="{{ .Permalink }}#more" rel="contents">
<a class="btn" href="{{ .RelPermalink | relLangURL }}#more" rel="contents">
{{ T "PostReadMore" }} &raquo;
</a>
</div>

View File

@@ -19,16 +19,15 @@
{{- if isset .Params "link" }}
<strong>{{ print (T "PostCROriginLink") (T "SymbolColon") }} </strong>
<a target="_blank" href="{{ .Params.OriginLink }}" title="{{ .Title }}">{{ .Params.Link }}</a>
{{- else }}
{{- else }}
<strong>{{ print (T "PostCRLink") (T "SymbolColon") }}</strong>
<a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Permalink }}</a>
<a href="{{ .Permalink | absLangURL }}" title="{{ .Title }}">{{ .Permalink | absLangURL }}</a>
{{- end }}
</li>
<li class="post-copyright-license">
<strong>{{ print (T "PostCRLicenseTitle") (T "SymbolColon") }} </strong>
{{- $ccText := .Site.Params.creativeCommons.license | upper }}
{{- $lang := .Scratch.Get "lang" }}
{{- $ccLink := printf "<a target='_blank' href='https://creativecommons.org/licenses/by-nc-sa/4.0/deed.%s'>%s</a>" (substr $lang 0 2) $ccText }}
{{- $ccLink := printf "<a target='_blank' href='https://creativecommons.org/licenses/by-nc-sa/4.0/deed.%s'>%s</a>" (substr .Site.LanguageCode 0 2) $ccText }}
{{ printf (T "PostCRLicenseContent") $ccLink | safeHTML }}
</li>
</ul>

View File

@@ -12,7 +12,7 @@
<i class="fa fa-external-link-alt"></i>
</a>
{{- else }}
<a href="{{ .Permalink }}" itemprop="url" class="post-title-link">{{ .Title }}</a>
<a href="{{ .RelPermalink | relLangURL }}" itemprop="url" class="post-title-link">{{ .Title }}</a>
{{- end }}
{{- else }}
{{- .Title }}

View File

@@ -4,10 +4,10 @@
<span class="post-meta-item-icon">
<i class="far fa-folder-open"></i>
</span>
<span class="post-meta-item-text">{{- print (T "PostCatgs") (T "SymbolColon") -}}</span>
<span class="post-meta-item-text">{{- print (T "PostCategory") (T "SymbolColon") -}}</span>
{{- range (first 1 .Params.categories) }}
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/{{ . | urlize }}" itemprop="url" rel="index">
<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}" itemprop="url" rel="index">
<span itemprop="name">{{- . -}}</span>
</a>
</span>

View File

@@ -21,6 +21,10 @@
{{- end }}
{{- end }}
{{- if .Site.Params.gitter.enable }}
{{ partial "_thirdparty/chat/gitter.html" . }}
{{- end }}
<noscript>
<div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>