mirror of https://github.com/jlelse/GoBlog
Render titles using Goldmark, fix bug
This commit is contained in:
parent
ba4c32b40b
commit
5317ef12c6
|
@ -106,7 +106,7 @@ func (a *goBlog) toASNote(p *post) *asNote {
|
||||||
AttributedTo: a.apIri(a.cfg.Blogs[p.Blog]),
|
AttributedTo: a.apIri(a.cfg.Blogs[p.Blog]),
|
||||||
}
|
}
|
||||||
// Name and Type
|
// Name and Type
|
||||||
if title := p.Title(); title != "" {
|
if title := a.renderText(p.Title()); title != "" {
|
||||||
as.Name = title
|
as.Name = title
|
||||||
as.Type = "Article"
|
as.Type = "Article"
|
||||||
} else {
|
} else {
|
||||||
|
|
2
feeds.go
2
feeds.go
|
@ -42,7 +42,7 @@ func (a *goBlog) generateFeed(blog string, f feedType, w http.ResponseWriter, r
|
||||||
}
|
}
|
||||||
for _, p := range posts {
|
for _, p := range posts {
|
||||||
feed.Add(&feeds.Item{
|
feed.Add(&feeds.Item{
|
||||||
Title: p.Title(),
|
Title: a.renderText(p.Title()),
|
||||||
Link: &feeds.Link{Href: a.fullPostURL(p)},
|
Link: &feeds.Link{Href: a.fullPostURL(p)},
|
||||||
Description: a.postSummary(p),
|
Description: a.postSummary(p),
|
||||||
Id: p.Path,
|
Id: p.Path,
|
||||||
|
|
|
@ -324,6 +324,9 @@ func (a *goBlog) micropubParsePostParamsMfItem(entry *post, mf *microformatItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *goBlog) computeExtraPostParameters(p *post) error {
|
func (a *goBlog) computeExtraPostParameters(p *post) error {
|
||||||
|
if p.Parameters == nil {
|
||||||
|
p.Parameters = map[string][]string{}
|
||||||
|
}
|
||||||
p.Content = regexp.MustCompile("\r\n").ReplaceAllString(p.Content, "\n")
|
p.Content = regexp.MustCompile("\r\n").ReplaceAllString(p.Content, "\n")
|
||||||
if split := strings.Split(p.Content, "---\n"); len(split) >= 3 && len(strings.TrimSpace(split[0])) == 0 {
|
if split := strings.Split(p.Content, "---\n"); len(split) >= 3 && len(strings.TrimSpace(split[0])) == 0 {
|
||||||
// Contains frontmatter
|
// Contains frontmatter
|
||||||
|
|
|
@ -44,8 +44,9 @@ const (
|
||||||
func (a *goBlog) initRendering() error {
|
func (a *goBlog) initRendering() error {
|
||||||
a.templates = map[string]*template.Template{}
|
a.templates = map[string]*template.Template{}
|
||||||
templateFunctions := template.FuncMap{
|
templateFunctions := template.FuncMap{
|
||||||
"md": a.safeRenderMarkdownAsHTML,
|
"md": a.safeRenderMarkdownAsHTML,
|
||||||
"html": wrapStringAsHTML,
|
"mdtext": a.renderText,
|
||||||
|
"html": wrapStringAsHTML,
|
||||||
// Post specific
|
// Post specific
|
||||||
"ps": postParameter,
|
"ps": postParameter,
|
||||||
"content": a.postHtml,
|
"content": a.postHtml,
|
||||||
|
|
|
@ -16,7 +16,7 @@ const telegramBaseURL = "https://api.telegram.org/bot"
|
||||||
func (a *goBlog) initTelegram() {
|
func (a *goBlog) initTelegram() {
|
||||||
a.pPostHooks = append(a.pPostHooks, func(p *post) {
|
a.pPostHooks = append(a.pPostHooks, func(p *post) {
|
||||||
if tg := a.cfg.Blogs[p.Blog].Telegram; tg.enabled() && p.isPublishedSectionPost() {
|
if tg := a.cfg.Blogs[p.Blog].Telegram; tg.enabled() && p.isPublishedSectionPost() {
|
||||||
if html := tg.generateHTML(p.Title(), a.fullPostURL(p), a.shortPostURL(p)); html != "" {
|
if html := tg.generateHTML(a.renderText(p.Title()), a.fullPostURL(p), a.shortPostURL(p)); html != "" {
|
||||||
if err := a.send(tg, html, "HTML"); err != nil {
|
if err := a.send(tg, html, "HTML"); err != nil {
|
||||||
log.Printf("Failed to send post to Telegram: %v", err)
|
log.Printf("Failed to send post to Telegram: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,11 +6,11 @@
|
||||||
<link rel="stylesheet" href="{{ asset "css/styles.css" }}">
|
<link rel="stylesheet" href="{{ asset "css/styles.css" }}">
|
||||||
{{ with .Canonical }}<link rel="canonical" href="{{ . }}">{{ end }}
|
{{ with .Canonical }}<link rel="canonical" href="{{ . }}">{{ end }}
|
||||||
{{ block "title" . }}
|
{{ block "title" . }}
|
||||||
<title>{{ .Blog.Title }}</title>
|
<title>{{ mdtext .Blog.Title }}</title>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<link rel="alternate" type="application/rss+xml" title="RSS ({{ .Blog.Title }})" href="{{ .Blog.Path }}.rss"/>
|
<link rel="alternate" type="application/rss+xml" title="RSS ({{ mdtext .Blog.Title }})" href="{{ .Blog.Path }}.rss"/>
|
||||||
<link rel="alternate" type="application/atom+xml" title="Atom ({{ .Blog.Title }})" href="{{ .Blog.Path }}.atom"/>
|
<link rel="alternate" type="application/atom+xml" title="Atom ({{ mdtext .Blog.Title }})" href="{{ .Blog.Path }}.atom"/>
|
||||||
<link rel="alternate" type="application/feed+json" title="JSON Feed ({{ .Blog.Title }})" href="{{ .Blog.Path }}.json"/>
|
<link rel="alternate" type="application/feed+json" title="JSON Feed ({{ mdtext .Blog.Title }})" href="{{ .Blog.Path }}.json"/>
|
||||||
<link rel="webmention" href="{{ absolute "/webmention" }}" />
|
<link rel="webmention" href="{{ absolute "/webmention" }}" />
|
||||||
<link rel="micropub" href="/micropub" />
|
<link rel="micropub" href="/micropub" />
|
||||||
<link rel="authorization_endpoint" href="/indieauth" />
|
<link rel="authorization_endpoint" href="/indieauth" />
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
{{ with .User }}{{ range .Identities }}<link rel="me" href="{{ . }}" />{{ end }}{{ end }}
|
{{ with .User }}{{ range .Identities }}<link rel="me" href="{{ . }}" />{{ end }}{{ end }}
|
||||||
{{ $os := opensearch .Blog }}
|
{{ $os := opensearch .Blog }}
|
||||||
{{ if $os }}
|
{{ if $os }}
|
||||||
<link rel="search" type="application/opensearchdescription+xml" href="{{ $os }}" title="{{ .Blog.Title }}" />
|
<link rel="search" type="application/opensearchdescription+xml" href="{{ $os }}" title="{{ mdtext .Blog.Title }}" />
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ include "header" . }}
|
{{ include "header" . }}
|
||||||
{{ block "main" . }}{{ end }}
|
{{ block "main" . }}{{ end }}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
<title>{{ .Data.Title }} - {{ .Blog.Title }}</title>
|
<title>{{ mdtext .Data.Title }} - {{ mdtext .Blog.Title }}</title>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<main>
|
<main>
|
||||||
{{ with .Data.Title }}<h1>{{ . }}</h1>{{ end }}
|
{{ with .Data.Title }}<h1>{{ mdtext . }}</h1>{{ end }}
|
||||||
{{ with .Data.Description }}{{ md . }}{{ end }}
|
{{ with .Data.Description }}{{ md . }}{{ end }}
|
||||||
<p><a href="{{ .Blog.RelativePath .Data.Download }}" class="button" download>{{ string .Blog.Lang "download" }}</a></p>
|
<p><a href="{{ .Blog.RelativePath .Data.Download }}" class="button" download>{{ string .Blog.Lang "download" }}</a></p>
|
||||||
{{ $lang := .Blog.Lang }}
|
{{ $lang := .Blog.Lang }}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
<title>{{ with .Blog.BlogStats.Title }}{{ . }} - {{ end }}{{ .Blog.Title }}</title>
|
<title>{{ with .Blog.BlogStats.Title }}{{ mdtext . }} - {{ end }}{{ mdtext .Blog.Title }}</title>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<main>
|
<main>
|
||||||
{{ with .Blog.BlogStats.Title }}<h1>{{ . }}</h1>{{ end }}
|
{{ with .Blog.BlogStats.Title }}<h1>{{ mdtext . }}</h1>{{ end }}
|
||||||
{{ with .Blog.BlogStats.Description }}{{ md . }}{{ end }}
|
{{ with .Blog.BlogStats.Description }}{{ md . }}{{ end }}
|
||||||
<p id="loading" data-table="{{.Data.TableUrl}}">{{ string .Blog.Lang "loading" }}</p>
|
<p id="loading" data-table="{{.Data.TableUrl}}">{{ string .Blog.Lang "loading" }}</p>
|
||||||
<script defer src="{{ asset "js/blogstats.js" }}"></script>
|
<script defer src="{{ asset "js/blogstats.js" }}"></script>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
<title>{{ string .Blog.Lang "captcha" }} - {{ .Blog.Title }}</title>
|
<title>{{ string .Blog.Lang "captcha" }} - {{ mdtext .Blog.Title }}</title>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
<title>{{ string .Blog.Lang "comments" }} - {{ .Blog.Title }}</title>
|
<title>{{ string .Blog.Lang "comments" }} - {{ mdtext .Blog.Title }}</title>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
{{ if .Data.sent }}
|
{{ if .Data.sent }}
|
||||||
<p>{{ string .Blog.Lang "messagesent" }}</p>
|
<p>{{ string .Blog.Lang "messagesent" }}</p>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ with .Data.title }}<h1>{{ . }}</h1>{{ end }}
|
{{ with .Data.title }}<h1>{{ mdtext . }}</h1>{{ end }}
|
||||||
{{ with .Data.description }}{{ md . }}{{ end }}
|
{{ with .Data.description }}{{ md . }}{{ end }}
|
||||||
<form class="fw p" method="post">
|
<form class="fw p" method="post">
|
||||||
<input type="text" name="name" placeholder="{{ string .Blog.Lang "nameopt" }}">
|
<input type="text" name="name" placeholder="{{ string .Blog.Lang "nameopt" }}">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
<title>{{ string .Blog.Lang "editor" }} - {{ .Blog.Title }}</title>
|
<title>{{ string .Blog.Lang "editor" }} - {{ mdtext .Blog.Title }}</title>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
<title>{{ string .Blog.Lang "mediafiles" }} - {{ .Blog.Title }}</title>
|
<title>{{ string .Blog.Lang "mediafiles" }} - {{ mdtext .Blog.Title }}</title>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{{ define "footer" }}
|
{{ define "footer" }}
|
||||||
<footer>
|
<footer>
|
||||||
{{ with index .Blog.Menus "footer" }}
|
{{ with index .Blog.Menus "footer" }}
|
||||||
<nav>{{ range $i, $item := .Items }}{{ if ne $i 0 }} • {{ end }}<a href="{{ $item.Link }}">{{ $item.Title }}</a>{{ end }}
|
<nav>{{ range $i, $item := .Items }}{{ if ne $i 0 }} • {{ end }}<a href="{{ $item.Link }}">{{ mdtext $item.Title }}</a>{{ end }}
|
||||||
</nav>
|
</nav>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<p translate="no">© {{ dateformat now "2006" }} {{ with .User.Name }}{{ . }}{{ else }}{{ .Blog.Title }}{{ end }}</p>
|
<p translate="no">© {{ dateformat now "2006" }} {{ with .User.Name }}{{ . }}{{ else }}{{ mdtext .Blog.Title }}{{ end }}</p>
|
||||||
{{ if .TorUsed }}
|
{{ if .TorUsed }}
|
||||||
<p id="tor">🔐 {{ string .Blog.Lang "connectedviator" }}</p>
|
<p id="tor">🔐 {{ string .Blog.Lang "connectedviator" }}</p>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
<title>{{ .Blog.Title }}</title>
|
<title>{{ mdtext .Blog.Title }}</title>
|
||||||
{{ if not .Data.nolocations }}
|
{{ if not .Data.nolocations }}
|
||||||
<link rel="stylesheet" href="{{ .Data.mappath }}/leaflet/leaflet.css"/>
|
<link rel="stylesheet" href="{{ .Data.mappath }}/leaflet/leaflet.css"/>
|
||||||
<script src="{{ .Data.mappath }}/leaflet/leaflet.js"></script>
|
<script src="{{ .Data.mappath }}/leaflet/leaflet.js"></script>
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{{ define "header" }}
|
{{ define "header" }}
|
||||||
<header>
|
<header>
|
||||||
<h1><a href="{{ .Blog.RelativePath "/" }}" rel="home" title="{{ .Blog.Title }}" translate="no">{{ .Blog.Title }}</a></h1>
|
<h1><a href="{{ .Blog.RelativePath "/" }}" rel="home" title="{{ mdtext .Blog.Title }}" translate="no">{{ mdtext .Blog.Title }}</a></h1>
|
||||||
{{ with .Blog.Description }}<p><i>{{ . }}</i></p>{{ end }}
|
{{ with .Blog.Description }}<p><i>{{ . }}</i></p>{{ end }}
|
||||||
<nav>
|
<nav>
|
||||||
{{ with index .Blog.Menus "main" }}
|
{{ with index .Blog.Menus "main" }}
|
||||||
{{ range $i, $item := .Items }}{{ if ne $i 0 }} • {{ end }}<a href="{{ $item.Link }}">{{ $item.Title }}</a>{{ end }}
|
{{ range $i, $item := .Items }}{{ if ne $i 0 }} • {{ end }}<a href="{{ $item.Link }}">{{ mdtext $item.Title }}</a>{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</nav>
|
</nav>
|
||||||
{{ if .LoggedIn }}
|
{{ if .LoggedIn }}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
<title>{{ with .Data.Title }}{{ . }} - {{ end }}{{ .Blog.Title }}</title>
|
<title>{{ with .Data.Title }}{{ mdtext . }} - {{ end }}{{ mdtext .Blog.Title }}</title>
|
||||||
<link rel="alternate" type="application/rss+xml" title="RSS{{ with .Data.Title }} ({{ . }}){{ end }}" href="{{ .Data.First }}.rss"/>
|
<link rel="alternate" type="application/rss+xml" title="RSS{{ with .Data.Title }} ({{ mdtext . }}){{ end }}" href="{{ .Data.First }}.rss"/>
|
||||||
<link rel="alternate" type="application/atom+xml" title="Atom{{ with .Data.Title }} ({{ . }}){{ end }}" href="{{ .Data.First }}.atom"/>
|
<link rel="alternate" type="application/atom+xml" title="Atom{{ with .Data.Title }} ({{ mdtext . }}){{ end }}" href="{{ .Data.First }}.atom"/>
|
||||||
<link rel="alternate" type="application/feed+json" title="JSON Feed{{ with .Data.Title }} ({{ . }}){{ end }}" href="{{ .Data.First }}.json"/>
|
<link rel="alternate" type="application/feed+json" title="JSON Feed{{ with .Data.Title }} ({{ mdtext . }}){{ end }}" href="{{ .Data.First }}.json"/>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<main class="h-feed">
|
<main class="h-feed">
|
||||||
{{ with .Data.Title }}<h1 class="p-name">{{ . }}</h1>{{ end }}
|
{{ with .Data.Title }}<h1 class="p-name">{{ mdtext . }}</h1>{{ end }}
|
||||||
{{ with .Data.Description }}{{ md . }}{{ end }}
|
{{ with .Data.Description }}{{ md . }}{{ end }}
|
||||||
{{ if (or .Data.Title .Data.Description) }}
|
{{ if (or .Data.Title .Data.Description) }}
|
||||||
<hr>
|
<hr>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
<title>{{ string .Blog.Lang "login" }} - {{ .Blog.Title }}</title>
|
<title>{{ string .Blog.Lang "login" }} - {{ mdtext .Blog.Title }}</title>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
<title>{{ string "notifications" }} - {{ .Blog.Title }}</title>
|
<title>{{ string "notifications" }} - {{ mdtext .Blog.Title }}</title>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
{{ if .Data.Title }}
|
{{ if .Data.Title }}
|
||||||
<h2 class="p-name">
|
<h2 class="p-name">
|
||||||
<a class="u-url" href="{{ .Data.Path }}">
|
<a class="u-url" href="{{ .Data.Path }}">
|
||||||
{{ .Data.Title }}
|
{{ mdtext .Data.Title }}
|
||||||
</a>
|
</a>
|
||||||
</h2>
|
</h2>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
<title>{{ with .Data.Title }}{{ . }} - {{end}}{{ .Blog.Title }}</title>
|
<title>{{ with .Data.Title }}{{ mdtext . }} - {{end}}{{ mdtext .Blog.Title }}</title>
|
||||||
{{ include "postheadmeta" . }}
|
{{ include "postheadmeta" . }}
|
||||||
{{ with shorturl .Data }}<link rel="shortlink" href="{{ . }}">{{ end }}
|
{{ with shorturl .Data }}<link rel="shortlink" href="{{ . }}">{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
<main class=h-entry>
|
<main class=h-entry>
|
||||||
<article>
|
<article>
|
||||||
<data class="u-url hide" value="{{ absolute .Data.Path }}"></data>
|
<data class="u-url hide" value="{{ absolute .Data.Path }}"></data>
|
||||||
{{ with .Data.Title }}<h1 class=p-name>{{ . }}</h1>{{ end }}
|
{{ with .Data.Title }}<h1 class=p-name>{{ mdtext . }}</h1>{{ end }}
|
||||||
{{ include "postmeta" . }}
|
{{ include "postmeta" . }}
|
||||||
{{ include "postactions" . }}
|
{{ include "postactions" . }}
|
||||||
{{ if .Data.Content }}
|
{{ if .Data.Content }}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{{ define "postactions" }}
|
{{ define "postactions" }}
|
||||||
<div class="p flex" id="post-actions">
|
<div class="p flex" id="post-actions">
|
||||||
<a href="https://www.addtoany.com/share#url={{ absolute .Data.Path }}{{ with .Data.Title }}&title={{ . }}{{ end }}" target="_blank" rel="nofollow noopener noreferrer" class="button">{{ string .Blog.Lang "share" }}</a>
|
<a href="https://www.addtoany.com/share#url={{ absolute .Data.Path }}{{ with .Data.Title }}&title={{ mdtext . }}{{ end }}" target="_blank" rel="nofollow noopener noreferrer" class="button">{{ string .Blog.Lang "share" }}</a>
|
||||||
<a id="translateBtn" href="https://translate.google.com/translate?u={{ absolute .Data.Path }}" target="_blank" rel="nofollow noopener noreferrer" class="button">{{ string .Blog.Lang "translate" }}</a>
|
<a id="translateBtn" href="https://translate.google.com/translate?u={{ absolute .Data.Path }}" target="_blank" rel="nofollow noopener noreferrer" class="button">{{ string .Blog.Lang "translate" }}</a>
|
||||||
<script defer src="{{ asset "js/translate.js" }}"></script>
|
<script defer src="{{ asset "js/translate.js" }}"></script>
|
||||||
<button id="speakBtn" class="hide" data-speak="{{ string .Blog.Lang "speak" }}" data-stopspeak="{{ string .Blog.Lang "stopspeak" }}"></button>
|
<button id="speakBtn" class="hide" data-speak="{{ string .Blog.Lang "speak" }}" data-stopspeak="{{ string .Blog.Lang "stopspeak" }}"></button>
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
<meta property="twitter:url" content="{{ . }}">
|
<meta property="twitter:url" content="{{ . }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ with .Data.Title }}
|
{{ with .Data.Title }}
|
||||||
<meta property="og:title" content="{{ . }}">
|
<meta property="og:title" content="{{ mdtext . }}">
|
||||||
<meta property="twitter:title" content="{{ . }}">
|
<meta property="twitter:title" content="{{ mdtext . }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ with summary .Data }}
|
{{ with summary .Data }}
|
||||||
<meta name="description" content="{{ . }}">
|
<meta name="description" content="{{ . }}">
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
{{ include "summaryandpostmeta" . }}
|
{{ include "summaryandpostmeta" . }}
|
||||||
{{ $translations := (translations .Data) }}
|
{{ $translations := (translations .Data) }}
|
||||||
{{ if gt (len $translations) 0 }}
|
{{ if gt (len $translations) 0 }}
|
||||||
<div>{{ string .Blog.Lang "translations" }}: {{ $delimiter := "" }}{{ range $i, $t := $translations }}{{ $delimiter }}<a href="{{ $t.Path }}" translate="no">{{ $t.Title }}</a>{{ $delimiter = ", " }}{{ end }}</div>
|
<div>{{ string .Blog.Lang "translations" }}: {{ $delimiter := "" }}{{ range $i, $t := $translations }}{{ $delimiter }}<a href="{{ $t.Path }}" translate="no">{{ mdtext $t.Title }}</a>{{ $delimiter = ", " }}{{ end }}</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ $short := shorturl .Data }}
|
{{ $short := shorturl .Data }}
|
||||||
{{ if $short }}<div>{{ string .Blog.Lang "shorturl" }} <a href="{{ $short }}" rel="shortlink">{{ $short }}</a></div>{{ end }}
|
{{ if $short }}<div>{{ string .Blog.Lang "shorturl" }} <a href="{{ $short }}" rel="shortlink">{{ $short }}</a></div>{{ end }}
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
{{ range $i, $tax := $blog.Taxonomies }}
|
{{ range $i, $tax := $blog.Taxonomies }}
|
||||||
{{ $tvs := sort (ps $post $tax.Name) }}
|
{{ $tvs := sort (ps $post $tax.Name) }}
|
||||||
{{ if $tvs }}
|
{{ if $tvs }}
|
||||||
<p><b>{{ $tax.Title }}</b>:
|
<p><b>{{ mdtext $tax.Title }}</b>:
|
||||||
{{ range $j, $tv := $tvs }}
|
{{ range $j, $tv := $tvs }}
|
||||||
<a class="p-category" rel="tag" href="{{ $blog.RelativePath ( printf "/%s/%s" $tax.Name (urlize $tv) ) }}">{{ $tv }}</a>
|
<a class="p-category" rel="tag" href="{{ $blog.RelativePath ( printf "/%s/%s" $tax.Name (urlize $tv) ) }}">{{ mdtext $tv }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</p>
|
</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
<title>{{ with .Blog.Search.Title }}{{ . }} - {{ end }}{{ .Blog.Title }}</title>
|
<title>{{ with .Blog.Search.Title }}{{ mdtext . }} - {{ end }}{{ mdtext .Blog.Title }}</title>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<main>
|
<main>
|
||||||
{{ with .Blog.Search.Title }}<h1>{{ . }}</h1>{{ end }}
|
{{ with .Blog.Search.Title }}<h1>{{ mdtext . }}</h1>{{ end }}
|
||||||
{{ with .Blog.Search.Description }}{{ md . }}{{ end }}
|
{{ with .Blog.Search.Description }}{{ md . }}{{ end }}
|
||||||
{{ if (or .Blog.Search.Title .Blog.Search.Description) }}
|
{{ if (or .Blog.Search.Title .Blog.Search.Description) }}
|
||||||
<hr>
|
<hr>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<form class="fw p" method="post">
|
<form class="fw p" method="post">
|
||||||
<input type="text" name="q" {{ with .Blog.Search.Placeholder }}placeholder="{{ . }}"{{ end }}>
|
<input type="text" name="q" {{ with .Blog.Search.Placeholder }}placeholder="{{ mdtext . }}"{{ end }}>
|
||||||
<input type="submit" value="🔍 {{ string .Blog.Lang "search" }}">
|
<input type="submit" value="🔍 {{ string .Blog.Lang "search" }}">
|
||||||
</form>
|
</form>
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
<title>{{ .Blog.Title }}</title>
|
<title>{{ mdtext .Blog.Title }}</title>
|
||||||
{{ include "postheadmeta" . }}
|
{{ include "postheadmeta" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
{{ if .Data.Title }}
|
{{ if .Data.Title }}
|
||||||
<h2 class="p-name">
|
<h2 class="p-name">
|
||||||
<a class="u-url" href="{{ .Data.Path }}">
|
<a class="u-url" href="{{ .Data.Path }}">
|
||||||
{{ .Data.Title }}
|
{{ mdtext .Data.Title }}
|
||||||
</a>
|
</a>
|
||||||
</h2>
|
</h2>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{{ define "summaryandpostmeta" }}
|
{{ define "summaryandpostmeta" }}
|
||||||
{{ $section := (index .Blog.Sections .Data.Section) }}
|
{{ $section := (index .Blog.Sections .Data.Section) }}
|
||||||
{{ if .Data.Published }}<div>{{ string .Blog.Lang "publishedon" }} <time class="dt-published" datetime="{{ dateformat .Data.Published "2006-01-02T15:04:05Z07:00"}}">{{ isodate .Data.Published }}</time>{{ if $section }} in <a href="{{ .Blog.RelativePath $section.Name }}">{{ $section.Title }}</a>{{ end }}</div>{{ end }}
|
{{ if .Data.Published }}<div>{{ string .Blog.Lang "publishedon" }} <time class="dt-published" datetime="{{ dateformat .Data.Published "2006-01-02T15:04:05Z07:00"}}">{{ isodate .Data.Published }}</time>{{ if $section }} in <a href="{{ .Blog.RelativePath $section.Name }}">{{ mdtext $section.Title }}</a>{{ end }}</div>{{ end }}
|
||||||
{{ if .Data.Updated }}<div>{{ string .Blog.Lang "updatedon" }} <time class="dt-updated" datetime="{{ dateformat .Data.Updated "2006-01-02T15:04:05Z07:00"}}">{{ isodate .Data.Updated }}</time></div>{{ end }}
|
{{ if .Data.Updated }}<div>{{ string .Blog.Lang "updatedon" }} <time class="dt-updated" datetime="{{ dateformat .Data.Updated "2006-01-02T15:04:05Z07:00"}}">{{ isodate .Data.Updated }}</time></div>{{ end }}
|
||||||
{{ if replylink .Data }}
|
{{ if replylink .Data }}
|
||||||
<div>{{ string .Blog.Lang "replyto" }}: <a class="u-in-reply-to" href="{{ replylink .Data }}" target="_blank" rel="noopener">{{ with (replytitle .Data) }}{{ . }}{{ else }}{{ replylink .Data }}{{ end }}</a></div>
|
<div>{{ string .Blog.Lang "replyto" }}: <a class="u-in-reply-to" href="{{ replylink .Data }}" target="_blank" rel="noopener">{{ with (replytitle .Data) }}{{ . }}{{ else }}{{ replylink .Data }}{{ end }}</a></div>
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
<title>{{ .Data.Taxonomy.Title }} - {{ .Blog.Title }}</title>
|
<title>{{ mdtext .Data.Taxonomy.Title }} - {{ mdtext .Blog.Title }}</title>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<main>
|
<main>
|
||||||
{{ with .Data.Taxonomy.Title }}<h1>{{ . }}</h1>{{ end }}
|
{{ with .Data.Taxonomy.Title }}<h1>{{ mdtext . }}</h1>{{ end }}
|
||||||
{{ with .Data.Taxonomy.Description }}{{ md . }}{{ end }}
|
{{ with .Data.Taxonomy.Description }}{{ md . }}{{ end }}
|
||||||
{{ $blog := .Blog }}
|
{{ $blog := .Blog }}
|
||||||
{{ $taxonomy := .Data.Taxonomy.Name }}
|
{{ $taxonomy := .Data.Taxonomy.Name }}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
<title>{{ string .Blog.Lang "webmentions" }} - {{ .Blog.Title }}</title>
|
<title>{{ string .Blog.Lang "webmentions" }} - {{ mdtext .Blog.Title }}</title>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
|
|
Loading…
Reference in New Issue