From c46af0efbdd7845c2bb953033bbd790c64f4a683 Mon Sep 17 00:00:00 2001 From: Martijn Staal <27222398+mastaal@users.noreply.github.com> Date: Thu, 6 Jul 2023 20:03:45 +0200 Subject: [PATCH 1/2] Add Dutch translation --- README.md | 2 +- exampleSite/config.toml | 12 +++++++-- i18n/nl.toml | 56 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 i18n/nl.toml diff --git a/README.md b/README.md index d0f80de..ead3026 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ hugo server Your website is running :smile:, you can start editing content files. ### Multilingual -Pico currently ships with support for 5 languages (fr, en, it, es, de). Contributions for other language translations are welcome. +Pico currently ships with support for 6 languages (fr, en, it, es, de, nl). Contributions for other language translations are welcome. To create a new language translation, add the .toml file to the i18n/ folder. See the existing files for the necessary fields. See the [hugo documentation](https://gohugo.io/content-management/multilingual/) for more details. diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 7e033f5..808b7fb 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -106,8 +106,9 @@ category = "categories" tag = "tags" # Translation -# English, French and Italian are supported but you can contribute -# by adding translation to i18n/ folder. +# The following langauges are supported: English, French, Italian, +# Spanish, German and Dutch. You can contribute by adding translation to +# the i18n/ folder. [languages.en] contentDir = 'content/en' languageCode = 'en' @@ -140,3 +141,10 @@ weight = 2 # languageCode = 'de' # languageName = 'Deutsch' # weight = 5 + +# Uncomment the following lines to add a Dutch translation. +#[languages.nl] +#contentDir = 'content/nl' +#languageCode = 'nl' +#languageName = 'Nederlands' +#weight = 6 diff --git a/i18n/nl.toml b/i18n/nl.toml new file mode 100644 index 0000000..d74c8f2 --- /dev/null +++ b/i18n/nl.toml @@ -0,0 +1,56 @@ +[tagged_in] +other = "Getagged in" + +[other_tags] +other = "Andere tags" + +[read_more] +other = "Verder lezen" + +[name] +other = "Naam" + +[your_message] +other = "Je bericht" + +[cancel] +other = "Annuleren" + +[submit] +other = "Versturen" + +[previous] +other = "Vorige" + +[next] +other = "Volgende" + +[back] +other = "Terug" + +[contact] +other = "Contact" + +[contact_email] +other = "Contact via email" + +[latest_post] +other = "Recentste post" + +[reading_time] +other = "{{ .ReadingTime }} minuten leestijd" + +[home] +other = "Hoofdpagina" + +[about] +other = "Over" + +[blog] +other = "Blog" + +[present] +other = "Huidig" + +[required_fields] +other = "Verplichte velden" From 23eb3f0c63d8f3d649b5684d928a1c85f4ecb46e Mon Sep 17 00:00:00 2001 From: Martijn Staal <27222398+mastaal@users.noreply.github.com> Date: Fri, 7 Jul 2023 11:52:48 +0200 Subject: [PATCH 2/2] Add initial cards widget It is basically the timeline widget with the timeline removed. --- exampleSite/content/en/home/cards.md | 22 +++++++++++++ layouts/partials/widgets/cards.html | 49 ++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 exampleSite/content/en/home/cards.md create mode 100644 layouts/partials/widgets/cards.html diff --git a/exampleSite/content/en/home/cards.md b/exampleSite/content/en/home/cards.md new file mode 100644 index 0000000..9f76c50 --- /dev/null +++ b/exampleSite/content/en/home/cards.md @@ -0,0 +1,22 @@ ++++ +widget = "cards" +weight = 15 # Order that this section will appear. + +# Uncomment the following line and widget will NOT be displayed +# hidden = true + +# Widget title +title = "Recommendations" +# Widget subtitle +#subtitle = "What lead me to acquire experience." + +date_format = "Jan 2006" # Date format https://gohugo.io/functions/dateformat/#readout + +[[card]] + title = "*Some quote*" + subtitle = "John Doe" + +[[card]] + title = "*Another recommendational quote*" + subtitle = "Jane Doe" ++++ diff --git a/layouts/partials/widgets/cards.html b/layouts/partials/widgets/cards.html new file mode 100644 index 0000000..8cb68bf --- /dev/null +++ b/layouts/partials/widgets/cards.html @@ -0,0 +1,49 @@ +{{ $dateFormat := .Params.date_format | default "02.01.2006" }} + +
+
+

+ {{ .Title }} +

+ {{ with .Params.subtitle}} +

{{ . }}

+ {{ end }} +
+ +
+ {{/* Timeline bar */}} +
+ {{ range $index, $card := .Params.card }} + {{ $even := modBool $index 2 }} + + {{ $containerClass := "md:mr-auto pl-4 md:pl-0 md:pr-4"}} + {{ $dateClass := "md:text-right font-light text-primary text-xl" }} + + {{ if $even }} + {{ $containerClass = "md:ml-auto pl-4"}} + {{ $dateClass = "font-light text-primary text-xl" }} + {{ end }} + +
+
+

{{ .title | markdownify }}

+ + {{ with .location }} + · {{ . }} + {{ end }} + +

{{ .subtitle | markdownify }}

+ + {{ with .description }} +
+

{{ . | markdownify }}

+
+ {{ end }} +
+
+ + {{ end }} +
+
+
\ No newline at end of file