新的国际化支持 | New Internationalization support (#159)

* new: i18n translation support

* new: Traditional Chinese, Japanese, and Korean translations

* upd: casing
This commit is contained in:
I'M YourOnly.One
2022-10-25 11:11:39 +08:00
committed by GitHub
parent df835bf24b
commit a314b017a7
22 changed files with 446 additions and 89 deletions
+77
View File
@@ -0,0 +1,77 @@
# Lang: English (generic)
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# BGN: Date and Time Format
[Datetime_format]
other = "2006-01-02"
# END: Date and Time Format
# BGN: Base
[home]
other = "Home"
[categories]
one = "Category"
other = "Categories"
[tags]
one = "Tag"
other = "Tags"
[continueReading]
other = "Continue reading"
[next]
other = "Next"
[previous]
other = "Previous"
[toc]
other = "Table of Contents"
# END: Base
# BGN: Theme
[ads]
other = "Ads"
[Articles]
other = "articles"
[Articles_latest]
other = "Latest articles"
[Articles_related]
other = "See Also"
[busuanzi]
other = "reads"
[Feed_rss]
other = "RSS"
[links]
other = "Links"
[meta]
other = "Meta"
[tagsNone]
other = "No tags"
[Search]
other = "Search: "
[Search_keyword]
other = "Keyword"
[Search_results]
other = "results"
# END: Theme
# BGN: Copyright
[Copyright_author]
other = "Author: "
[Copyright_link]
other = "Link: "
[Copyright_license]
other = "License: "
[Copyright_license_workUnder]
other = "This work is under a "
[Copyright_license_note]
other = "Kindly fulfill the requirements of the aforementioned License when adapting or creating a derivative of this work."
# END: Copyright
+77
View File
@@ -0,0 +1,77 @@
# Lang: Japanese
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# BGN: Date and Time Format
[Datetime_format]
other = "2006年1月2日"
# END: Date and Time Format
# BGN: Base
[home]
other = "自宅"
[categories]
one = "カテゴリ"
other = "カテゴリ"
[tags]
one = "タグ"
other = "タグ"
[continueReading]
other = "詳細はこちら"
[next]
other = "次へ"
[previous]
other = "前の"
[toc]
other = "目次"
# END: Base
# BGN: Theme
[ads]
other = "広告です"
[Articles]
other = "記事です"
[Articles_latest]
other = "最新の記事です"
[Articles_related]
other = "関連記事です"
[busuanzi]
other = "読みます。"
[Feed_rss]
other = "RSSフィード"
[links]
other = "リンク"
[meta]
other = "メタ"
[tagsNone]
other = "タグなし"
[Search]
other = "検索"
[Search_keyword]
other = "キーワード"
[Search_results]
other = "検索結果"
# END: Theme
# BGN: Copyright
[Copyright_author]
other = "作成者:"
[Copyright_link]
other = "リンク:"
[Copyright_license]
other = "ライセンス:"
[Copyright_license_workUnder]
other = "この作業は、次の条件の下にあります。"
[Copyright_license_note]
other = "本作業のデリバティブを適用または作成する場合は、上記のライセンスの要件を満たしてください。"
# END: Copyright
+77
View File
@@ -0,0 +1,77 @@
# Lang: Korean (South)
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# BGN: Date and Time Format
[Datetime_format]
other = "2006년 01월 02일"
# END: Date and Time Format
# BGN: Base
[home]
other = "집이에요"
[categories]
one = "분류"
other = "분류"
[tags]
one = "태그입니다."
other = "태그입니다."
[continueReading]
other = "더 읽기"
[next]
other = "다음 분."
[previous]
other = "이전의"
[toc]
other = "목차."
# END: Base
# BGN: Theme
[ads]
other = "광고"
[Articles]
other = "기사들"
[Articles_latest]
other = "최신 기사입니다."
[Articles_related]
other = "관련기사입니다"
[busuanzi]
other = "읽습니다."
[Feed_rss]
other = "RSS 피드"
[links]
other = "링크입니다."
[meta]
other = "메타"
[tagsNone]
other = "태그 없음"
[Search]
other = "서치"
[Search_keyword]
other = "핵심어"
[Search_results]
other = "결과."
# END: Theme
# BGN: Copyright
[Copyright_author]
other = "작가: "
[Copyright_link]
other = "링크: "
[Copyright_license]
other = " 허가하다: "
[Copyright_license_workUnder]
other = "이 작업은 아래에 있습니다."
[Copyright_license_note]
other = "이 작업의 파생 모델을 수정하거나 작성할 때 앞서 언급한 라이센스의 요구 사항을 충족하십시오."
# END: Copyright
+77
View File
@@ -0,0 +1,77 @@
# Lang: Simplified Chinese (China)
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# BGN: Date and Time Format
[Datetime_format]
other = "2006年1月2日"
# END: Date and Time Format
# BGN: Base
[home]
other = "首页"
[categories]
one = "分类"
other = "分类"
[tags]
one = "标签"
other = "标签"
[continueReading]
other = "阅读全文"
[next]
other = "下一页"
[previous]
other = "上一页"
[toc]
other = "文章目录"
# END: Base
# BGN: Theme
[ads]
other = "福利派送"
[Articles]
other = "中的文章"
[Articles_latest]
other = "最近文章"
[Articles_related]
other = "相关文章"
[busuanzi]
other = "阅读"
[Feed_rss]
other = "文章 RSS"
[links]
other = "友情链接"
[meta]
other = "其它"
[tagsNone]
other = "没有标签"
[Search]
other = "搜索"
[Search_keyword]
other = "哈哈"
[Search_results]
other = "的结果"
# END: Theme
# BGN: Copyright
[Copyright_author]
other = "原文作者:"
[Copyright_link]
other = "原文链接:"
[Copyright_license]
other = "版权声明:"
[Copyright_license_workUnder]
other = "本作品采用"
[Copyright_license_note]
other = "进行许可,非商业转载请注明出处(作者,原文链接),商业转载请联系作者获得授权。"
# END: Copyright
+77
View File
@@ -0,0 +1,77 @@
# Lang: Simplified Chinese (China)
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# BGN: Date and Time Format
[Datetime_format]
other = "2006年1月2日"
# END: Date and Time Format
# BGN: Base
[home]
other = "首頁"
[categories]
one = "分類"
other = "分類"
[tags]
one = "標籤"
other = "標籤"
[continueReading]
other = "閱讀全文"
[next]
other = "下一頁"
[previous]
other = "上一頁"
[toc]
other = "文章目錄"
# END: Base
# BGN: Theme
[ads]
other = "福利派送"
[Articles]
other = "中的文章"
[Articles_latest]
other = "最近文章"
[Articles_related]
other = "相關文章"
[busuanzi]
other = "閱讀"
[Feed_rss]
other = "文章 RSS"
[links]
other = "友情鏈接"
[meta]
other = "其它"
[tagsNone]
other = "沒有標籤"
[Search]
other = "搜索"
[Search_keyword]
other = "哈哈"
[Search_results]
other = "的結果"
# END: Theme
# BGN: Copyright
[Copyright_author]
other = "原文作者:"
[Copyright_link]
other = "原文鏈接:"
[Copyright_license]
other = "原文鏈接:"
[Copyright_license_workUnder]
other = "本作品採用"
[Copyright_license_note]
other = "進行許可,非商業轉載請註明出處(作者,原文鏈接),商業轉載請聯繫作者獲得授權。"
# END: Copyright
+2 -14
View File
@@ -9,23 +9,11 @@
<a href="{{ .Permalink }}" title="{{ .Title }}" target="_blank">{{ .Title }}</a> <a href="{{ .Permalink }}" title="{{ .Title }}" target="_blank">{{ .Title }}</a>
</h1> </h1>
</header> </header>
<date class="post-meta meta-date"> {{ partial "post-meta.html" . }}
{{ .Date.Year }}年{{ printf "%d" .Date.Month }}月{{ .Date.Day }}日
</date>
{{ with .Params.Categories }}
<div class="post-meta">
<span>|</span>
{{ range . }}
<span class="meta-category">
<a href='{{ "categories/" | relURL }}{{ . | urlize }}' target="_blank">{{ . }}</a>
</span>
{{ end }}
</div>
{{ end }}
<div class="post-content"> <div class="post-content">
{{ .Summary }}…… {{ .Summary }}……
</div> </div>
<p class="readmore"><a href="{{ .Permalink }}" target="_blank">阅读全文</a></p> <p class="readmore"><a href="{{ .Permalink }}" target="_blank">{{ i18n "continueReading" }}</a></p>
</article> </article>
{{ end }} {{ end }}
{{ end }} {{ end }}
+6 -17
View File
@@ -5,29 +5,18 @@
<header> <header>
<h1 class="post-title">{{ .Title }}</h1> <h1 class="post-title">{{ .Title }}</h1>
</header> </header>
<date class="post-meta meta-date"> {{ partial "post-meta.html" . }}
{{ .Date.Year }}年{{ printf "%d" .Date.Month }}月{{ .Date.Day }}日
</date>
{{ with .Params.Categories }}
<div class="post-meta">
<span>|</span>
{{ range . }}
<span class="meta-category">
<a href='{{ "categories/" | relURL }}{{ . | urlize }}' target="_blank">{{ . }}</a>
</span>
{{ end }}
</div>
{{ end }}
{{ if .Site.Params.busuanzi }} {{ if .Site.Params.busuanzi }}
<div class="post-meta"> <div class="post-meta">
<span id="busuanzi_container_page_pv">|<span id="busuanzi_value_page_pv"></span><span> <span id="busuanzi_container_page_pv">&nbsp;|
阅读</span></span> <span id="busuanzi_value_page_pv"></span> <span>{{ i18n "busuanzi" }}</span>
</span>
</div> </div>
{{ end }} {{ end }}
{{ if .Params.toc }} {{ if .Params.toc }}
<div class="clear" style="display: none"> <div class="clear" style="display: none">
<div class="toc-article"> <div class="toc-article">
<div class="toc-title">文章目录</div> <div class="toc-title">{{ i18n "toc" }}</div>
</div> </div>
</div> </div>
{{ end }} {{ end }}
@@ -47,7 +36,7 @@
{{ end }} {{ end }}
</ul> </ul>
{{ else }} {{ else }}
没有标签 {{ i18n "tagsNone" }}
{{ end }} {{ end }}
</div> </div>
</article> </article>
+10 -16
View File
@@ -2,15 +2,19 @@
<div class="res-cons"> <div class="res-cons">
{{ if eq .Data.Singular "category" }} {{ if eq .Data.Singular "category" }}
<h3 class="archive-title"> <h3 class="archive-title">
分类 {{ range .Site.Taxonomies.categories.ByCount }}
<span>{{ .Count }}</span>
{{ end }}
<span class="keyword">{{ .Data.Term }}</span> <span class="keyword">{{ .Data.Term }}</span>
中的文章 {{ i18n "Articles" }}
</h3> </h3>
{{ else if eq .Data.Singular "tag" }} {{ else if eq .Data.Singular "tag" }}
<h3 class="archive-title"> <h3 class="archive-title">
包含标签 {{ range .Site.Taxonomies.tags.ByCount }}
<span>{{ .Count }}</span>
{{ end }}
<span class="keyword">{{ .Data.Term }}</span> <span class="keyword">{{ .Data.Term }}</span>
的文章 {{ i18n "Articles" }}
</h3> </h3>
{{ end }} {{ end }}
@@ -21,20 +25,10 @@
<a href="{{ .Permalink }}" target="_blank">{{ .Title }}</a> <a href="{{ .Permalink }}" target="_blank">{{ .Title }}</a>
</h1> </h1>
</header> </header>
<date class="post-meta meta-date"> {{ partial "post-meta.html" . }}
{{ .Date.Year }}年{{ printf "%d" .Date.Month }}月{{ .Date.Day }}日
</date>
{{ with .Params.Categories }}
<div class="post-meta meta-category">
|
{{ range . }}
<a href='{{ "categories/" | relURL }}{{ . | urlize }}' target="_blank">{{ . }}</a>
{{ end }}
</div>
{{ end }}
<div class="post-content"> <div class="post-content">
{{ .Summary }}…… {{ .Summary }}……
<p class="readmore"><a href="{{ .Permalink }}" target="_blank">阅读全文</a></p> <p class="readmore"><a href="{{ .Permalink }}" target="_blank">{{ i18n "continueReading" }}</a></p>
</div> </div>
</article> </article>
{{ end }} {{ end }}
+2 -14
View File
@@ -9,23 +9,11 @@
<a href="{{ .Permalink }}" title="{{ .Title }}" target="_blank">{{ .Title }}</a> <a href="{{ .Permalink }}" title="{{ .Title }}" target="_blank">{{ .Title }}</a>
</h1> </h1>
</header> </header>
<date class="post-meta meta-date"> {{ partial "post-meta.html" . }}
{{ .Date.Year }}年{{ printf "%d" .Date.Month }}月{{ .Date.Day }}日
</date>
{{ with .Params.Categories }}
<div class="post-meta">
<span>|</span>
{{ range . }}
<span class="meta-category">
<a href='{{ "categories/" | relURL }}{{ . | urlize }}' target="_blank">{{ . }}</a>
</span>
{{ end }}
</div>
{{ end }}
<div class="post-content"> <div class="post-content">
{{ .Summary }}…… {{ .Summary }}……
</div> </div>
<p class="readmore"><a href="{{ .Permalink }}" target="_blank">阅读全文</a></p> <p class="readmore"><a href="{{ .Permalink }}" target="_blank">{{ i18n "continueReading" }}</a></p>
</article> </article>
{{ end }} {{ end }}
{{ end }} {{ end }}
+1 -1
View File
@@ -1,6 +1,6 @@
{{ with .Site.Params.ads }} {{ with .Site.Params.ads }}
<section class="widget"> <section class="widget">
<h3 class="widget-title" style="color:red">福利派送</h3> <h3 class="widget-title" style="color:red">{{ i18n "ads" }}</h3>
<ul class="widget-list"> <ul class="widget-list">
{{ range . }} {{ range . }}
<li> <li>
+1 -1
View File
@@ -1,4 +1,4 @@
<h3 class="widget-title"><a href='{{ "categories/" | relURL }}'>分类</a></h3> <h3 class="widget-title"><a href='{{ "categories/" | relURL }}'>{{ i18n "categories" }}</a></h3>
<ul class="widget-list"> <ul class="widget-list">
{{ range .Site.Taxonomies.categories }} {{ range .Site.Taxonomies.categories }}
<li><a href="{{ .Page.Permalink }}">{{ .Page.Title }} ({{ .Count }})</a></li> <li><a href="{{ .Page.Permalink }}">{{ .Page.Title }} ({{ .Count }})</a></li>
+3 -3
View File
@@ -1,9 +1,9 @@
{{ if and (isset .Site.Params "cc") (in (slice "post" "posts") .Type) }} {{ if and (isset .Site.Params "cc") (in (slice "post" "posts") .Type) }}
<div class="post-archive"> <div class="post-archive">
<ul class="post-copyright"> <ul class="post-copyright">
<li><strong>原文作者:</strong><a rel="author" href="{{ .Site.BaseURL}}">{{ if isset .Site.Author "name" }}{{.Site.Author.name}}{{ else }}{{.Site.Title}}{{ end }}</a></li> <li><strong>{{ i18n "Copyright_author" }}</strong><a rel="author" href="{{ .Site.BaseURL}}">{{ if isset .Site.Author "name" }}{{.Site.Author.name}}{{ else }}{{.Site.Title}}{{ end }}</a></li>
<li style="word-break:break-all"><strong>原文链接:</strong><a href="{{ .Permalink}}">{{ .Permalink}}</a></li> <li style="word-break:break-all"><strong>{{ i18n "Copyright_link" }}</strong><a href="{{ .Permalink}}">{{ .Permalink}}</a></li>
<li><strong>版权声明:</strong>本作品采用<a rel="license" href="{{.Site.Params.cc.link}}">{{.Site.Params.cc.name}}</a>进行许可,非商业转载请注明出处(作者,原文链接),商业转载请联系作者获得授权。</li> <li><strong>{{ i18n "Copyright_license" }}</strong>{{ i18n "Copyright_license_workUnder" }}<a rel="license" href="{{.Site.Params.cc.link}}">{{.Site.Params.cc.name}}</a>. {{ i18n "Copyright_license_note" }}</li>
</ul> </ul>
</div> </div>
<br/> <br/>
+1 -1
View File
@@ -17,7 +17,7 @@
</div> </div>
<div> <div>
<nav id="nav-menu" class="clearfix"> <nav id="nav-menu" class="clearfix">
<a class="{{ if or (.IsHome) (eq .Type "post") (eq .Type "posts") }}current{{ end }}" href="{{ .Site.BaseURL | absURL }}">首页</a> <a class="{{ if or (.IsHome) (eq .Type "post") (eq .Type "posts") }}current{{ end }}" href="{{ .Site.BaseURL | absURL }}">{{ i18n "home" }}</a>
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
<a {{ if eq .URL $.RelPermalink }}class="current"{{ end }} href="{{ .URL | absURL }}" title="{{ .Name }}">{{ .Name }}</a> <a {{ if eq .URL $.RelPermalink }}class="current"{{ end }} href="{{ .URL | absURL }}" title="{{ .Name }}">{{ .Name }}</a>
{{ end }} {{ end }}
+1 -1
View File
@@ -1,6 +1,6 @@
{{ with .Site.Params.links }} {{ with .Site.Params.links }}
<section class="widget"> <section class="widget">
<h3 class="widget-title">友情链接</h3> <h3 class="widget-title">{{ i18n "links" }}</h3>
<ul class="widget-list"> <ul class="widget-list">
{{ range . }} {{ range . }}
<li> <li>
+5 -5
View File
@@ -5,7 +5,7 @@
<ol class="page-navigator"> <ol class="page-navigator">
{{ if .HasPrev }} {{ if .HasPrev }}
<li class="prev"> <li class="prev">
<a href="{{ .Prev.URL | absLangURL }}">上一页</a> <a href="{{ .Prev.URL | absLangURL }}">{{ i18n "previous" }}</a>
</li> </li>
{{ end }} {{ end }}
@@ -46,10 +46,10 @@
{{ end }} {{ end }}
{{ if .HasNext }} {{ if .HasNext }}
<li class="next"> <li class="next">
<a href="{{ .Next.URL | absLangURL }}">下一页</a> <a href="{{ .Next.URL | absLangURL }}">{{ i18n "next" }}</a>
</li> </li>
{{ end }} {{ end }}
</ol> </ol>
@@ -58,7 +58,7 @@
<ol class="page-navigator"> <ol class="page-navigator">
{{ if .HasPrev }} {{ if .HasPrev }}
<li class="prev"> <li class="prev">
<a href="{{ .Prev.URL | absLangURL }}">上一页</a> <a href="{{ .Prev.URL | absLangURL }}">{{ i18n "previous" }}</a>
</li> </li>
{{ end }} {{ end }}
@@ -70,7 +70,7 @@
{{ if .HasNext }} {{ if .HasNext }}
<li class="next"> <li class="next">
<a href="{{ .Next.URL | absLangURL }}">下一页</a> <a href="{{ .Next.URL | absLangURL }}">{{ i18n "next" }}</a>
</li> </li>
{{ end }} {{ end }}
</ol> </ol>
+14
View File
@@ -0,0 +1,14 @@
{{- $datetime_format := i18n "Datetime_format" -}}
{{ if not .PublishDate.IsZero }}
<time datetime="{{ .PublishDate.UTC.Format "2006-01-02T15:04:05Z07:00" }}" class="post-meta meta-date dt-published">
{{ time.Format $datetime_format .PublishDate }}
</time>
{{ end }}
{{ with .Params.Categories }}
<div class="post-meta meta-category">
<span>&nbsp;|</span>
{{ range . }}
<a href='{{ "categories/" | relURL }}{{ . | urlize }}' target="_blank">{{ . }}</a>
{{ end }}
</div>
{{ end }}
+1 -1
View File
@@ -1,4 +1,4 @@
<h3 class="widget-title">最近文章</h3> <h3 class="widget-title">{{ i18n "Articles_latest" }}</h3>
<ul class="widget-list"> <ul class="widget-list">
{{ range first 10 (where (where .Site.Pages "Type" "in" (slice "post" "posts")) "Kind" "page") }} {{ range first 10 (where (where .Site.Pages "Type" "in" (slice "post" "posts")) "Kind" "page") }}
<li> <li>
+1 -1
View File
@@ -1,7 +1,7 @@
{{ $related := .Site.RegularPages.Related . | first 5 }} {{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }} {{ with $related }}
<div class="post-archive"> <div class="post-archive">
<h2>See Also</h2> <h2>{{ i18n "Articles_related" }}</h2>
<ul class="listing"> <ul class="listing">
{{ range . }} {{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
+3 -3
View File
@@ -2,7 +2,7 @@
<section class="widget"> <section class="widget">
{{ partial "search_form" . }} {{ partial "search_form" . }}
</section> </section>
<section class="widget"> <section class="widget">
{{ partial "recent_post" . }} {{ partial "recent_post" . }}
</section> </section>
@@ -20,9 +20,9 @@
{{ partial "links" . }} {{ partial "links" . }}
<section class="widget"> <section class="widget">
<h3 class="widget-title">其它</h3> <h3 class="widget-title">{{ i18n "meta" }}</h3>
<ul class="widget-list"> <ul class="widget-list">
<li><a href="{{ "index.xml" | absURL }}">文章 RSS</a></li> <li><a href="{{ "index.xml" | absURL }}">{{ i18n "Feed_rss" }}</a></li>
</ul> </ul>
</section> </section>
</div> </div>
+1 -1
View File
@@ -1,4 +1,4 @@
<h3 class="widget-title"><a href='{{ "tags/" | relURL }}'>标签</a></h3> <h3 class="widget-title"><a href='{{ "tags/" | relURL }}'>{{ i18n "tags" }}</a></h3>
<div class="tagcloud"> <div class="tagcloud">
{{ range .Site.Taxonomies.tags }} {{ range .Site.Taxonomies.tags }}
<a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> <a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a>
+1 -1
View File
@@ -61,7 +61,7 @@
} }
</style> </style>
<div class="post-toc" style="position: absolute; top: 188px;"> <div class="post-toc" style="position: absolute; top: 188px;">
<h2 class="post-toc-title">文章目录</h2> <h2 class="post-toc-title">{{ i18n "toc" }}</h2>
<div class="post-toc-content"> <div class="post-toc-content">
{{.TableOfContents}} {{.TableOfContents}}
</div> </div>
+8 -9
View File
@@ -1,9 +1,10 @@
{{ define "content"}} {{ define "content"}}
{{- $datetime_format := i18n "Datetime_format" -}}
<div class="res-cons"> <div class="res-cons">
<h3 class="archive-title"> <h3 class="archive-title">
搜索 {{ i18n "Search" }}
<span class="keyword">哈哈</span> <span class="keyword">{{ i18n "Search_keyword" }}</span>
的结果 {{ i18n "Search_results" }}
</h3> </h3>
<article class="post"> <article class="post">
@@ -12,12 +13,10 @@
<a href="链接" target="_blank">标题</a> <a href="链接" target="_blank">标题</a>
</h1> </h1>
</header> </header>
<date class="post-meta meta-date"> {{ if not .PublishDate.IsZero }}<time datetime="{{ .PublishDate.UTC.Format "2006-01-02T15:04:05Z07:00" }}" class="post-meta meta-date dt-published">{{ time.Format $datetime_format .PublishDate }}</time>{{ end }}
2019年12月01日
</date>
<div class="post-content"> <div class="post-content">
概要…… 概要……
<p class="readmore"><a href="链接" target="_blank">阅读全文</a></p> <p class="readmore"><a href="链接" target="_blank">{{ i18n "continueReading" }}</a></p>
</div> </div>
</article> </article>
@@ -55,8 +54,8 @@
var url = item.find("link").text(); var url = item.find("link").text();
var searchItem = `<article class="post"><header><h1 class="post-title"><a href="` + url + `" target="_blank">` + title + `</a></h1></header>`; var searchItem = `<article class="post"><header><h1 class="post-title"><a href="` + url + `" target="_blank">` + title + `</a></h1></header>`;
var pubDate = new Date(item.find("pubDate").text()) var pubDate = new Date(item.find("pubDate").text())
searchItem += `<date class="post-meta meta-date">` + pubDate.getFullYear() + `` + (pubDate.getMonth() + 1) + `` + pubDate.getDate() + `</date>`; searchItem += `<time class="post-meta meta-date">` + pubDate.getFullYear() + `-` + (pubDate.getMonth() + 1) + `-` + pubDate.getDate() + `</time>`;
searchItem += `<div class="post-content">` + item.find("description").text() + `……<p class="readmore"><a href="` + url + `" target="_blank">阅读全文</a></p></div></article>`; searchItem += `<div class="post-content">` + item.find("description").text() + `……<p class="readmore"><a href="` + url + `" target="_blank">{{ i18n "continueReading" }}</a></p></div></article>`;
$("div.res-cons").append(searchItem); $("div.res-cons").append(searchItem);
} }