diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index b0505cc..0d45936 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -10,9 +10,15 @@ and this project adheres to https://semver.org/spec/v2.0.0.html[Semantic Version == [Unreleased] +=== Changed + +* Fix relative links for multilingual mode. -== [1.1.1] - 2020-05-12 + + +== [1.2.0] - 2020-05-12 + === Added @@ -67,6 +73,7 @@ The page config has more priority and can override the site config. === Added + * Create the base layout. * Add the Asciidoctor content template. * Create the template for RSS, Atom, and JSON web syndication feeds. diff --git a/README.md b/README.md index 63a080d..30ce692 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,15 @@ All it needs is the `title` field from your site config. + +## Demo + +There's a demo available at the `demo` branch with the live version at https://foo-dogsquared.github.io/hugo-theme-contentful/. +It features a multilingual site with the default settings. + + + + ## Feature list The quickest way to describe Contentful in one go is a list. @@ -169,7 +178,12 @@ It could be handy for guest posts and co-authored papers with others. You can have web syndication formats like RSS and Atom by setting [custom output formats](https://gohugo.io/templates/output-formats) to your site configurations. The theme mainly supports output feeds for the homepage and site sections. -I should point out that the web feeds prints the whole and links. +I should point out that the web feeds prints the whole content instead of summaries. + +Also, they all rely on an icon to be placed in `icon.png`. +For more accurate control regarding the icon paths, you can copy the templates (at `theme/contentful/layouts/_default/list.{rss,atom,json}`) to your own layout folder. +I've conveniently placed some key phrases to easily find them. +Just search for the phrase `ICON, AHOY!` and the icon is usually below it then make your desired changes. Here is an example configuration on enabling all of them. diff --git a/i18n/en.toml b/i18n/en.toml index 9e9a97e..4702756 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -28,7 +28,7 @@ other = "Translations" # General [and] -other = "And" +other = "and" [back_to_home] other = "Back to home" diff --git a/layouts/_default/list.atom b/layouts/_default/list.atom index 3712aef..60eb6bd 100644 --- a/layouts/_default/list.atom +++ b/layouts/_default/list.atom @@ -7,8 +7,12 @@ {{- printf "" .Rel .MediaType .Permalink | safeHTML }} {{- end }} {{ with .Site.Copyright }}{{ . }}{{ else }}© {{ now.Year }} {{ with .Site.Author.name }}{{ . }}{{ end }}{{ end }} - Hugo -- gohugo.io + Hugo {{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }} + {{ "" | absLangURL }} + + {{- /* ICON, AHOY! */ -}} + {{ "icon.png" | absURL }} {{ with .Site.Author }} @@ -16,15 +20,14 @@ {{ with .email }}{{ . }}{{ end }} {{ end }} - {{ .Permalink }} {{- /* Generate each valid regular pages (with as an individual entry in the feed. */ -}} {{ $limit := cond (gt .Site.Params.feedLimit 0) .Site.Params.feedLimit 10 }} -{{ $pages := .Pages }} -{{ if .IsHome }} -{{ $pages = where $.Site.RegularPages "Type" "in" $.Site.Params.mainSections }} -{{ end }} -{{ range first $limit (where $pages "Params.hidden" "!=" true) }} + {{ $pages := .Pages }} + {{ if .IsHome }} + {{ $pages = where $.Site.RegularPages "Type" "in" $.Site.Params.mainSections }} + {{ end }} + {{ range first $limit (where $pages "Params.hidden" "!=" true) }} {{ .Permalink }} {{ .Title }} diff --git a/layouts/_default/list.json b/layouts/_default/list.json index eb36c4c..693ed21 100644 --- a/layouts/_default/list.json +++ b/layouts/_default/list.json @@ -1,11 +1,13 @@ { "version": "https://jsonfeed.org/version/1", "title": "{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}", - "home_page_url": "{{ .Site.BaseURL }}", + "home_page_url": "{{ "" | absLangURL }}", "feed_url": "{{ with .OutputFormats.Get "json" }}{{ .Permalink }}{{ end }}", "description": "Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}", - "favicon": "{{ "assets/icon.png" | absURL }}", - "icon": "{{ "assets/icon.png" | absURL }}", + {{- /* ICON, AHOY! */ -}} + "favicon": "{{ "icon.png" | absURL }}", + "icon": "{{ "icon.png" | absURL }}", + {{- with .Site.Author }} "author": { "name": "{{ .name }}" diff --git a/layouts/_default/list.rss b/layouts/_default/list.rss index 82c665d..71b7855 100644 --- a/layouts/_default/list.rss +++ b/layouts/_default/list.rss @@ -14,6 +14,8 @@ The template does miss out on certain things which I put it on a list for those {{ .Permalink }} Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} Hugo -- gohugo.io + {{- /* ICON, AHOY! */ -}} + {{ "icon.png" | absURL }} {{ with .Site.LanguageCode }} {{.}} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 5ad5a56..2867cd6 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -8,7 +8,7 @@ {{- with .Params.author }} {{- $names := slice }} {{- range . }}{{ $names = $names | append .name }}{{ end }} -

{{ i18n "published_by" }}: {{ delimit $names ", " ", and " }}

+

{{ i18n "published_by" }}: {{ delimit $names ", " (printf ", %s " (i18n "and")) }}

{{- end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index a10ccb3..34c4746 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,7 +1,7 @@
diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 6025ad2..7d8bed8 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,9 +1,9 @@