Migrate to LFTP deployment and improve templates

- Add `deploy-lftp` command
- Add 404 page
- Change relative links to absolute links
- Fix pagination links
- Remove drafts from Pagefind indexing
- Fix OpenGraph descriptions for i18n
- Add Commissioners and Requesters components
- Add consistent type-checking for getStaticPaths
This commit is contained in:
Bad Manners 2024-06-16 19:24:25 -03:00
parent 837433364d
commit a9d5a88d0e
26 changed files with 254 additions and 70 deletions

View file

@ -8,8 +8,8 @@ type Props = {
const { lang } = Astro.props;
const authors = Astro.slots.has("default")
? (await Astro.slots.render("default")).replaceAll(/\<\/(a|span)\>\</g, "</$1><br><")
: "";
? (await Astro.slots.render("default")).replaceAll(/\<\/(a|span)\>\</g, "</$1><br><").split("<br>")
: [];
---
{authors ? <p id="authors" set:html={t(lang, "story/authors", authors.split("<br>"))} /> : null}
{authors.length ? <p id="authors" set:html={t(lang, "story/authors", authors)} /> : null}

View file

@ -0,0 +1,15 @@
---
import { type Lang } from "../content/config";
import { t } from "../i18n";
type Props = {
lang: Lang;
};
const { lang } = Astro.props;
const commissioners = Astro.slots.has("default")
? (await Astro.slots.render("default")).replaceAll(/\<\/(a|span)\>\</g, "</$1><br><").split("<br>")
: [];
---
{commissioners.length ? <p id="commissioners" set:html={t(lang, "story/commissioned_by", commissioners)} /> : null}

View file

@ -0,0 +1,15 @@
---
import { type Lang } from "../content/config";
import { t } from "../i18n";
type Props = {
lang: Lang;
};
const { lang } = Astro.props;
const requesters = Astro.slots.has("default")
? (await Astro.slots.render("default")).replaceAll(/\<\/(a|span)\>\</g, "</$1><br><").split("<br>")
: [];
---
{requesters.length ? <p id="requesters" set:html={t(lang, "story/requested_by", requesters)} /> : null}