diff options
Diffstat (limited to 'layouts/_default')
-rw-r--r-- | layouts/_default/_markup/render-header.html | 0 | ||||
-rw-r--r-- | layouts/_default/list.gmi | 7 | ||||
-rw-r--r-- | layouts/_default/list.html | 2 | ||||
-rw-r--r-- | layouts/_default/list.txt | 8 | ||||
-rw-r--r-- | layouts/_default/single.html | 31 |
5 files changed, 34 insertions, 14 deletions
diff --git a/layouts/_default/_markup/render-header.html b/layouts/_default/_markup/render-header.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layouts/_default/_markup/render-header.html diff --git a/layouts/_default/list.gmi b/layouts/_default/list.gmi index 8560760..cbdba50 100644 --- a/layouts/_default/list.gmi +++ b/layouts/_default/list.gmi @@ -1,12 +1,7 @@ # {{ .Title }} -{{ $content := .Content -}} +{{ $content := .RawContent -}} -{{ $content := $content | replaceRE `{{<\s*(?:rel)?ref\s+"([^"]+)"\s*>}}` "$1" -}} -{{ $content := $content | replaceRE `{{<\s*figure\s*(?:.*)?src="([^"]+)"(?:.*)?caption="([^"]+)"(?:.*)?>}}` "![$2]($1)" -}} -{{ $content := $content | replaceRE `{{<\s*image\s*.*?src="([^"]+)".*?>}}` "![]($1)" -}} -{{ $content := $content | replaceRE "(?s:< !--more-- >)" "" -}} -{{ $content := $content | replace "<!-- more -->" "" -}} {{ $content := $content | replaceRE `\[(.+?)\]\((.+?)\)` "\n=> $2 $1\n" -}} {{ $content }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index b7799ea..6409b6c 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -7,7 +7,7 @@ {{ .Title }} </h1> {{ .Content }} - <a href="index.xml" class="btn btn-primary">{{ partial "icon.html" "rss" }} Пописка</a> + <a href="index.xml" class="btn btn-primary">{{ partial "icon.html" "rss" }} Подписка</a> {{ end }} </div> <div class="col-xs-12 col-sm-12 col-md-8 content"> diff --git a/layouts/_default/list.txt b/layouts/_default/list.txt index 3dbd917..0d9cee8 100644 --- a/layouts/_default/list.txt +++ b/layouts/_default/list.txt @@ -1,3 +1,9 @@ +# {{ .Title }} + +{{ $content := .RawContent -}} + +{{ $content }} + {{ range .Pages.ByPublishDate.Reverse }} -{{ .Date.Format "2006-01-02" }} {{ .Title }} {{ with .OutputFormats.Get "txt" -}} {{ .RelPermalink }}{{ end }} +=> {{ .RelPermalink | replaceRE `index.txt` `` }}{{if .Date }} {{ .Date.Format "2006-01-02" }}{{ end }} {{ .Title }} {{ end }}
\ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index c5f73ba..507553d 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,9 +1,28 @@ {{ define "main" }} -<div class="container mx-auto my-5"> - <div class="post"> - {{ partial "single/header.html" . }} - <div class="e-content">{{ .Content }}</div> - {{ partial "single/footer.html" . }} - </div> +<div class="container"> + <div class="row"> + <div class="col-xs-12 col-sm-12 col-md-4 sidebar"> + <h1 class="post-title fw-semibold">{{.Page.FirstSection.Title}}</h1> + {{ if len .Page.TableOfContents }} + <h2 class="fw-semibold">Содержание</h2> + {{ .Page.TableOfContents }} {{ end }} {{if .Page.FirstSection.Pages}} + <h2 class="fw-semibold">Остальное</h2> + <ul> + {{ range .Page.CurrentSection.Pages }} + <li> + <a href="{{ .RelPermalink }}">{{ .Title }}</a> + </li> + {{ end }} + </ul> + {{ end }} + </div> + <div class="col-xs-12 col-sm-12 col-md-8 content"> + <div class="post"> + {{ partial "single/header.html" . }} + <div class="e-content">{{ .Content }}</div> + {{ partial "single/footer.html" . }} + </div> + </div> + </div> </div> {{ end }} |