mirror of
https://github.com/RGBCube/Site
synced 2025-07-30 12:37:50 +00:00
treewide: set title from basename if it doesn't exist
This commit is contained in:
parent
de33425078
commit
bd49960b65
5 changed files with 11 additions and 15 deletions
13
site.ts
13
site.ts
|
@ -40,7 +40,15 @@ site.data("color", color);
|
|||
|
||||
site.add(".");
|
||||
|
||||
site.process([".html"], (pages) => {
|
||||
site.preprocess([".html"], (pages) =>
|
||||
pages.forEach((page) => {
|
||||
page.data.title = page.data.title ??
|
||||
page.data.basename
|
||||
.replace(/-/g, " ")
|
||||
.replace(/\b\w/g, (char) => char.toUpperCase());
|
||||
}));
|
||||
|
||||
site.process([".html"], (pages) =>
|
||||
pages.forEach((page) => {
|
||||
const document = page.document;
|
||||
|
||||
|
@ -156,8 +164,7 @@ site.process([".html"], (pages) => {
|
|||
footnotes.remove();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}));
|
||||
|
||||
site.use(extractDate());
|
||||
site.use(redirects());
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{ function process(entry, toplevel = false) }}
|
||||
<div class="relative p-4{{ if !toplevel }} my-4 md:mx-8{{ /if }} border-1 bg-white dark:bg-black">
|
||||
{{ if entry.data.title }}
|
||||
{{ if entry.data.url }}
|
||||
<a
|
||||
class="
|
||||
reset
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
---
|
||||
title: Test
|
||||
description: "Testing"
|
||||
|
||||
draft: true
|
||||
---
|
||||
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
---
|
||||
title: Analytics
|
||||
---
|
||||
|
||||
This site and other websites under this domain run
|
||||
[Plausible](https://plausible.io/) analytics on a self-hosted instance at
|
||||
[shekels.rgbcu.be](https://shekels.rgbcu.be/).
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
---
|
||||
title: Availability
|
||||
---
|
||||
|
||||
The website of RGBCube is up.
|
||||
|
||||
This webpage is **absolutely never** wrong.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue