From 786636d030d9bfc5068029fd75605ac80e79e139 Mon Sep 17 00:00:00 2001 From: Kristof Zerbe Date: Fri, 4 Oct 2024 17:51:22 +0200 Subject: [PATCH] Localized Post --- .../on-generateBefore-get-dynamic-photos.js | 2 +- ...-go-DE.md => Mentions-United-3-2-1-go.de.md} | 7 +++---- source/_posts/2024/Mentions-United-3-2-1-go.md | 2 ++ themes/landscape/layout/_partial/article.ejs | 17 +++++++++++++++-- .../landscape/source/css/_partial/article.styl | 10 +++++----- 5 files changed, 26 insertions(+), 12 deletions(-) rename source/_posts/2024/{Mentions-United-3-2-1-go-DE.md => Mentions-United-3-2-1-go.de.md} (99%) diff --git a/scripts/events/on-generateBefore-get-dynamic-photos.js b/scripts/events/on-generateBefore-get-dynamic-photos.js index d2145186aa..c6950d8274 100644 --- a/scripts/events/on-generateBefore-get-dynamic-photos.js +++ b/scripts/events/on-generateBefore-get-dynamic-photos.js @@ -238,7 +238,7 @@ function getPostAndPagePhotos() { //console.log(JSON.stringify(used) + "\n ----------------------------------"); let postsAndPages = [...locals.get("posts").data, ...locals.get("pages").data].map(fm => { - if (fm.photograph && !fm.photograph.keepOutOverview) { + if (!fm.hidden && fm.photograph && !fm.photograph.keepOutOverview) { return { title: fm.title, subTitle: fm.subtitle, diff --git a/source/_posts/2024/Mentions-United-3-2-1-go-DE.md b/source/_posts/2024/Mentions-United-3-2-1-go.de.md similarity index 99% rename from source/_posts/2024/Mentions-United-3-2-1-go-DE.md rename to source/_posts/2024/Mentions-United-3-2-1-go.de.md index 371f6e2a63..5fe6e24e51 100644 --- a/source/_posts/2024/Mentions-United-3-2-1-go-DE.md +++ b/source/_posts/2024/Mentions-United-3-2-1-go.de.md @@ -1,7 +1,9 @@ --- hidden: true +isLocale: true permalink: post/Mentions-United-3-2-1-go/de -slug: Mentions-United-3-2-1-go-DE +#-------------------------------------------------- +slug: Mentions-United-3-2-1-go title: Mentions United ... 3, 2, 1, Go subtitle: Eine JavaScript-Lösung, um Blog-Beiträge mit ihren Interaktionen zu verbinden date: 2024-10-03 15:22:21 @@ -20,9 +22,6 @@ related: - Push-Over-Webmentions - Hexo-and-the-IndieWeb - IndieFediWebVerse -syndication: - - host: Mastodon - url: null --- diff --git a/source/_posts/2024/Mentions-United-3-2-1-go.md b/source/_posts/2024/Mentions-United-3-2-1-go.md index f7e10956f1..15a53c11e3 100644 --- a/source/_posts/2024/Mentions-United-3-2-1-go.md +++ b/source/_posts/2024/Mentions-United-3-2-1-go.md @@ -1,4 +1,6 @@ --- +hasLocale: true +#-------------------------------------------------- slug: Mentions-United-3-2-1-go title: Mentions United ... 3, 2, 1, Go subtitle: A JavaScript solution to unite blog posts with their interactions diff --git a/themes/landscape/layout/_partial/article.ejs b/themes/landscape/layout/_partial/article.ejs index bc2f04deb6..17b57b70b1 100644 --- a/themes/landscape/layout/_partial/article.ejs +++ b/themes/landscape/layout/_partial/article.ejs @@ -22,8 +22,21 @@
- <% if (post.hidden) { %> - This is a hidden post. You're lucky to have the URL ... + <% + let infoText; + if (post.hidden) { + infoText = "This is a hidden post. You're lucky to have the URL ..."; + if (post.isLocale) { + infoText = `... zurück zum englischen Beitrag`; + } + } else { + if (post.hasLocale) { + infoText = `This post is also available in German ...`; + } + } + %> + <% if(infoText) {%> + <%- infoText %> <% } %> <% if (post.link || post.title){ %> diff --git a/themes/landscape/source/css/_partial/article.styl b/themes/landscape/source/css/_partial/article.styl index f1a485fc40..f2a3d039f4 100644 --- a/themes/landscape/source/css/_partial/article.styl +++ b/themes/landscape/source/css/_partial/article.styl @@ -171,10 +171,10 @@ @extend $block-inner overflow: hidden margin-bottom: default-margin - small.hidden-info + small.top-info display: block padding: (small-padding * 2) (small-padding * 3) - font-size: font-size-medium + font-size: font-size-small opacity: 0.5 background-color: color-background /[data-theme="dark"] & @@ -183,14 +183,14 @@ margin-left: 24px &:before content: "" - width: 16px - height: 18px + width: 20px + height: 20px display: block position: absolute mask-image: url(/images/icons/circle-info.svg) mask-repeat: no-repeat mask-size: 16px - mask-position: 0 2px + mask-position: 0 4px background-color: var(--color-accent1) .article-photo