summaryrefslogtreecommitdiff
path: root/themes/neonxp/layouts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--themes/neonxp/layouts/_partials/terms.html31
-rw-r--r--themes/neonxp/layouts/page.html75
2 files changed, 53 insertions, 53 deletions
diff --git a/themes/neonxp/layouts/_partials/terms.html b/themes/neonxp/layouts/_partials/terms.html
index f826abb..ec607ca 100644
--- a/themes/neonxp/layouts/_partials/terms.html
+++ b/themes/neonxp/layouts/_partials/terms.html
@@ -1,27 +1,16 @@
-{{- /*
-For a given taxonomy, renders a list of terms assigned to the page.
-
-@context {page} page The current page.
-@context {string} taxonomy The taxonomy.
-
-@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
-*/}}
-
{{- $page := .page }}
{{- $taxonomy := .taxonomy }}
{{- with $page.GetTerms $taxonomy }}
{{- if . }}
-<article>
- {{- $label := (index . 0).Parent.LinkTitle }}
- <div>
- <h3>{{ $label }}:</h3>
- <ul class="taxonomy">
- {{- range . }}
- <li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
- {{- end }}
- </ul>
- </div>
- {{- end }}
-</article>
+{{- $label := (index . 0).Parent.LinkTitle }}
+<div>
+ <h3>{{ i18n $label }}:</h3>
+ <ul class="taxonomy">
+ {{- range . }}
+ <li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
+ {{- end }}
+ </ul>
+</div>
+{{- end }}
{{- end }} \ No newline at end of file
diff --git a/themes/neonxp/layouts/page.html b/themes/neonxp/layouts/page.html
index 506b56a..6bc6380 100644
--- a/themes/neonxp/layouts/page.html
+++ b/themes/neonxp/layouts/page.html
@@ -1,37 +1,48 @@
{{ define "main" }}
-<div class="h-entry">
- <article>
- <h1 class="p-name">{{ .Title }}</h1>
- {{if .Date }}
- {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
- {{ $dateHuman := .Date | time.Format ":date_long" }}
- <time class="dt-published" datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
- {{end}}
- </article>
- <article class="e-content">
+<article class="h-entry">
+ <h1 class="p-name">{{ .Title }}</h1>
+ {{if .Date }}
+ {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
+ {{ $dateHuman := .Date | time.Format ":date_long" }}
+ <time class="dt-published" datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
+ {{end}}
+ <div class="e-content">
{{ .Content }}
- </article>
+ </div>
{{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
- {{if .Param "comments"}}
- <h2>Комментарии</h2>
- {{ range $key, $comment := where .Site.Data.comments "url" "eq" .Page.Path }}
- <article>
- <b>{{$comment.from}}:</b>
- <p>{{$comment.comment}}</p>
- </article>
- {{ else }}
- <article>Комментариев пока нет.</article>
- {{ end }}
-
- <article>
- {{ $comment := (print "mailto:blog@neonxp.ru?subject=" .Page.Permalink | safeHTML) }}
- Для отправки комментария достаточно отправить e-mail со своим комментарием
- на адрес
- <a href={{$comment}}>blog@neonxp.ru</a>, в теме нужно указать ссылку на
- пост.<br />
- Или просто нажать кнопку ниже. Всё очень просто :)<br />
- <a class="btn-primary" href={{$comment}}>Написать комментарий</a>
- </article>
+</article>
+{{if .Param "comments"}}
+<h2>Комментарии</h2>
+{{ range $key, $comment := where .Site.Data.comments "subject" "eq" .Page.Permalink }}
+<article>
+ <b>{{$comment.from_name}}:</b>
+ <p>
+ {{if $comment.date }}
+ {{ $dateMachine := $comment.date | time.Format "2006-01-02T15:04:05-07:00" }}
+ {{ $dateHuman := $comment.date | time.Format ":date_long" }}
+ <time class="dt-published" datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
+ {{end}}
+ </p>
+ <pre>{{$comment.body | safeHTML}}</pre>
+ {{if $comment.body_signature}}
+ <details>
+ <summary>Подпись</summary>
+ <pre>{{$comment.body_signature| safeHTML}}</pre>
+ </details>
{{end}}
-</div>
+</article>
+{{ else }}
+<article>Комментариев пока нет.</article>
+{{ end }}
+
+<article>
+ {{ $comment := (print "mailto:blog@neonxp.ru?subject=" .Page.Permalink | safeHTML) }}
+ Для отправки комментария достаточно отправить e-mail со своим комментарием
+ на адрес
+ <a href={{$comment}}>blog@neonxp.ru</a>, в теме нужно указать ссылку на
+ пост.<br />
+ Или просто нажать кнопку ниже. Всё очень просто :)<br />
+ <a class="btn-primary" href={{$comment}}>Написать комментарий</a>
+</article>
+{{end}}
{{ end }} \ No newline at end of file