71196c8b4b
CI / update (push) Successful in 3m50s
Adds the entire /<faithLang>/{apologetik,apologetics} section:
- Landing page introducing the contra/pro split with shield/flame cards.
- Contra (objections): 23 objections, each answered by multiple archetype
voices (Aquinas, Pascal, Augustine, Lewis, Chesterton, plus Logician,
Mystic, Scientist, Pastor archetypes); index + per-argument detail pages
with archetype filter and inter-argument navigation.
- Pro (positive case): 12 arguments across three layers (supernatural,
theism, christianity) voiced by Habermas, Polkinghorne, Newman, Hart,
Lewis, Wright, Hahn, Plantinga, Eliade, Feser, Chesterton, Guénon;
cumulative-case visual + per-argument detail pages.
- DE/EN content via per-language data modules; LA stub layout 307-redirects
to English.
- Per-language slug via apologetikSlug matcher; canonical-slug enforcement
redirects mismatches.
- Shared ApologetikToc component (also reused on zehn-gebote katechese).
- CaseTabs component for contra/pro switching.
- DeepL translation script for regenerating DE data from EN source.
- Server-side scripture lookup helper.
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import { error } from '@sveltejs/kit';
|
|
import type { PageServerLoad } from './$types';
|
|
import {
|
|
findPositiveArgumentLang,
|
|
getPosArguments,
|
|
getPosLayers,
|
|
getPosVoices,
|
|
POS_ARGUMENTS as EN_POS_ARGUMENTS
|
|
} from '$lib/data/apologetik';
|
|
import { resolveScriptureForLang } from '$lib/server/scriptureLookup';
|
|
|
|
export const load: PageServerLoad = async ({ params, parent }) => {
|
|
const { lang } = await parent();
|
|
const [arg, voices, layers, args] = await Promise.all([
|
|
findPositiveArgumentLang(params.posArgId, lang),
|
|
getPosVoices(lang),
|
|
getPosLayers(lang),
|
|
getPosArguments(lang)
|
|
]);
|
|
if (!arg) {
|
|
error(404, 'Argument not found');
|
|
}
|
|
|
|
const lng: 'en' | 'de' = lang === 'de' ? 'de' : 'en';
|
|
const enArg = EN_POS_ARGUMENTS.find((x) => x.id === arg.id);
|
|
const argument = enArg
|
|
? (() => {
|
|
const resolved = resolveScriptureForLang(enArg.scripture.ref, lng);
|
|
return {
|
|
...arg,
|
|
scripture: resolved.text ? resolved : arg.scripture
|
|
};
|
|
})()
|
|
: arg;
|
|
|
|
const argsWithScripture = args.map((a) => {
|
|
const en = EN_POS_ARGUMENTS.find((x) => x.id === a.id);
|
|
if (!en) return a;
|
|
const resolved = resolveScriptureForLang(en.scripture.ref, lng);
|
|
return { ...a, scripture: resolved.text ? resolved : a.scripture };
|
|
});
|
|
|
|
return { argument, voices, layers, args: argsWithScripture };
|
|
};
|