feat: add en/zh README and exampleSite files

This commit is contained in:
Dillon
2019-08-26 02:25:56 +08:00
parent ca6d543878
commit af3161fff6
48 changed files with 912 additions and 2518 deletions

View File

@@ -1,10 +1,10 @@
{{ define "title" }}{{ T "all" }}{{ T .Section | default (humanize .Section) }} | {{ .Site.Title }}{{ end -}}
{{ define "title" }}{{ T "all" | humanize}}{{ T .Section | default .Section | humanize }} | {{ .Site.Title }}{{ end -}}
{{ define "content" -}}
{{ $data := .Data -}}
<div class="post-warp archive">
<h2 class="post-title animated pulse faster">
{{ printf "%s%s" (T "all") (T .Section | default (humanize .Section)) }}
{{ T "all" | humanize}}{{ T .Section | default .Section | humanize }}
</h2>
{{- range (.Paginate (.Pages.GroupByDate "2006")).PageGroups -}}

View File

@@ -4,7 +4,32 @@
<div class="post-warp single">
<h1 class="post-title animated pulse faster">{{ .Title }}</h1>
<div class="post-content">
{{ .Content }}
{{ $content := .Content }}
{{ $REin := `<img src="([^"]+)" alt="([^"]+)?" />` }}
{{ $REout := "<figure><img src=/images/loading.svg data-sizes=auto data-src=$1 alt=$2 class=lazyload><figcaption class=image-caption>$2</figcaption></figure>" }}
{{ $content = replaceRE $REin $REout $content }}
{{ $REin = `<img src="([^"]+)" alt="([^"]+)?" title="([^"]+)?" />` }}
{{ $REout = "<figure><img src=/images/loading.svg data-src=$1 data-sizes=auto alt=$2 title=$3 class=lazyload><figcaption class=image-caption>$2</figcaption></figure>" }}
{{ $content = replaceRE $REin $REout $content }}
{{ $REin = `:\(([\w- ]+?)\):` }}
{{ $REout = `<i class="inline-icon $1"></i>` }}
{{ $content = replaceRE $REin $REout $content }}
{{ $REin = `\[(.+?)\]\^\((.+?)\)` }}
{{ $REout = `<strong><ruby>$1<rt>$2</rt></ruby></strong>` }}
{{ $content = replaceRE $REin $REout $content }}
{{ $REin = `<sup>\[return\]</sup>` }}
{{ $REout = printf "<sup>[%s]</sup>" (T "return") }}
{{ $content = replaceRE $REin $REout $content }}
{{ $REin = `<(h[23456]) (id=".+?")>` }}
{{ $REout = `<a class="post-dummy-target" $2></a><$1>` }}
{{ $content = replaceRE $REin $REout $content }}
{{ $REin = `<(sup class="footnote-ref") (id="fnref:.+?")>` }}
{{ $REout = `<a class="post-dummy-target" $2></a><$1>` }}
{{ $content = replaceRE $REin $REout $content }}
{{ $REin = `<(li) (id="fn:.+?")>` }}
{{ $REout = `<$1><a class="post-dummy-target" $2></a>` }}
{{ $content = replaceRE $REin $REout $content }}
{{ $content | safeHTML }}
</div>
</div>
{{end }}

View File

@@ -34,7 +34,7 @@
</div>
<div class="post-content">
{{ if .Params.show_description }}
<p>{{ . }}</p>
<p>{{ .Params.description }}</p>
{{ else }}
{{ $summary := .Summary }}
{{ $REin := `:\(([\w- ]+?)\):` }}