Skip to content

Commit 37d0724

Browse files
committed
Reference thumbnails as resources
1 parent 00cdf9e commit 37d0724

6 files changed

Lines changed: 7 additions & 14 deletions

File tree

src/main/java/zone/nox/Site.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,6 @@ public Outline createOutline(Outliner outliner) {
6464
outliner.generate(new PostPage(Target.from(config)));
6565
outliner.generate(new FourOhFour());
6666
outliner.generateStaticResources(Path.of(""), "favicon.ico");
67-
// TODO: this should be easier
68-
outliner.generateStaticResources(
69-
Path.of("thumbnails"),
70-
"/thumbnails/12-last-year.jpg",
71-
"/thumbnails/13-mexico.jpg",
72-
"/thumbnails/14-scaff.jpg"
73-
);
7467

7568
return outliner.build();
7669
}

src/main/java/zone/nox/components/Layout.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import dev.nipafx.ginevra.html.Classes;
77
import dev.nipafx.ginevra.html.Component;
88
import dev.nipafx.ginevra.html.Element;
9+
import dev.nipafx.ginevra.html.Src;
910
import dev.nipafx.ginevra.outline.Resources;
1011

1112
import java.nio.charset.StandardCharsets;
@@ -147,9 +148,8 @@ public Element compose() {
147148
meta.name("twitter:description").content(description)
148149
);
149150
var card = thumbnail.map(thumb -> List.of(
150-
// TODO: the root URL shouldn't be hard-coded
151-
meta.name("og:image").content("https://nox.zone/thumbnails/" + thumb),
152-
meta.name("twitter:image").content("https://nox.zone/thumbnails/" + thumb),
151+
meta.name("og:image").contentSrc(Resources.include(thumb)),
152+
meta.name("twitter:image").contentSrc(Resources.include(thumb)),
153153
meta.name("twitter:card").content("summary_large_image")))
154154
.orElse(List.of(meta.name("twitter:card").content("summary")));
155155
metaElements = plus(metaElements, card);

src/main/java/zone/nox/templates/LandingPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private Element composePage(List<Post> posts) {
6060
.slug("")
6161
.title("Radio Nox")
6262
.description("News from the Shadows of Neotropolis.")
63-
.thumbnail(Optional.of("landing.jpg"))
63+
.thumbnail(Optional.of("/thumbnails/landing.jpg"))
6464
.content(div
6565
.classes(STYLE.posts)
6666
.children(postsByYear

src/main/resources/posts/012--2025-04-13-1425--arrived.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Nox Is Going Nowhere"
33
summary: "Even after the blackout, Nox is still in Neotropolis"
4-
thumbnail: "12-last-year.jpg"
4+
thumbnail: "/thumbnails/12-last-year.jpg"
55
---
66

77
Things didn't really go according to plan, a year ago.

src/main/resources/posts/013--2025-04-14-0806--usa.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "\"Sleep Now in the Fire\""
33
summary: "The past shaped our present and the present shapes our future - don't let anyone tell you otherwise"
4-
thumbnail: "13-mexico.jpg"
4+
thumbnail: "/thumbnails/13-mexico.jpg"
55
---
66

77
When we look at the world around us, we don't just see the present, we also see our past, the integral over the set of humanity's decisions.

src/main/resources/posts/014--2025-04-15-2115--day-in-the-ife.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "A Day in the Life..."
33
summary: "... of a Neotropolis builder"
4-
thumbnail: "14-scaff.jpg"
4+
thumbnail: "/thumbnails/14-scaff.jpg"
55
---
66

77
## The Morning

0 commit comments

Comments
 (0)