Compare commits

..

28 Commits

Author SHA1 Message Date
Mark Dumay
a0fb57d7d3 Merge pull request #92 from markdumay/develop
Fix spacing of blog captions #87
2022-12-12 07:04:03 +01:00
mark
c6c686ec65 Fix spacing of blog captions #87 2022-12-12 07:01:13 +01:00
Mark Dumay
48f967ad92 Merge pull request #91 from markdumay/develop
Bump package version
2022-12-12 06:54:53 +01:00
mark
ba3af4f031 Bump package version 2022-12-12 06:52:14 +01:00
Mark Dumay
70a175bdaa Merge pull request #89 from dgrammlich/enhance-i18n-labels
Translate pagination buttons
2022-12-12 06:47:03 +01:00
Daniela Grammlich
fdc0750f13 Translate first and last button of pagination 2022-12-12 00:20:21 +01:00
Daniela Grammlich
43db7912d0 Provide translations for aria-label 2022-12-12 00:19:35 +01:00
Daniela Grammlich
5a4f0dc14d Merge branch 'markdumay:main' into enhance-i18n-labels 2022-12-12 00:07:19 +01:00
Daniela Grammlich
c93b62817e Use proper Dutch translation for pagination 2022-12-11 19:32:39 +01:00
Mark Dumay
3a6ab9df76 Merge pull request #88 from dgrammlich/german-language-support
Add German translation
2022-12-11 19:07:32 +01:00
Daniela Grammlich
ad5989d80f Provide labels for pagination 2022-12-11 19:02:38 +01:00
Daniela Grammlich
0b9eadffb6 Translate pagination buttons 2022-12-11 18:56:55 +01:00
Daniela Grammlich
9963b746b1 Add German translation 2022-12-11 18:22:39 +01:00
Mark Dumay
836ef99122 Merge pull request #85 from markdumay/develop
Configurable font
2022-12-10 07:23:26 +01:00
mark
156b444582 Bump package version 2022-12-10 07:20:58 +01:00
mark
aa27ab0f2c Make default font configurable 2022-12-10 07:18:56 +01:00
Mark Dumay
76e0040505 Merge pull request #84 from markdumay/develop
Develop
2022-12-09 19:33:19 +01:00
mark
d3baf1a86a Upgrade version 2022-12-09 19:30:22 +01:00
mark
681bf636dc Fix #83 2022-12-09 19:29:14 +01:00
mark
607b5e3fec Align shortcode tag 2022-12-09 18:49:20 +01:00
Mark Dumay
5f4192a639 Merge pull request #82 from markdumay/develop
Develop
2022-12-09 07:40:25 +01:00
mark
220cd05f6d Bump package version 2022-12-09 07:34:46 +01:00
mark
3cfc732dff Update ratio behavior 2022-12-09 07:33:35 +01:00
mark
f04b37e0d3 Update ratio behavior 2022-12-09 07:31:51 +01:00
mark
05274cef64 Fix resizing of images 2022-12-09 07:30:43 +01:00
Mark Dumay
8f5ac20310 Merge pull request #81 from markdumay/develop
Develop
2022-12-09 06:50:59 +01:00
mark
db65425c06 Bump package version 2022-12-09 06:48:30 +01:00
mark
e475460a48 Remove default ratio 2022-12-09 06:48:19 +01:00
20 changed files with 184 additions and 42 deletions

View File

@@ -110,7 +110,7 @@ The main site configuration is available in `./config/_default`. Some remarks:
- **Menu items** - `menus/menus.en.toml` contains language-specific items for the navigation bar and social media links for the home page's footer.
- **Content** - Ensure the `mainSections` in `config.toml` is synchronized with the `content` folder, default values are `["blog", "projects"]`.
- **Theme color** - Update `themeColor` and `themeOpacity` within the `[style]` section of `params.toml` to update the site's primary color and opacity. You can use the [WCAG Color Contrast Checker][contrast_checker] to validate the contrast ratio of your color to improve accessibility.
- **Theme style** - Update `themeColor` and `themeOpacity` within the `[style]` section of `params.toml` to update the site's primary color and opacity. You can use the [WCAG Color Contrast Checker][contrast_checker] to validate the contrast ratio of your color to improve accessibility. Additionally, set `themeFont` and `themeFontPath` to override the default font.
- **Comments** - Comments are powered by [utterances][utterances], a lightweight comments widget built on GitHub issues. Update the `repo` of the `[comments]` section of `params.toml`.
- **Security policy** - The theme uses rather strict security policies by default. Be sure to include references to external sources in the header configuration to avoid broken links. The settings of the local development server are defined in `server.toml`. Similar settings are defined in the `netlify.toml` file provided in the repository's root when deploying to [Netlify][netlify].

View File

@@ -1,5 +1,6 @@
// Define template variables
$themeColor: {{ site.Params.style.themeColor | default "#007bff" }};
$themeFont: {{ site.Params.style.themeFont | default "Inter" }};
$carousel-control-prev-icon-bg: url("/img/carousel_prev.svg") !default;
$carousel-control-next-icon-bg: url("/img/carousel_next.svg") !default;

View File

@@ -8,7 +8,7 @@ $fa-font-path: "../fonts";
// Remove the border from the focused navigation toggler
$navbar-toggler-focus-width: 0 !default;
$font-family-sans-serif: "Inter", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default;
$font-family-sans-serif: $themeFont, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default;
$headings-font-weight: 600 !default;
$font-weight-lighter: lighter !default;
$font-weight-light: 200 !default;

View File

@@ -46,6 +46,8 @@ schemaSection = "blog"
[style]
themeColor = "#D43900" #00b0f0
themeOpacity = "10"
themeFont = "Inter"
themeFontPath = "https://fonts.googleapis.com/css2?family=Inter:wght@200;300;600&display=swap"
[main]
featurePhoto = "/img/sunrise.jpg" # source: https://unsplash.com/photos/ZX6BPboJrYk

View File

@@ -187,7 +187,7 @@ Use the `image` shortcode to display a responsive image with a specific aspect r
| Argument | Required | Description |
|-----------|----------|-------------|
| src | Yes | Required url of the image, e.g. "img/boots.jpg" or "https://picsum.photos/id/27/3264/1836". |
| ratio | No | Optional aspect ratio of the image, either "1x1", "4x3", "16x9", or "21x9". It not specified the original aspect ratio of the image is preserved. |
| ratio | No | Optional aspect ratio of the image, either "1x1", "4x3", "16x9", or "21x9". If set, the image is resized and cropped to match the ratio. Else the original aspect ratio of the image is kept. |
| class | No | Optional class attribute of the inner `img` element, e.g. "rounded". |
| title | No | Optional alternate text of the image. |
| caption | No | Optional figure caption. |

View File

@@ -3,7 +3,7 @@ author: "Hugo Authors"
title: "Rich Content"
date: 2021-07-13
description: "A brief description of Hugo Shortcodes"
tags: ["shortcodes", "privacy"]
tags: ["shortcode", "privacy"]
thumbnail: img/flowers.jpg # https://picsum.photos/id/106/2592/1728
photoCredits: <a href="https://unsplash.com/@flutterhappy">Arvee Marie</a>
photoSource: <a href="https://unsplash.com/photos/YnfGtpt2gf4">Unsplash</a>

View File

@@ -188,7 +188,7 @@ Gebruik de `image` shortcode om een adaptief plaatje met een specifieke verhoudi
| Parameter | Verplicht | Toelichting |
|-----------|----------|-------------|
| src | Ja | Verplichte url van het plaatje, bijvoorbeeld "img/boots.jpg" of "https://picsum.photos/id/27/3264/1836". |
| ratio | Nee | Verhouding van het plaatje, de mogelijke waarden zijn "1x1", "4x3", "16x9", en "21x9". Als de verhouding niet is opgegeven dan wordt de verhouding van het originele bestand gebruikt. |
| ratio | Nee | Verhouding van het plaatje, de mogelijke waarden zijn "1x1", "4x3", "16x9", en "21x9". Indien opgegeven wordt het plaatje bijgesneden en verkleind om te voldoen aan de ratio. Als de verhouding niet is opgegeven dan wordt de verhouding van het originele bestand gebruikt. |
| class | Nee | Optionele `class` waarde van het `img` element, bijvoorbeeld "rounded". |
| title | Nee | Optionele beschrijving van het plaatje. |
| caption | Nee | Optioneel onderschrift van het plaatje. |

View File

@@ -4,7 +4,7 @@ slug: "multimedia"
title: "Multimedia"
date: 2021-07-13
description: "Een overzicht van enkele Hugo Shortcodes"
tags: ["shortcodes", "privacy"]
tags: ["shortcode", "privacy"]
thumbnail: img/flowers.jpg # https://picsum.photos/id/106/2592/1728
photoCredits: <a href="https://unsplash.com/@flutterhappy">Arvee Marie</a>
photoSource: <a href="https://unsplash.com/photos/YnfGtpt2gf4">Unsplash</a>

108
i18n/de.yaml Normal file
View File

@@ -0,0 +1,108 @@
# Content
- id: postedOnDate
translation: "Veröffentlicht am {{ . }}"
- id: lastModified
translation: "(Zuletzt verändert am {{ . }})"
- id: translationsLabel
translation: "Andere Sprachen: "
- id: translationsSeparator
translation: ", "
- id: readMore
translation: "Weiterlesen"
- id: morePosts
translation: "Weitere Beiträge"
- id: olderPosts
translation: "Ältere Beiträge"
- id: recentPosts
translation: "Aktuelle Beiträge"
- id: newerPosts
translation: "Neuere Beiträge"
- id: previousPost
translation: "Vorheriger Beitrag"
- id: nextPost
translation: "Nächster Beitrag"
- id: read
translation: "Lesezeit"
- id: minutesShort
translation: "Min."
- id: words
translation: "Wörter"
- id: copyright
translation: "Copyright"
- id: photoBy
translation: "Foto von"
- id: photoOn
translation: "auf"
- id: article
translation: "Artikel"
- id: articles
translation: "Artikel"
- id: paginationPrevious
translation: "Vorherige"
- id: paginationNext
translation: "Nächste"
- id: paginationFirst
translation: "Erste"
- id: paginationLast
translation: "Letzte"
# 404 page
- id: pageNotFound
translation: "Ups! Diese Seite existiert nicht. Versuche es über die"
- id: pageNotFoundTitle
translation: "Nicht gefunden"
- id: pageNotFoundHome
translation: "Startseite"
# Navigation
- id: toggleNavigation
translation: "Navigation umschalten"
- id: languageSwitcherLabel
translation: "Sprache"
- id: gcseLabelShort
translation: "Suche"
- id: gcseLabelLong
translation: "Suche {{ .Site.Title }}"
- id: gcseClose
translation: "Schließen"
# Staticman
- id: noComment
translation: "Kein Kommentar"
- id: oneComment
translation: "Kommentar"
- id: moreComment
translation: "Kommentare"
- id: useMarkdown
translation: "Du kannst Markdown-Syntax benutzen"
- id: yourName
translation: "Dein Name"
- id: yourEmail
translation: "Deine E-Mail-Adresse"
- id: yourWebsite
translation: "Deine Webseite"
# Delayed Disqus
- id: show
translation: "Zeige"
- id: comments
translation: "Kommentare"
# Related posts
- id: seeAlso
translation: "Siehe auch"
# Table of contents
- id: toc
translation: "Auf dieser Seite"
# Search
- id: ui_search
translation: "Durchsuche diese Seite..."
- id: ui_no_results
translation: "Keine Ergebnisse für"
# Draft
- id: draft
translation: "Entwurf"

View File

@@ -37,7 +37,14 @@
translation: "Article"
- id: articles
translation: "Articles"
- id: paginationPrevious
translation: "Previous"
- id: paginationNext
translation: "Next"
- id: paginationFirst
translation: "First"
- id: paginationLast
translation: "Last"
# 404 page
- id: pageNotFound

View File

@@ -37,7 +37,14 @@
translation: "Artikel"
- id: articles
translation: "Artikelen"
- id: paginationPrevious
translation: "Vorige"
- id: paginationNext
translation: "Volgende"
- id: paginationFirst
translation: "Eerste"
- id: paginationLast
translation: "Laatste"
# 404 page
- id: pageNotFound

View File

@@ -8,10 +8,10 @@
<p class="card-text">
<small class="text-muted text-uppercase">
{{- partial "utilities/date.html" (dict "date" .Date "format" "long") -}}
&bull; {{ .ReadingTime }}&nbsp;{{ i18n "minutesShort" }} {{ i18n "read" }}
&nbsp;&bull; {{ .ReadingTime }} {{ i18n "minutesShort" }} {{ i18n "read" }}
{{ if isset .Params "tags" -}}
{{ range first 1 .Params.tags -}}
&bull; <a href="{{ $.Site.BaseURL }}tags/{{ . | urlize }}" class="text-decoration-none text-primary" aria-label="Tag: {{ . }}">{{ . }}</a>
{{ range first 1 (.GetTerms "tags") -}}
&bull; <a href="{{ (path.Join .Page.RelPermalink) | relURL }}" class="text-decoration-none text-primary" aria-label="Tag: {{ .LinkTitle }}">{{ .LinkTitle }}</a>
{{ end -}}
{{ end -}}
</small>

View File

@@ -39,22 +39,22 @@
{{- with .First }}
{{- if ne $currentPageNumber .PageNumber }}
<li class="page-item">
<a href="{{ .URL }}" aria-label="First" class="page-link" role="button"><span aria-hidden="true"><i class="fas fa-angle-double-left"></i></span></a>
<a href="{{ .URL }}" aria-label="{{ T "paginationFirst" }}" class="page-link" role="button"><span aria-hidden="true"><i class="fas fa-angle-double-left"></i></span></a>
</li>
{{- else }}
<li class="page-item disabled">
<a aria-disabled="true" aria-label="First" class="page-link" role="button" tabindex="-1"><span aria-hidden="true"><i class="fas fa-angle-double-left"></i></span></a>
<a aria-disabled="true" aria-label="{{ T "paginationFirst" }}" class="page-link" role="button" tabindex="-1"><span aria-hidden="true"><i class="fas fa-angle-double-left"></i></span></a>
</li>
{{- end }}
{{- end }}
{{- with .Prev }}
<li class="page-item">
<a href="{{ .URL }}" aria-label="Previous" class="page-link" role="button"><span aria-hidden="true">Previous</span></a>
<a href="{{ .URL }}" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button"><span aria-hidden="true">{{ T "paginationPrevious" }}</span></a>
</li>
{{- else }}
<li class="page-item disabled">
<a aria-disabled="true" aria-label="Previous" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">Previous</span></a>
<a aria-disabled="true" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">{{ T "paginationPrevious" }}</span></a>
</li>
{{- end }}
@@ -79,22 +79,22 @@
{{- with .Next }}
<li class="page-item">
<a href="{{ .URL }}" aria-label="Next" class="page-link" role="button"><span aria-hidden="true">Next</span></a>
<a href="{{ .URL }}" aria-label="{{ T "paginationNext" }}" class="page-link" role="button"><span aria-hidden="true">{{ T "paginationNext" }}</span></a>
</li>
{{- else }}
<li class="page-item disabled">
<a aria-disabled="true" aria-label="Next" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">Next</span></a>
<a aria-disabled="true" aria-label="{{ T "paginationNext" }}" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">{{ T "paginationNext" }}</span></a>
</li>
{{- end }}
{{- with .Last }}
{{- if ne $currentPageNumber .PageNumber }}
<li class="page-item">
<a href="{{ .URL }}" aria-label="Last" class="page-link" role="button"><span aria-hidden="true"><i class="fas fa-angle-double-right"></i></span></a>
<a href="{{ .URL }}" aria-label="{{ T "paginationLast" }}" class="page-link" role="button"><span aria-hidden="true"><i class="fas fa-angle-double-right"></i></span></a>
</li>
{{- else }}
<li class="page-item disabled">
<a aria-disabled="true" aria-label="Last" class="page-link" role="button" tabindex="-1"><span aria-hidden="true"><i class="fas fa-angle-double-right"></i></span></a>
<a aria-disabled="true" aria-label="{{ T "paginationLast" }}" class="page-link" role="button" tabindex="-1"><span aria-hidden="true"><i class="fas fa-angle-double-right"></i></span></a>
</li>
{{- end }}
{{- end }}
@@ -110,14 +110,14 @@
{{- with .First }}
{{- if ne $currentPageNumber .PageNumber }}
<li class="page-item">
<a href="{{ .URL }}" aria-label="First" class="page-link" role="button"><span aria-hidden="true">Previous</span></a>
<a href="{{ .URL }}" aria-label="{{ T "paginationFirst" }}" class="page-link" role="button"><span aria-hidden="true">{{ T "paginationFirst" }}</span></a>
</li>
{{- end }}
{{- end }}
{{- with .Prev }}
<li class="page-item">
<a href="{{ .URL }}" aria-label="Previous" class="page-link" role="button"><span aria-hidden="true">Previous</span></a>
<a href="{{ .URL }}" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button"><span aria-hidden="true">{{ T "paginationPrevious" }}</span></a>
</li>
{{- end }}
@@ -142,16 +142,16 @@
{{- with .Next }}
<li class="page-item">
<a href="{{ .URL }}" aria-label="Next" class="page-link" role="button"><span aria-hidden="true">Next</span></a>
<a href="{{ .URL }}" aria-label="{{ T "paginationNext" }}" class="page-link" role="button"><span aria-hidden="true">{{ T "paginationNext" }}</span></a>
</li>
{{- end }}
{{- with .Last }}
{{- if ne $currentPageNumber .PageNumber }}
<li class="page-item">
<a href="{{ .URL }}" aria-label="Last" class="page-link" role="button"><span aria-hidden="true"><i class="fas fa-angle-double-right"></i></span></a>
<a href="{{ .URL }}" aria-label="{{ T "paginationLast" }}" class="page-link" role="button"><span aria-hidden="true"><i class="fas fa-angle-double-right"></i></span></a>
</li>
{{- end }}
{{- end }}
{{- end }}
{{- end -}}
{{- end -}}

View File

@@ -9,9 +9,9 @@
{{ if isset .Params "tags" }}
<small class="text-muted text-uppercase">
{{ range $index, $element := .Params.tags }}
{{ range $index, $element := (.GetTerms "tags") }}
{{ if gt $index 0 }}&bull; {{ end }}
<a href="{{ $.Site.BaseURL }}tags/{{ . | urlize }}" class="text-decoration-none text-primary" aria-label="Tag: {{ . }}">{{ . }}</a>
<a href="{{ (path.Join .Page.RelPermalink) | relURL }}" class="text-decoration-none text-primary" aria-label="Tag: {{ .LinkTitle }}">{{ .LinkTitle }}</a>
{{ end }}
</small>
{{ end }}

View File

@@ -8,4 +8,4 @@
{{ end -}}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@200;300;600&display=swap">
<link rel="stylesheet" href="{{ site.Params.style.themeFontPath | default "https://fonts.googleapis.com/css2?family=Inter:wght@200;300;600&display=swap" }}">

View File

@@ -5,8 +5,8 @@
wrapped in a figure if a caption is provided, else the image is wrapped in a div with a ratio constraint. The
partial supports the following arguments:
"url": Required relative url of the image, e.g. "img/example.jpg"
"ratio": Optional ratio of the image, either "1x1", "4x3", "16x9", or "21x9". Other values are ignored.
Instead, the original aspect ratio of the image is preserved.
"ratio": Optional ratio of the image, either "1x1", "4x3", "16x9", or "21x9". If set, the image is
resized and cropped to match the ratio. Else the original aspect ratio of the image is kept.
"outerClass": Optional class attribute of the outer div element, e.g. "img-wrap".
"innerClass": Optional class attribute of the inner img element, e.g. "rounded".
"title": Optional alternate text of the image.
@@ -62,12 +62,27 @@
{{ $xxlDim = printf "1400x%d" (int (math.Round (mul (div 1400.0 $img.Width) $img.Height))) -}}
{{ end -}}
{{- $sm := ($img.Fill (printf "%s webp" $smDim)) -}}
{{ $md := ($img.Fill (printf "%s webp" $mdDim)) -}}
{{ $lg := ($img.Fill (printf "%s webp" $lgDim)) -}}
{{ $xl := ($img.Fill (printf "%s webp" $xlDim)) -}}
{{ $xxl := ($img.Fill (printf "%s webp" $xxlDim)) -}}
{{ $fallback := ($img.Fill (printf "%s jpg" $xxlDim)) -}}
{{- $sm := "" -}}
{{ $md := "" -}}
{{ $lg := "" -}}
{{ $xl := "" -}}
{{ $xxl := "" -}}
{{ $fallback := "" -}}
{{ if $ratio }}
{{- $sm = ($img.Fill (printf "%s webp" $smDim)) -}}
{{ $md = ($img.Fill (printf "%s webp" $mdDim)) -}}
{{ $lg = ($img.Fill (printf "%s webp" $lgDim)) -}}
{{ $xl = ($img.Fill (printf "%s webp" $xlDim)) -}}
{{ $xxl = ($img.Fill (printf "%s webp" $xxlDim)) -}}
{{ $fallback = ($img.Fill (printf "%s jpg" $xxlDim)) -}}
{{ else }}
{{- $sm = ($img.Fit (printf "%s webp" $smDim)) -}}
{{ $md = ($img.Fit (printf "%s webp" $mdDim)) -}}
{{ $lg = ($img.Fit (printf "%s webp" $lgDim)) -}}
{{ $xl = ($img.Fit (printf "%s webp" $xlDim)) -}}
{{ $xxl = ($img.Fit (printf "%s webp" $xxlDim)) -}}
{{ $fallback = ($img.Fit (printf "%s jpg" $xxlDim)) -}}
{{ end}}
{{- with $caption -}}
<figure class="figure">

View File

@@ -1,10 +1,11 @@
<!--
Displays a carousel of several responsive images (see the image shortcode for more details). Add inner <img>
elements to define individual image slides. The shortcode supports the following arguments:
"ratio": Bootstrap ratio of the image, either "1x1", "4x3" (default), "16x9", or "21x9".
"ratio": Optional ratio of the image, either "1x1", "4x3", "16x9", or "21x9". Other values are ignored.
Instead, the original aspect ratio of the image is preserved.
-->
{{ $ratio := "4x3" -}}
{{ $ratio := "" -}}
{{ $class := "" -}}
{{ with .Get "ratio" }}{{ $ratio = . }}{{ end -}}
{{ with .Get "class" }}{{ $class = . }}{{ end -}}

View File

@@ -2,13 +2,14 @@
Renders a carousel item with a responsive image (see the image shortcode for more details). The shortcode
supports the following arguments:
"src": Required relative url of the image, e.g. "img/example.jpg"
"ratio": Bootstrap ratio of the image, either "1x1", "4x3" (default), "16x9", or "21x9".
"ratio": Optional ratio of the image, either "1x1", "4x3", "16x9", or "21x9". Other values are ignored.
Instead, the original aspect ratio of the image is preserved.
"caption": Optional carousel slide caption.
-->
{{- $src := .Get "src" -}}
{{ $caption := .Get "caption" -}}
{{- $ratio := "4x3" -}}
{{- $ratio := "" -}}
{{ with .Parent -}}
{{ with .Get "ratio" }}{{ $ratio = . }}{{ end -}}
{{ else }}

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@markdumay/hugo-theme-hinode",
"version": "0.7.2",
"version": "0.7.8",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@markdumay/hugo-theme-hinode",
"version": "0.7.2",
"version": "0.7.8",
"hasInstallScript": true,
"license": "MIT",
"devDependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "@markdumay/hugo-theme-hinode",
"version": "0.7.3",
"version": "0.7.8",
"description": "Hinode is a clean blog theme for Hugo, an open-source static site generator",
"main": "index.js",
"publishConfig": {