merge with upstream
This commit is contained in:
commit
37886b6001
35 changed files with 4741 additions and 6669 deletions
|
@ -46,7 +46,7 @@
|
|||
|
||||
{{ if not .Params.showFullContent }}
|
||||
<div>
|
||||
<a class="read-more button inline" href="{{ .RelPermalink }}">{{ $.Site.Params.ReadMore }}</a>
|
||||
<a class="read-more button inline" href="{{ .RelPermalink }}">[{{ $.Site.Params.ReadMore }}]</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</article>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
{{ if not .Params.showFullContent }}
|
||||
<div>
|
||||
<a class="read-more button inline" href="{{ .RelPermalink }}">{{ $.Site.Params.ReadMore }}</a>
|
||||
<a class="read-more button inline" href="{{ .RelPermalink }}">[{{ $.Site.Params.ReadMore }}]</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</article>
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
{{- $pctx := . -}}
|
||||
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
|
||||
{{- $pages := slice -}}
|
||||
{{- if or $.IsHome $.IsSection -}}
|
||||
{{- $pages = $pctx.RegularPages -}}
|
||||
{{- else -}}
|
||||
{{- $pages = $pctx.Pages -}}
|
||||
{{- end -}}
|
||||
{{- $limit := .Site.Config.Services.RSS.Limit -}}
|
||||
{{- if ge $limit 1 -}}
|
||||
{{- $pages = $pages | first $limit -}}
|
||||
{{- end -}}
|
||||
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
||||
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
|
||||
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
|
||||
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
|
||||
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
|
||||
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
|
||||
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
|
||||
{{- with .OutputFormats.Get "RSS" -}}
|
||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||
{{- end -}}
|
||||
{{ range $pages }}
|
||||
<item>
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>{{ .Summary | html }}</description>
|
||||
<content>{{ .Content | html }}</content>
|
||||
</item>
|
||||
{{ end }}
|
||||
</channel>
|
||||
</rss>
|
|
@ -1,57 +1,57 @@
|
|||
{{ define "main" }}
|
||||
<h1>Posts for: #{{ .Title }}</h1>
|
||||
{{ with .Content }}
|
||||
<div class="index-content">
|
||||
{{ . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="posts">
|
||||
{{ range .Paginator.Pages }}
|
||||
<article class="post on-list">
|
||||
<h1 class="post-title">
|
||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||
</h1>
|
||||
<div class="post-meta">
|
||||
{{- if .Date -}}
|
||||
<time class="post-date">
|
||||
{{- .Date.Format "2006-01-02" -}}
|
||||
</time>
|
||||
{{- end -}}
|
||||
{{- with .Params.Author -}}
|
||||
<span class="post-author">{{- . -}}</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
{{ if .Params.tags }}
|
||||
<span class="post-tags">
|
||||
{{ range .Params.tags }}
|
||||
#<a href="{{ (urlize (printf "tags/%s/" . )) | absLangURL }}">
|
||||
{{- . -}}
|
||||
</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "cover.html" . }}
|
||||
|
||||
<div class="post-content">
|
||||
{{ if .Params.showFullContent }}
|
||||
{{ .Content }}
|
||||
{{ else if .Description }}
|
||||
<p>{{ .Description | markdownify }}</p>
|
||||
{{ else }}
|
||||
{{ .Summary }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ if not .Params.showFullContent }}
|
||||
<div>
|
||||
<a class="read-more button inline" href="{{ .RelPermalink }}">{{ $.Site.Params.ReadMore }}</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ define "main" }}
|
||||
<h1>Posts for: #{{ .Title }}</h1>
|
||||
{{ with .Content }}
|
||||
<div class="index-content">
|
||||
{{ . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="posts">
|
||||
{{ range .Paginator.Pages }}
|
||||
<article class="post on-list">
|
||||
<h1 class="post-title">
|
||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||
</h1>
|
||||
<div class="post-meta">
|
||||
{{- if .Date -}}
|
||||
<time class="post-date">
|
||||
{{- .Date.Format "2006-01-02" -}}
|
||||
</time>
|
||||
{{- end -}}
|
||||
{{- with .Params.Author -}}
|
||||
<span class="post-author">{{- . -}}</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
{{ if .Params.tags }}
|
||||
<span class="post-tags">
|
||||
{{ range .Params.tags }}
|
||||
#<a href="{{ (urlize (printf "tags/%s/" . )) | absLangURL }}">
|
||||
{{- . -}}
|
||||
</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "cover.html" . }}
|
||||
|
||||
<div class="post-content">
|
||||
{{ if .Params.showFullContent }}
|
||||
{{ .Content }}
|
||||
{{ else if .Description }}
|
||||
<p>{{ .Description | markdownify }}</p>
|
||||
{{ else }}
|
||||
{{ .Summary }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ if not .Params.showFullContent }}
|
||||
<div>
|
||||
<a class="read-more button inline" href="{{ .RelPermalink }}">[{{ $.Site.Params.ReadMore }}]</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
</footer>
|
||||
|
||||
{{ $menu := resources.Get "js/menu.js" | js.Build }}
|
||||
{{ $prism := resources.Get "js/prism.js" | js.Build }}
|
||||
{{ $cp := resources.Get "js/code.js" | js.Build }}
|
||||
|
||||
{{ $bundle := slice $menu $prism | resources.Concat "bundle.js" | resources.Minify }}
|
||||
{{ $bundle := slice $menu $cp | resources.Concat "bundle.js" | resources.Minify }}
|
||||
|
||||
<script type="text/javascript" src="{{ $bundle.RelPermalink }}"></script>
|
||||
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
<div class="pagination">
|
||||
<div class="pagination__buttons">
|
||||
{{ if .Paginator.HasPrev }}
|
||||
<a href="{{ .Paginator.Prev.URL }}" class="button prev">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">{{ $.Site.Params.newerPosts | default "Newer posts" }}</span>
|
||||
<a href="{{ .Paginator.Prev.URL }}" class="button inline prev">
|
||||
< [<span class="button__text">{{ $.Site.Params.newerPosts | default "Newer posts" }}</span>]
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ if and .Paginator.HasPrev .Paginator.HasNext }}
|
||||
::
|
||||
{{ end }}
|
||||
{{ if .Paginator.HasNext }}
|
||||
<a href="{{ .Paginator.Next.URL }}" class="button next">
|
||||
<span class="button__text">{{ $.Site.Params.olderPosts | default "Older posts" }}</span>
|
||||
<span class="button__icon">→</span>
|
||||
<a href="{{ .Paginator.Next.URL }}" class="button inline next">
|
||||
[<span class="button__text">{{ $.Site.Params.olderPosts | default "Older posts" }}</span>] >
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<div class="pagination__buttons">
|
||||
{{ if .NextInSection }}
|
||||
<a href="{{ .NextInSection.Permalink }}" class="button inline prev">
|
||||
{{ .NextInSection.Title }}
|
||||
< [<span class="button__text">{{ .NextInSection.Title }}</span>]
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ if and .NextInSection .PrevInSection }}
|
||||
|
@ -15,7 +15,7 @@
|
|||
{{ end }}
|
||||
{{ if .PrevInSection }}
|
||||
<a href="{{ .PrevInSection.Permalink }}" class="button inline next">
|
||||
{{ .PrevInSection.Title }}
|
||||
[<span class="button__text">{{ .PrevInSection.Title }}</span>] >
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
{{ $id := delimit (shuffle (seq 1 9)) "" }}
|
||||
{{ $open := .Get "open" }}
|
||||
{{ $lang := .Get "language" }}
|
||||
{{ $opts := .Get "opts" }}
|
||||
|
||||
{{ if .Get "language" }}
|
||||
<div class="collapsable-code">
|
||||
<input id="{{ .Get "id" | default $id }}" type="checkbox" {{ if ( eq ( .Get "isCollapsed" ) "true" ) -}} checked {{- end }} />
|
||||
<label for="{{ .Get "id" | default $id }}">
|
||||
<span class="collapsable-code__language">{{ .Get "language" }}</span>
|
||||
{{ if .Get "title" }}<span class="collapsable-code__title">{{ .Get "title" | markdownify }}</span>{{ end }}
|
||||
<span class="collapsable-code__toggle" data-label-expand="{{ .Get "expand" | default "△" }}" data-label-collapse="{{ .Get "collapse" | default "▽" }}"></span>
|
||||
</label>
|
||||
<pre {{ if .Get "language" }}class="language-{{ .Get "language" }}" {{ end }}><code>{{ .Inner | string }}</code></pre>
|
||||
</div>
|
||||
{{- if $lang -}}
|
||||
<details class="collapsable-code" {{ if eq $open "true" -}} open {{- end }}>
|
||||
<summary title="Click to interact">
|
||||
{{- if .Get "title" }}<span class="collapsable-code__title">{{ .Get "title" | markdownify }}</span>{{ end -}}
|
||||
</summary>
|
||||
{{ $trInner := trim .Inner "\n" }}
|
||||
{{- transform.Highlight $trInner $lang $opts -}}
|
||||
</details>
|
||||
{{ else }}
|
||||
{{ errorf "If you want to use the \"collapsable code\" shortcode, you need to pass a mandatory \"language\" param. The issue occured in %q (%q)" .Page.File .Page.Permalink }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
{{ if .Get "src" }}
|
||||
<figure class="{{ with .Get "position"}}{{ . }}{{ else -}} left {{- end }}" >
|
||||
<img src="{{ .Get "src" | safeURL }}" {{ with .Get "alt" }} alt="{{ . | plainify }}" {{ end }} {{ with .Get "style" }} style="{{ . | safeCSS }}" {{ end }} />
|
||||
{{ if .Get "caption" }}
|
||||
<figcaption class="{{ with .Get "captionPosition"}}{{ . }}{{ else -}} center {{- end }}" {{ with .Get "captionStyle" }} style="{{ . | safeCSS }}" {{ end }}>{{ .Get "caption" | safeHTML }}</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
{{ end }}
|
|
@ -1,26 +0,0 @@
|
|||
{{ $inner := replaceRE "^\r?\n" "" .Inner | string }}
|
||||
{{ if len .Params | eq 0 }}
|
||||
<pre><code>{{ $inner }}</code></pre>
|
||||
{{ else }}
|
||||
{{ if .IsNamedParams }}
|
||||
<pre class="
|
||||
{{- if .Get "lang" }}language-{{ .Get "lang" }}{{ end }}
|
||||
{{- if .Get "line-numbers" }} line-numbers{{ end }}
|
||||
{{- if .Get "command-line" }} command-line{{ end }}"
|
||||
{{- /* line highlight plugin */ -}}
|
||||
{{- if .Get "line" }} data-line="{{ .Get "line" }}"{{ end }}
|
||||
{{- /* line number plugin */ -}}
|
||||
{{- if .Get "start" }} data-start="{{ .Get "start" }}"{{ end }}
|
||||
{{- /* command-line plugin */ -}}
|
||||
{{- if .Get "user" }} data-user="{{ .Get "user" }}"{{ end }}
|
||||
{{- if .Get "host" }} data-host="{{ .Get "host" }}"{{ end }}
|
||||
{{- if .Get "prompt" }} data-prompt="{{ .Get "prompt" }}"{{ end }}
|
||||
{{- if .Get "output" }} data-output="{{ .Get "output" }}"{{ end }}
|
||||
><code {{ if .Get "lang" }}class="language-{{ .Get "lang" }}"{{ end }}
|
||||
>{{ $inner }}</code></pre>
|
||||
{{ else }}
|
||||
<pre class="language-{{ .Get 0 }}">
|
||||
<code class="language-{{ .Get 0 }}">{{ $inner }}</code>
|
||||
</pre>
|
||||
{{ end }}
|
||||
{{ end }}
|
Loading…
Add table
Add a link
Reference in a new issue