sitemap generation was broken by prettier

This commit is contained in:
adueck 2024-07-04 17:07:36 -04:00
parent bd163ed5cb
commit 07f1abed0e
4 changed files with 185 additions and 178 deletions

1
.prettierignore Normal file
View File

@ -0,0 +1 @@
src/content/index.ts

View File

@ -130,13 +130,13 @@ import * as phraseBuilder from "./phrase-builder.mdx";
import * as dictionary from "./dictionary.mdx"; import * as dictionary from "./dictionary.mdx";
type ChapterSection = { type ChapterSection = {
import: any; "import": any;
slug: string; "slug": string;
}; };
type ChaptersSection = { type ChaptersSection = {
heading: string; "heading": string;
subdirectory: string; "subdirectory": string;
chapters: ChapterSection[]; "chapters": ChapterSection[];
}; };
// for the super hacky sitemap generator to work this array needs to be // for the super hacky sitemap generator to work this array needs to be
@ -145,297 +145,297 @@ type ChaptersSection = {
export const contentTree: (ChapterSection | ChaptersSection)[] = export const contentTree: (ChapterSection | ChaptersSection)[] =
/* content-tree */ [ /* content-tree */ [
{ {
import: intro, "import": intro,
slug: "intro", "slug": "intro"
}, },
{ {
import: games, "import": games,
slug: "games", "slug": "games"
}, },
{ {
import: phraseBuilder, "import": phraseBuilder,
slug: "phrase-builder", "slug": "phrase-builder"
}, },
{ {
heading: "Equatives", "heading": "Equatives",
subdirectory: "equatives", "subdirectory": "equatives",
chapters: [ "chapters": [
{ {
import: presentEquative, "import": presentEquative,
slug: "present-equative", "slug": "present-equative"
}, },
{ {
import: habitualEquative, "import": habitualEquative,
slug: "habitual-equative", "slug": "habitual-equative"
}, },
{ {
import: otherEquatives, "import": otherEquatives,
slug: "other-equatives", "slug": "other-equatives"
}, }
], ]
}, },
{ {
heading: "Nouns", "heading": "Nouns",
subdirectory: "nouns", "subdirectory": "nouns",
chapters: [ "chapters": [
{ {
import: nounsGender, "import": nounsGender,
slug: "nouns-gender", "slug": "nouns-gender"
}, },
{ {
import: nounsUnisex, "import": nounsUnisex,
slug: "nouns-unisex", "slug": "nouns-unisex"
}, },
{ {
import: nounsPlural, "import": nounsPlural,
slug: "nouns-plural", "slug": "nouns-plural"
}, },
{ {
import: specialPlurals, "import": specialPlurals,
slug: "special-plurals", "slug": "special-plurals"
}, },
{ {
import: bundledPlurals, "import": bundledPlurals,
slug: "bundled-plurals", "slug": "bundled-plurals"
}, }
], ]
}, },
{ {
heading: "Phrase Structure 🧱", "heading": "Phrase Structure 🧱",
subdirectory: "phrase-structure", "subdirectory": "phrase-structure",
chapters: [ "chapters": [
{ {
import: BlocksAndKids, "import": BlocksAndKids,
slug: "blocks-and-kids", "slug": "blocks-and-kids"
}, },
{ {
import: NPIntro, "import": NPIntro,
slug: "np", "slug": "np"
}, },
{ {
import: APIntro, "import": APIntro,
slug: "ap", "slug": "ap"
}, },
{ {
import: EPIntro, "import": EPIntro,
slug: "ep", "slug": "ep"
}, },
{ {
import: VPIntro, "import": VPIntro,
slug: "vp", "slug": "vp"
}, },
{ {
import: Complement, "import": Complement,
slug: "complement", "slug": "complement"
}, },
{ {
import: ShorteningVPs, "import": ShorteningVPs,
slug: "shortening-vps", "slug": "shortening-vps"
}, }
], ]
}, },
{ {
heading: "Verbs", "heading": "Verbs",
subdirectory: "verbs", "subdirectory": "verbs",
chapters: [ "chapters": [
{ {
import: verbsIntro, "import": verbsIntro,
slug: "verbs-intro", "slug": "verbs-intro"
}, },
{ {
import: verbAspect, "import": verbAspect,
slug: "verb-aspect", "slug": "verb-aspect"
}, },
{ {
import: rootsAndStems, "import": rootsAndStems,
slug: "roots-and-stems", "slug": "roots-and-stems"
}, },
{ {
import: presentVerbs, "import": presentVerbs,
slug: "present-verbs", "slug": "present-verbs"
}, },
{ {
import: subjunctiveVerbs, "import": subjunctiveVerbs,
slug: "subjunctive-verbs", "slug": "subjunctive-verbs"
}, },
{ {
import: futureVerbs, "import": futureVerbs,
slug: "future-verbs", "slug": "future-verbs"
}, },
{ {
import: imperativeVerbs, "import": imperativeVerbs,
slug: "imperative-verbs", "slug": "imperative-verbs"
}, },
{ {
import: pastVerbs, "import": pastVerbs,
slug: "past-verbs", "slug": "past-verbs"
}, },
{ {
import: perfectVerbsIntro, "import": perfectVerbsIntro,
slug: "perfect-verbs-intro", "slug": "perfect-verbs-intro"
}, },
{ {
import: allPerfectVerbs, "import": allPerfectVerbs,
slug: "all-perfect-verbs", "slug": "all-perfect-verbs"
}, },
{ {
import: negativeVerbs, "import": negativeVerbs,
slug: "negative-verbs", "slug": "negative-verbs"
}, },
{ {
import: ability, "import": ability,
slug: "ability", "slug": "ability"
}, },
{ {
import: jussive, "import": jussive,
slug: "jussive", "slug": "jussive"
}, },
{ {
import: passiveVoice, "import": passiveVoice,
slug: "passive-voice", "slug": "passive-voice"
}, },
{ {
import: verbEndings, "import": verbEndings,
slug: "verb-endings", "slug": "verb-endings"
}, },
{ {
import: masterChart, "import": masterChart,
slug: "master-chart", "slug": "master-chart"
}, }
], ]
}, },
{ {
heading: "Compound Verbs", "heading": "Compound Verbs",
subdirectory: "compound-verbs", "subdirectory": "compound-verbs",
chapters: [ "chapters": [
{ {
import: compoundVerbsIntro, "import": compoundVerbsIntro,
slug: "intro", "slug": "intro"
}, },
{ {
import: helperVerbs, "import": helperVerbs,
slug: "helper-verbs", "slug": "helper-verbs"
}, },
{ {
import: stativeCompounds, "import": stativeCompounds,
slug: "stative-compounds", "slug": "stative-compounds"
}, },
{ {
import: dynamicCompounds, "import": dynamicCompounds,
slug: "dynamic-compounds", "slug": "dynamic-compounds"
}, },
{ {
import: moreOnCompounds, "import": moreOnCompounds,
slug: "more-on-compounds", "slug": "more-on-compounds"
}, }
], ]
}, },
{ {
heading: "Participles", "heading": "Participles",
subdirectory: "participles", "subdirectory": "participles",
chapters: [ "chapters": [
{ {
import: introToParticiples, "import": introToParticiples,
slug: "intro", "slug": "intro"
}, }
], ]
}, },
{ {
heading: "Pronouns", "heading": "Pronouns",
subdirectory: "pronouns", "subdirectory": "pronouns",
chapters: [ "chapters": [
{ {
import: pronounsBasic, "import": pronounsBasic,
slug: "pronouns-basic", "slug": "pronouns-basic"
}, },
{ {
import: pronounsMini, "import": pronounsMini,
slug: "pronouns-mini", "slug": "pronouns-mini"
}, },
{ {
import: directionalPronouns, "import": directionalPronouns,
slug: "pronouns-directional", "slug": "pronouns-directional"
}, }
], ]
}, },
{ {
heading: "Inflection 🔘", "heading": "Inflection 🔘",
subdirectory: "inflection", "subdirectory": "inflection",
chapters: [ "chapters": [
{ {
import: inflectionIntro, "import": inflectionIntro,
slug: "inflection-intro", "slug": "inflection-intro"
}, },
{ {
import: inflectionPatterns, "import": inflectionPatterns,
slug: "inflection-patterns", "slug": "inflection-patterns"
}, }
], ]
}, },
{ {
heading: "Sandwiches 🥪", "heading": "Sandwiches 🥪",
subdirectory: "sandwiches", "subdirectory": "sandwiches",
chapters: [ "chapters": [
{ {
import: sandwiches, "import": sandwiches,
slug: "sandwiches", "slug": "sandwiches"
}, }
], ]
}, },
{ {
heading: "Writing 🖊", "heading": "Writing 🖊",
subdirectory: "writing", "subdirectory": "writing",
chapters: [ "chapters": [
{ {
import: phonetics, "import": phonetics,
slug: "phonetics", "slug": "phonetics"
}, },
{ {
import: diacritics, "import": diacritics,
slug: "diacritics", "slug": "diacritics"
}, },
{ {
import: theFiveYeys, "import": theFiveYeys,
slug: "the-five-yeys", "slug": "the-five-yeys"
}, },
{ {
import: typingIssues, "import": typingIssues,
slug: "typing-issues", "slug": "typing-issues"
}, }
], ]
}, },
{ {
heading: "Recipes 👩‍🍳", "heading": "Recipes 👩‍🍳",
subdirectory: "recipes", "subdirectory": "recipes",
chapters: [ "chapters": [
{ {
import: unrealConditionals, "import": unrealConditionals,
slug: "unreal-conditionals", "slug": "unreal-conditionals"
}, }
], ]
}, },
{ {
heading: "Practice Tools 🔧", "heading": "Practice Tools 🔧",
subdirectory: "practice-tools", "subdirectory": "practice-tools",
chapters: [ "chapters": [
{ {
import: pronounPicker, "import": pronounPicker,
slug: "pronoun-picker", "slug": "pronoun-picker"
}, }
], ]
}, },
{ {
import: dictionary, "import": dictionary,
slug: "dictionary", "slug": "dictionary"
}, }
]; /* content-tree */ ] /* content-tree */
export const content = contentTree export const content = contentTree
.map((item) => { .map((item) => {
function prepareChapter(chp: any, subdir?: any) { function prepareChapter(chp: any, subdir?: any) {
return { return {
path: subdir ? `/${subdir}/${chp.slug}/` : `/${chp.slug}/`, path: subdir ? `/${subdir}/${chp.slug}/` : `/${chp.slug}/`,
slug: chp.slug, "slug": chp.slug,
content: chp.import.default, content: chp.import.default,
frontMatter: chp.import.frontMatter, frontMatter: chp.import.frontMatter,
tableOfContents: chp.import.tableOfContents, tableOfContents: chp.import.tableOfContents,
@ -445,7 +445,7 @@ export const content = contentTree
? prepareChapter(item) ? prepareChapter(item)
: { : {
...item, ...item,
chapters: item.chapters?.map((c) => { "chapters": item.chapters?.map((c) => {
return prepareChapter(c, item.subdirectory); return prepareChapter(c, item.subdirectory);
}), }),
}; };
@ -516,7 +516,7 @@ export const content = contentTree
return { return {
...item, ...item,
// @ts-ignore // @ts-ignore
chapters: item.chapters.map((chapter, j, chapters) => "chapters": item.chapters.map((chapter, j, chapters) =>
withNextPrev(chapter, j, chapters) withNextPrev(chapter, j, chapters)
), ),
}; };

View File

@ -1,7 +1,13 @@
import Table from "../../components/Table"; import Table from "../../components/Table";
import { defaultTextOptions as opts } from "@lingdocs/ps-react"; import { defaultTextOptions as opts } from "@lingdocs/ps-react";
function PluralTable({ children, inflection }) { function PluralTable({
children,
inflection,
}: {
children: any;
inflection: boolean;
}) {
return ( return (
<Table <Table
wide={false} wide={false}