From 2c951590bce77f987b14efe59647f3e48a7dd435 Mon Sep 17 00:00:00 2001 From: Salim B Date: Fri, 8 Nov 2019 16:59:44 +0100 Subject: localize 404 page; allow Markdown at more places; clickable feature icons (#184) * allow Markdown in clients (sub)title * localize 404 page * add Markdown support for recent posts title * allow Markdown in see_more section strings * allow Markdown in features names * make feature icons clickable (hyperlinks) * allow Markdown in credits strings; better bootstrapious link * make see_more section more flexible: avoid Hugo error(s) when `params.see_more.link_url` or `params.see_more.link_text` aren't defined * rename `link` key into `url` to be consistent: - since in the client YAML files the respective key is names `url`, I guess I should stick to that. - besides I've removed the one `#` I've specified as the URL in `data/features/webdesign.yaml`; originally that was intended as a "visual" hint that now it is easily possible to make the features clickable. but I guess that's not really necessary, if not even irritating. * layouts: remove double logo from 404 the changes in this commit are identical with timmn's commit 33ad328776eeb90f6d6793f7036fcb3338fb5155 * rename string to * translate remaining Catalan 404 strings * improve documentation of feature YAML files --- README.md | 17 +++++++++++++---- exampleSite/data/features/consulting.yaml | 1 + exampleSite/data/features/email.yaml | 1 + exampleSite/data/features/print.yaml | 1 + exampleSite/data/features/seo.yaml | 1 + exampleSite/data/features/uiux.yaml | 1 + exampleSite/data/features/webdesign.yaml | 1 + i18n/ca.yaml | 9 +++++++++ i18n/de.yaml | 9 +++++++++ i18n/en.yaml | 9 +++++++++ i18n/es.yaml | 9 +++++++++ i18n/fr.yaml | 9 +++++++++ i18n/id.yaml | 9 +++++++++ i18n/it.yaml | 9 +++++++++ i18n/ja.yaml | 9 +++++++++ i18n/nl.yaml | 9 +++++++++ i18n/pt-br.yaml | 9 +++++++++ i18n/ru.yaml | 9 +++++++++ i18n/sv.yaml | 9 +++++++++ i18n/zh.yaml | 9 +++++++++ layouts/404.html | 12 +++--------- layouts/partials/clients.html | 4 ++-- layouts/partials/features.html | 30 ++++++++++++++++++------------ layouts/partials/footer.html | 4 ++-- layouts/partials/recent_posts.html | 2 +- layouts/partials/see_more.html | 15 +++++++++++---- 26 files changed, 173 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 148eb78..3d1d5b1 100644 --- a/README.md +++ b/README.md @@ -261,7 +261,7 @@ Once the carousel is configured, it must be explicitly enabled in the `config.to #### Features -Features are also defined in the `data` directory just like the carousel. +Features are also defined in the `data` directory just like the carousel: ``` data @@ -274,16 +274,25 @@ data    └── webdesign.yaml ``` -A feature file looks like this. +The content of the `consulting.yaml` example feature file looks like this: ```yaml weight: 4 name: "Consulting" -icon: "fas fa-lightbulb-o" +icon: "fas fa-lightbulb" +url: "" description: "Fifth abundantly made Give sixth hath. Cattle creature i be don't them behold green moved fowl Moved life us beast good yielding. Have bring." ``` -The `icon` field is the CSS class of an icon. In this example we have used icons powered by [FontAwesome](http://fontawesome.io/icons/). +The meaning of the individual YAML keys is as follows: + +| Key | Description | +| --- | ----------- | +| `weight` | A means to set the order of multiple features; features with a lower `weight` are displayed first (left to right, top to bottom) | +| `name` | The title text below the feature icon; Markdown is supported | +| `icon` | The CSS class of the feature icon; in this example we have used icons powered by [FontAwesome](http://fontawesome.io/icons/) | +| `url` | An optional URL the feature icon should point to; if specified, the icon will become a clickable hyperlink | +| `description` | A short text below the title text to describe the feature; Markdown is supported | Once you have completed your features, enable them in the `config.toml` file. diff --git a/exampleSite/data/features/consulting.yaml b/exampleSite/data/features/consulting.yaml index cece32f..4284222 100644 --- a/exampleSite/data/features/consulting.yaml +++ b/exampleSite/data/features/consulting.yaml @@ -1,4 +1,5 @@ weight: 4 name: "Consulting" icon: "fas fa-lightbulb" +url: "" description: "Fifth abundantly made Give sixth hath. Cattle creature i be don't them behold green moved fowl Moved life us beast good yielding. Have bring." diff --git a/exampleSite/data/features/email.yaml b/exampleSite/data/features/email.yaml index bb55f37..42c6499 100644 --- a/exampleSite/data/features/email.yaml +++ b/exampleSite/data/features/email.yaml @@ -1,4 +1,5 @@ weight: 5 name: "Email Marketing" icon: "far fa-envelope" +url: "" description: "Advantage old had otherwise sincerity dependent additions. It in adapted natural hastily is justice. Six draw you him full not mean evil." diff --git a/exampleSite/data/features/print.yaml b/exampleSite/data/features/print.yaml index 842c6f4..6362fa3 100644 --- a/exampleSite/data/features/print.yaml +++ b/exampleSite/data/features/print.yaml @@ -1,4 +1,5 @@ weight: 2 name: "Print" icon: "fas fa-print" +url: "" description: "Advantage old had otherwise sincerity dependent additions. It in adapted natural hastily is justice. Six draw you him full not mean evil." diff --git a/exampleSite/data/features/seo.yaml b/exampleSite/data/features/seo.yaml index 924a7f0..29af3d3 100644 --- a/exampleSite/data/features/seo.yaml +++ b/exampleSite/data/features/seo.yaml @@ -1,4 +1,5 @@ weight: 3 name: "SEO and SEM" icon: "fas fa-globe" +url: "" description: "Am terminated it excellence invitation projection as. She graceful shy believed distance use nay. Lively is people so basket ladies window expect." diff --git a/exampleSite/data/features/uiux.yaml b/exampleSite/data/features/uiux.yaml index fd40682..0533859 100644 --- a/exampleSite/data/features/uiux.yaml +++ b/exampleSite/data/features/uiux.yaml @@ -1,4 +1,5 @@ weight: 6 name: "UI/UX" icon: "fas fa-user" +url: "" description: "Am terminated it excellence invitation projection as. She graceful shy believed distance use nay. Lively is people so basket ladies window expect." diff --git a/exampleSite/data/features/webdesign.yaml b/exampleSite/data/features/webdesign.yaml index 0ec993d..0731ce8 100644 --- a/exampleSite/data/features/webdesign.yaml +++ b/exampleSite/data/features/webdesign.yaml @@ -1,4 +1,5 @@ weight: 1 name: "Webdesign" icon: "fas fa-desktop" +url: "" description: "Fifth abundantly made Give sixth hath. Cattle creature i be don't them behold green moved fowl Moved life us beast good yielding. Have bring." diff --git a/i18n/ca.yaml b/i18n/ca.yaml index 560acf2..5ca1b22 100644 --- a/i18n/ca.yaml +++ b/i18n/ca.yaml @@ -69,3 +69,12 @@ - id: publishedOn translation: "el" + +- id: 404Error + translation: "Error 404: Pàgina no trobada" + +- id: 404Message + translation: "Ho sentim – aquesta pàgina no es pot trobar en aquest lloc" + +- id: 404NavHome + translation: "Anar a l'inici" diff --git a/i18n/de.yaml b/i18n/de.yaml index 055a749..46c08d2 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -69,3 +69,12 @@ - id: publishedOn translation: "am" + +- id: 404Error + translation: "Fehler 404: Seite nicht gefunden" + +- id: 404Message + translation: "Tut uns leid – diese Seite scheint nicht mehr hier zu sein" + +- id: 404NavHome + translation: "Zur Startseite gehen" diff --git a/i18n/en.yaml b/i18n/en.yaml index 431fd47..56a34de 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -69,3 +69,12 @@ - id: publishedOn translation: "on" + +- id: 404Error + translation: "Error 404: Page not found" + +- id: 404Message + translation: "We are sorry – this page is not here anymore" + +- id: 404NavHome + translation: "Go to homepage" diff --git a/i18n/es.yaml b/i18n/es.yaml index 19097b9..5d41707 100644 --- a/i18n/es.yaml +++ b/i18n/es.yaml @@ -69,3 +69,12 @@ - id: publishedOn translation: "el" + +- id: 404Error + translation: "Error 404: Página no encontrada" + +- id: 404Message + translation: "Lo sentimos – esta página ya no está aquí" + +- id: 404NavHome + translation: "Ir a la página de inicio" diff --git a/i18n/fr.yaml b/i18n/fr.yaml index 4ad7fe1..6512b74 100644 --- a/i18n/fr.yaml +++ b/i18n/fr.yaml @@ -69,3 +69,12 @@ - id: publishedOn translation: "le" + +- id: 404Error + translation: "Erreur 404: Page introuvable" + +- id: 404Message + translation: "Nous sommes désolés – cette page n'est plus là" + +- id: 404NavHome + translation: "Aller à l'accueil" diff --git a/i18n/id.yaml b/i18n/id.yaml index 48472b3..d6c81a7 100644 --- a/i18n/id.yaml +++ b/i18n/id.yaml @@ -69,3 +69,12 @@ - id: publishedOn translation: "pada" + +- id: 404Error + translation: "Error 404: Page not found" + +- id: 404Message + translation: "We are sorry – this page is not here anymore" + +- id: 404NavHome + translation: "Ke laman utama" diff --git a/i18n/it.yaml b/i18n/it.yaml index 53b06ca..f302b3e 100644 --- a/i18n/it.yaml +++ b/i18n/it.yaml @@ -69,3 +69,12 @@ - id: publishedOn translation: "il" + +- id: 404Error + translation: "Errore 404: Pagina non trovata" + +- id: 404Message + translation: "Siamo spiacenti – questa pagina non è più qui" + +- id: 404NavHome + translation: "Vai alla homepage" diff --git a/i18n/ja.yaml b/i18n/ja.yaml index 9135dd9..33c4581 100644 --- a/i18n/ja.yaml +++ b/i18n/ja.yaml @@ -69,3 +69,12 @@ - id: publishedOn translation: "日付" + +- id: 404Error + translation: "Error 404: Page not found" + +- id: 404Message + translation: "We are sorry – this page is not here anymore" + +- id: 404NavHome + translation: "ホームへ戻る" diff --git a/i18n/nl.yaml b/i18n/nl.yaml index 440c4b2..68a0477 100644 --- a/i18n/nl.yaml +++ b/i18n/nl.yaml @@ -69,3 +69,12 @@ - id: publishedOn translation: "op" + +- id: 404Error + translation: "Fout 404: Pagina niet gevonden" + +- id: 404Message + translation: "Het spijt ons – deze pagina is er niet meer" + +- id: 404NavHome + translation: "Ga naar de homepage" diff --git a/i18n/pt-br.yaml b/i18n/pt-br.yaml index 70ae5b1..81fb55e 100644 --- a/i18n/pt-br.yaml +++ b/i18n/pt-br.yaml @@ -69,3 +69,12 @@ - id: publishedOn translation: "em" + +- id: 404Error + translation: "Error 404: Page not found" + +- id: 404Message + translation: "We are sorry – this page is not here anymore" + +- id: 404NavHome + translation: "Vá à página inicial" diff --git a/i18n/ru.yaml b/i18n/ru.yaml index 3bb4174..7456f7e 100644 --- a/i18n/ru.yaml +++ b/i18n/ru.yaml @@ -69,3 +69,12 @@ - id: publishedOn translation: "на" + +- id: 404Error + translation: "Error 404: Page not found" + +- id: 404Message + translation: "We are sorry – this page is not here anymore" + +- id: 404NavHome + translation: "Перейти на главную" diff --git a/i18n/sv.yaml b/i18n/sv.yaml index 0d0797e..ab17a84 100644 --- a/i18n/sv.yaml +++ b/i18n/sv.yaml @@ -69,3 +69,12 @@ - id: publishedOn translation: "på" + +- id: 404Error + translation: "Error 404: Page not found" + +- id: 404Message + translation: "We are sorry – this page is not here anymore" + +- id: 404NavHome + translation: "Gå till startsidan" diff --git a/i18n/zh.yaml b/i18n/zh.yaml index d8cd564..64545b9 100644 --- a/i18n/zh.yaml +++ b/i18n/zh.yaml @@ -69,3 +69,12 @@ - id: publishedOn translation: "在" + +- id: 404Error + translation: "Error 404: Page not found" + +- id: 404Message + translation: "We are sorry – this page is not here anymore" + +- id: 404NavHome + translation: "跳到主页" diff --git a/layouts/404.html b/layouts/404.html index c4bab21..5f9be21 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -20,16 +20,10 @@
-

- - {{ .Title }} logo - -

- -

We are sorry - this page is not here anymore

-

Error 404 - Page not found

+

{{ i18n "404Message" | markdownify }}

+

{{ i18n "404Error" | markdownify }}

-

Go to Homepage +

{{ i18n "404NavHome" | markdownify }}

diff --git a/layouts/partials/clients.html b/layouts/partials/clients.html index a012367..fd68aeb 100644 --- a/layouts/partials/clients.html +++ b/layouts/partials/clients.html @@ -6,11 +6,11 @@
-

{{ .Site.Params.clients.title }}

+

{{ .Site.Params.clients.title | markdownify }}

- {{ .Site.Params.clients.subtitle }} + {{ .Site.Params.clients.subtitle | markdownify }}

diff --git a/layouts/partials/recent_posts.html b/layouts/partials/recent_posts.html index c46f959..2e4eba2 100644 --- a/layouts/partials/recent_posts.html +++ b/layouts/partials/recent_posts.html @@ -5,7 +5,7 @@
-

{{ .Site.Params.recent_posts.title }}

+

{{ .Site.Params.recent_posts.title | markdownify }}

diff --git a/layouts/partials/see_more.html b/layouts/partials/see_more.html index 08301c1..437d9d8 100644 --- a/layouts/partials/see_more.html +++ b/layouts/partials/see_more.html @@ -7,13 +7,20 @@

-

{{ .Site.Params.see_more.title }}

-

{{ .Site.Params.see_more.subtitle }}

+

{{ .Site.Params.see_more.title | markdownify }}

+

{{ .Site.Params.see_more.subtitle | markdownify }}

- {{ .Site.Params.see_more.link_text }} + {{ with .Site.Params.see_more.link_url }} + + {{ end }} + {{ with .Site.Params.see_more.link_text }} + {{ . | markdownify }} + {{ end }} + {{ with .Site.Params.see_more.link_url }} + + {{ end }}

-
-- cgit v1.2.3