diff --git a/shortPath.go b/shortPath.go index 04dfa62..4a7dcd4 100644 --- a/shortPath.go +++ b/shortPath.go @@ -60,5 +60,5 @@ func redirectToLongPath(rw http.ResponseWriter, r *http.Request) { serve404(rw, r) return } - http.Redirect(rw, r, path, http.StatusFound) + http.Redirect(rw, r, path, http.StatusMovedPermanently) } diff --git a/templates/postmeta.gohtml b/templates/postmeta.gohtml index f7e71af..a1f45f8 100644 --- a/templates/postmeta.gohtml +++ b/templates/postmeta.gohtml @@ -1,17 +1,11 @@ {{ define "postmeta" }}
- {{ $section := (index .Blog.Sections .Data.Section) }} - {{ if .Data.Published }}
{{ string .Blog.Lang "publishedon" }} {{ if $section }} in {{ $section.Title }}{{ end }}
{{ end }} - {{ if .Data.Updated }}
{{ string .Blog.Lang "updatedon" }}
{{ end }} - {{ if p .Data "replylink" }} -
{{ string .Blog.Lang "replyto" }}: {{ p .Data "replytitle" | default (p .Data "replylink") }}
- {{ end }} - {{ if p .Data "likelink" }} -
{{ string .Blog.Lang "likeof" }}: {{ p .Data "liketitle" | default (p .Data "likelink") }}
- {{ end }} + {{ include "summaryandpostmeta" . }} {{ $translations := (translations .Data) }} {{ if gt (len $translations) 0 }}
{{ string .Blog.Lang "translations" }}: {{ $delimiter := "" }}{{ range $i, $t := $translations }}{{ $delimiter }}{{ title $t }}{{ $delimiter = ", " }}{{ end }}
{{ end }} + {{ $short := shorturl .Data }} + {{ if $short }}
{{ string .Blog.Lang "shorturl" }} {{ $short }}
{{ end }}
{{ end }} \ No newline at end of file diff --git a/templates/strings/de.yaml b/templates/strings/de.yaml index e3b3909..94841f7 100644 --- a/templates/strings/de.yaml +++ b/templates/strings/de.yaml @@ -10,4 +10,5 @@ share: "Teilen" speak: "Lies mir bitte vor." stopspeak: "Hör auf zu sprechen!" oldcontent: "⚠️ Dieser Eintrag ist bereits über ein Jahr alt. Er ist möglicherweise nicht mehr aktuell. Meinungen können sich geändert haben." -search: "Suchen" \ No newline at end of file +search: "Suchen" +shorturl: "Kurz-URL:" \ No newline at end of file diff --git a/templates/strings/default.yaml b/templates/strings/default.yaml index ebfe02b..9e1cec1 100644 --- a/templates/strings/default.yaml +++ b/templates/strings/default.yaml @@ -29,4 +29,5 @@ update: "Update" upload: "Upload" login: "Login" username: "Username" -password: "Password" \ No newline at end of file +password: "Password" +shorturl: "Short URL:" \ No newline at end of file diff --git a/templates/summary.gohtml b/templates/summary.gohtml index ca8087e..2eee432 100644 --- a/templates/summary.gohtml +++ b/templates/summary.gohtml @@ -7,7 +7,7 @@ {{ end }} - {{ include "postmeta" . }} + {{ include "summarymeta" . }}

{{ summary .Data }}

{{ if (hasp .Data "images") }}🖼️ {{ end }}{{ string .Blog.Lang "view" }}

diff --git a/templates/summaryandpostmeta.gohtml b/templates/summaryandpostmeta.gohtml new file mode 100644 index 0000000..fca6d5c --- /dev/null +++ b/templates/summaryandpostmeta.gohtml @@ -0,0 +1,11 @@ +{{ define "summaryandpostmeta" }} + {{ $section := (index .Blog.Sections .Data.Section) }} + {{ if .Data.Published }}
{{ string .Blog.Lang "publishedon" }} {{ if $section }} in {{ $section.Title }}{{ end }}
{{ end }} + {{ if .Data.Updated }}
{{ string .Blog.Lang "updatedon" }}
{{ end }} + {{ if p .Data "replylink" }} +
{{ string .Blog.Lang "replyto" }}: {{ p .Data "replytitle" | default (p .Data "replylink") }}
+ {{ end }} + {{ if p .Data "likelink" }} +
{{ string .Blog.Lang "likeof" }}: {{ p .Data "liketitle" | default (p .Data "likelink") }}
+ {{ end }} +{{ end }} \ No newline at end of file diff --git a/templates/summarymeta.gohtml b/templates/summarymeta.gohtml new file mode 100644 index 0000000..30f91c9 --- /dev/null +++ b/templates/summarymeta.gohtml @@ -0,0 +1,5 @@ +{{ define "summarymeta" }} +
+ {{ include "summaryandpostmeta" . }} +
+{{ end }} \ No newline at end of file