From 3b45d0b4bbe1a7590f71b2c6fc2a25641f3b9f99 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 23 Sep 2025 13:36:33 -0700 Subject: [PATCH] Content, mostly --- astro.config.mjs | 16 ++++++++++++---- src/components/VocabWord.astro | 17 ++++++++++------- src/content/docs/404.mdx | 2 +- .../active-passive-transitive-intransitive.mdx | 5 +++++ src/content/docs/grammar/intro.mdx | 2 ++ src/content/docs/how-i-built-this/index.mdx | 11 +++++++++++ src/content/docs/how-i-built-this/roadmap.mdx | 14 ++++++++++++++ src/content/docs/index.mdx | 13 +++++++++---- src/content/docs/vocabulary/datetime.mdx | 14 -------------- src/content/docs/vocabulary/education.mdx | 10 ---------- src/content/docs/vocabulary/food_drink.mdx | 11 ----------- src/content/docs/vocabulary/index.mdx | 6 +++--- src/content/docs/vocabulary/media.mdx | 13 ------------- src/content/docs/vocabulary/substances.mdx | 9 --------- src/pages/edit/index.astro | 9 +++++++++ .../{vocab => vocabulary}/[category].astro | 3 ++- src/styles/custom.css | 6 +++--- src/vocab_list.yaml | 9 +++++++++ 18 files changed, 90 insertions(+), 80 deletions(-) create mode 100644 src/content/docs/grammar/active-passive-transitive-intransitive.mdx create mode 100644 src/content/docs/how-i-built-this/index.mdx create mode 100644 src/content/docs/how-i-built-this/roadmap.mdx delete mode 100644 src/content/docs/vocabulary/datetime.mdx delete mode 100644 src/content/docs/vocabulary/education.mdx delete mode 100644 src/content/docs/vocabulary/food_drink.mdx delete mode 100644 src/content/docs/vocabulary/media.mdx delete mode 100644 src/content/docs/vocabulary/substances.mdx create mode 100644 src/pages/edit/index.astro rename src/pages/{vocab => vocabulary}/[category].astro (91%) diff --git a/astro.config.mjs b/astro.config.mjs index 4b57326..e8bca13 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -13,12 +13,12 @@ const categories = vocabListJson.map( const vocabList = [ { label: "Index", - link: `/vocab/index`, + link: `/vocabulary`, }, ].concat( categories.map((/** @type {string} */ category) => ({ label: category.charAt(0).toUpperCase() + category.slice(1), - link: `/vocab/${category}`, + link: `/vocabulary/${category}`, })), ); @@ -39,13 +39,21 @@ export default defineConfig({ "./src/styles/custom.css", ], sidebar: [ + { + label: "Grammar", + autogenerate: { directory: "grammar" }, + }, { label: "Vocabulary", items: vocabList, }, { - label: "Grammar", - autogenerate: { directory: "grammar" }, + label: "How I Built This", + autogenerate: { directory: "how-i-built-this" }, + }, + { + label: "Edit YAML", + link: "/edit", }, ], }), diff --git a/src/components/VocabWord.astro b/src/components/VocabWord.astro index 8c1e5a0..b54ef9b 100644 --- a/src/components/VocabWord.astro +++ b/src/components/VocabWord.astro @@ -1,5 +1,6 @@ --- import {Aside, Badge, Icon} from '@astrojs/starlight/components'; +import AnchorHeading from '@astrojs/starlight/components/AnchorHeading.astro'; import markdownit from 'markdown-it' import markdownItMark from 'markdown-it-mark' const md = markdownit().use(markdownItMark); @@ -34,15 +35,15 @@ function highlight(text: string, term: string) { } ---
  • -

    + {word.hindi} ({word.english}) {word.gender && } -

    + {word.note &&
    } { -word.examples && +word.examples &&( <>

    For example,

      @@ -59,12 +60,14 @@ word.examples && ))}
    + )} { word.see_also && ( -

    See also: - { word.see_also.map((ref) => ( - +

    See also: + { word.see_also.map((ref, i) => ( + <> + { i < word.see_also!.length - 1 ? "; " : '' } + )) }

    )} -
  • \ No newline at end of file diff --git a/src/content/docs/404.mdx b/src/content/docs/404.mdx index 99c87cd..b3295bd 100644 --- a/src/content/docs/404.mdx +++ b/src/content/docs/404.mdx @@ -6,4 +6,4 @@ template: splash # 404 | कुछ नहीं है यहाँ -[← घर वापस जाऐं](/) +[← घर वापस जाऐं]() diff --git a/src/content/docs/grammar/active-passive-transitive-intransitive.mdx b/src/content/docs/grammar/active-passive-transitive-intransitive.mdx new file mode 100644 index 0000000..4ac1703 --- /dev/null +++ b/src/content/docs/grammar/active-passive-transitive-intransitive.mdx @@ -0,0 +1,5 @@ +--- +title: Active and Passive, Transitive and Intransitive +--- + +This was really cool to learn. diff --git a/src/content/docs/grammar/intro.mdx b/src/content/docs/grammar/intro.mdx index b420ce9..b44fc53 100644 --- a/src/content/docs/grammar/intro.mdx +++ b/src/content/docs/grammar/intro.mdx @@ -1,5 +1,7 @@ --- title: Grammar Introduction +sidebar: + order: 1 --- Yo yo. diff --git a/src/content/docs/how-i-built-this/index.mdx b/src/content/docs/how-i-built-this/index.mdx new file mode 100644 index 0000000..462d854 --- /dev/null +++ b/src/content/docs/how-i-built-this/index.mdx @@ -0,0 +1,11 @@ +--- +title: "Hindki Architecture Overview" +--- + +One could certainly argue that Hindki is as much about procrastinating learning Hindi by setting up an elaborate website as it is, about, well, learning Hindi. + +The major decisions that led to this site, and are elaborated in the next few pages, were: + +- Using Astro, the static site generator, to (mostly) focus on ease of adding content. I'm using Starlight, which is basically a theme for Astro that comes with some components, sane defaults, and probably more that I'm not taking advantage of. +- Overriding the fonts to look more like how I would typeset a book using (Xe)LaTeX. +- Keeping track of vocabulary in a YAML file, and generating the vocabulary pages quasi-dynamically during the build phase of static site generation. In other words, I didn't want to have to hand-write each page (because I kept changing my mind about how the entries would look, and it quickly became clear that I should use reusable components), but I also didn't want to use a heavy/full-featured CRUD backend, because at the end of the day, this site is _just content_. diff --git a/src/content/docs/how-i-built-this/roadmap.mdx b/src/content/docs/how-i-built-this/roadmap.mdx new file mode 100644 index 0000000..f0c1e67 --- /dev/null +++ b/src/content/docs/how-i-built-this/roadmap.mdx @@ -0,0 +1,14 @@ +--- +title: "Roadmap" +--- + +Ultimately, creating a knowledge base of the vocab I've learned and writing down the grammar rules in my own voice is _kind of_ cool, but the reason I was motivated to do "something with Hindi and programming" in the first place was because Anki wasn't quite dynamic enough for the flashcard practicing I wanted to do. + +At first, I tried building the LLM part first, but I'm happy with the fact that this time, I've focused on documenting what I've learned first, and will try to plug in an LLM after. + +The hope is that because I have a YAML file as the source of truth of what words I know, it'll be even easier for a machine to figure my level out than if it had to traverse the generated files (though it can certainly do that too, I guess). + +Here are some things I've thought about adding, which I'll put here for some kind of posterity/future reference. + +- **Chat with a page.** Who knows how useful this would be, but on a grammar page for instance, it could be interesting to have an easily-accessible (like the search box) way to access an LLM to ask for clarifications or something. +- **Quiz me.** This is the actual main killer feature I want to build. Think: generating sentences using words I know; asking me to write (or say?) things in Hindi and making sure I use the right gender, the oblique forms where needed, etc; and of course, simple spaced repetition to memorize word lists. diff --git a/src/content/docs/index.mdx b/src/content/docs/index.mdx index 39352f5..ea55b84 100644 --- a/src/content/docs/index.mdx +++ b/src/content/docs/index.mdx @@ -8,7 +8,10 @@ head: hero: tagline: Welcome to Hindki! actions: - - text: Jump In + - text: Grammar Reference + link: /grammar + icon: open-book + - text: Vocabulary link: /vocabulary icon: right-arrow - text: Hindi Textbook (260 MB) @@ -20,7 +23,7 @@ hero: rel: noopener --- -## हिंदकी के बारे में +## हिंदकी के बारे में / _About Hindki_ Hindki is a collection of my personal notes on learning Hindi, and an evolving knowledge base that (maybe, hopefully) I can one day use as the backend of an AI-powered language tutor. If it helps you too, बढ़िया! @@ -28,6 +31,8 @@ It includes a dictionary, grammar notes, and other resources I've found helpful As I learn more Hindi, I'll convert this and the rest of the interface to Hindi as well. -### इसका नाम क्यों "हिंदकी"? +### इसका नाम क्यों "हिंदकी"? / _Why the name 'Hindki'?_ -The name "Hindki" is a play on the words "Hindi" and "Anki", because I was initially building this as a personal flashcard system similar to [Anki](https://apps.ankiweb.net/), but for Hindi. It also kind of works as a Hindi adjective meaning "related to Hindi" (in fact, [this word exists in Persian](https://translate.google.com/?sl=fa&tl=en&text=%D9%87%DB%8C%D9%86%D8%AF%D9%82%DB%8C%20&op=translate)), and it is also a sort of "wiki", since it's a knowledge base. All very satisfying. +The name "Hindki" is a play on the words "Hindi" and "Anki", because I was initially building this as a personal flashcard system similar to [Anki](https://apps.ankiweb.net/), but for Hindi. It also kind of works as a Hindi adjective meaning "related to Hindi" (in fact, [this word exists in Persian](https://translate.google.com/?sl=fa&tl=en&text=%D9%87%DB%8C%D9%86%D8%AF%D9%82%DB%8C%20&op=translate)), and it is also a sort of "wiki", since it's a knowledge base. Finally, if you needed yet another pun, it's the "key" to my Hindi education. All very satisfying. + +As for whether it's actually a good name, I'll let you be the judge. diff --git a/src/content/docs/vocabulary/datetime.mdx b/src/content/docs/vocabulary/datetime.mdx deleted file mode 100644 index fedf3c0..0000000 --- a/src/content/docs/vocabulary/datetime.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Dates and Times ---- - -When specifying a point in time, generally, को is used, e.g. रात को, सोमवार को. However, for some reason, सुबह में is used instead. - -## General words - -Words for the various units of date and time. - -Starting off strong with: - -- तारिख / _Date_ -- **Time** / समय diff --git a/src/content/docs/vocabulary/education.mdx b/src/content/docs/vocabulary/education.mdx deleted file mode 100644 index bbff641..0000000 --- a/src/content/docs/vocabulary/education.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Education ---- - -Learning about learning. - -## Roles - -- शिक्षक / _teacher_ -- चात्र / _student_ diff --git a/src/content/docs/vocabulary/food_drink.mdx b/src/content/docs/vocabulary/food_drink.mdx deleted file mode 100644 index 563d90d..0000000 --- a/src/content/docs/vocabulary/food_drink.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Food and Drink ---- - -जो खाएं और पिये जाते हैं. - -## Nouns - -- - -## Verbs diff --git a/src/content/docs/vocabulary/index.mdx b/src/content/docs/vocabulary/index.mdx index 94b0679..9f6dbe5 100644 --- a/src/content/docs/vocabulary/index.mdx +++ b/src/content/docs/vocabulary/index.mdx @@ -1,7 +1,7 @@ --- -title: Index +title: Vocabulary --- -## Welcome to the Hindki Docs! +This is the dictionary I've cultivated with all the words I've learned in Hindi. -Test test test. +If it's useful to you, great! I'm not even sure it'll be useful to me. diff --git a/src/content/docs/vocabulary/media.mdx b/src/content/docs/vocabulary/media.mdx deleted file mode 100644 index 7ccbe3e..0000000 --- a/src/content/docs/vocabulary/media.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Media ---- - -import VocabWord from "@/components/VocabWord.astro"; - -जो पढ़ीं और देखीं जाते हैं. - -## Reading words - -- - -## Viewing words diff --git a/src/content/docs/vocabulary/substances.mdx b/src/content/docs/vocabulary/substances.mdx deleted file mode 100644 index 7cc6069..0000000 --- a/src/content/docs/vocabulary/substances.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Elements and Substances ---- - -Stuff in the world. - -## Elements - -- आग / _fire_ diff --git a/src/pages/edit/index.astro b/src/pages/edit/index.astro new file mode 100644 index 0000000..60f942a --- /dev/null +++ b/src/pages/edit/index.astro @@ -0,0 +1,9 @@ +--- +import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"; + + +--- + + +

    Edit Hindki

    +
    \ No newline at end of file diff --git a/src/pages/vocab/[category].astro b/src/pages/vocabulary/[category].astro similarity index 91% rename from src/pages/vocab/[category].astro rename to src/pages/vocabulary/[category].astro index 5fd05e8..cfc4df0 100644 --- a/src/pages/vocab/[category].astro +++ b/src/pages/vocabulary/[category].astro @@ -1,6 +1,7 @@ --- import { getCollection, getEntry } from 'astro:content'; import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; + import AnchorHeading from '@astrojs/starlight/components/AnchorHeading.astro'; import VocabWord from '@/components/VocabWord.astro'; function titlecase(str: string) { @@ -48,7 +49,7 @@ const headings = wordsByType.map(({type, words}) => { { wordsByType.map(({type, words}) => (
    -

    {type}

    + {type}
      { words.map((word) => ( diff --git a/src/styles/custom.css b/src/styles/custom.css index 85c8910..b2a92a4 100644 --- a/src/styles/custom.css +++ b/src/styles/custom.css @@ -178,7 +178,7 @@ blockquote, .prose, .sl-markdown-content { font-family: var(--font-serif); - font-size: 1.5rem; /* 18px, up from default 16px */ + font-size: 1.25rem; /* 18px, up from default 16px */ } /* UI elements remain sans-serif */ @@ -233,9 +233,9 @@ h6, top: -0.1em; } -.word-examples > p { +/* .word-examples > p { font-size: 0.9em; -} +} */ .word-entry a { text-decoration: none; diff --git a/src/vocab_list.yaml b/src/vocab_list.yaml index 7ad866b..6f7fa92 100644 --- a/src/vocab_list.yaml +++ b/src/vocab_list.yaml @@ -21,6 +21,15 @@ english: help hindi: मदद gender: f + note: Used with का/के/की to indicate who is receiving help, and with either करना (to actively help someone), or होना (to passively be helped). See the links below for the generalized rules of these. + see_also: + - "[Reflexive verbs](/grammar/reflexive-verbs)" + - "[Active and passive, transitive and intransitive](/grammar/active-passive-transitive-intransitive)" + examples: + - hindi: "मेरी मदद किजिए." + english: "Please help me." + - hindi: "क्या आपकी मदद हुई है?" + english: "Have you been helped?" - slug: repetition about: Hindi often uses repetition of words for emphasis or to indicate a variety of related meanings. words: