Skip to content

Commit

Permalink
Localized Post
Browse files Browse the repository at this point in the history
  • Loading branch information
kristofzerbe committed Oct 4, 2024
1 parent 9631d40 commit 786636d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion scripts/events/on-generateBefore-get-dynamic-photos.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -20,9 +22,6 @@ related:
- Push-Over-Webmentions
- Hexo-and-the-IndieWeb
- IndieFediWebVerse
syndication:
- host: Mastodon
url: null
---

<img src="/images/mentions-united.svg" class="float-right no-zoom">
Expand Down
2 changes: 2 additions & 0 deletions source/_posts/2024/Mentions-United-3-2-1-go.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
17 changes: 15 additions & 2 deletions themes/landscape/layout/_partial/article.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,21 @@

<div class="article-inner">

<% if (post.hidden) { %>
<small class="hidden-info"><span>This is a hidden post. You're lucky to have the URL ...</span></small>
<%
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 <a href="${post.permalink.replace("/de", "")}"> englischen Beitrag</a>`;
}
} else {
if (post.hasLocale) {
infoText = `This post is also available in <a href="${post.permalink + "de"}">German</a> ...`;
}
}
%>
<% if(infoText) {%>
<small class="top-info"><span><%- infoText %></span></small>
<% } %>

<% if (post.link || post.title){ %>
Expand Down
10 changes: 5 additions & 5 deletions themes/landscape/source/css/_partial/article.styl
Original file line number Diff line number Diff line change
Expand Up @@ -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"] &
Expand All @@ -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
Expand Down

0 comments on commit 786636d

Please sign in to comment.