Quick commands and patterns for dictionary vocabulary management
1# 1. Create content page
2hugo new content/docs/dictionary/[topic-name]/index.md --kind dictionary
3
4# 2. Create data file
5mkdir -p data/dictionary/[topic-name]
6touch data/dictionary/[topic-name]/vocabulary.yaml
7
8# 3. Edit content page and update shortcode reference
9# 4. Add vocabulary entries to YAML file
1- word: example
2 part_of_speech: noun
3 urdu_meaning: مثال
4 example_en: This is an example sentence.
5 example_ur: یہ ایک مثالی جملہ ہے۔
6 additional_example_ur: مزید مثال (optional)
Note: Tags are handled in the page frontmatter, not in individual vocabulary entries.
1{{< vocabulary-accordion "dictionary.topic-name.vocabulary" >}}
1{{< vocabulary-list "dictionary.topic-name.vocabulary" >}}
content/docs/dictionary/
└── [topic-name]/
└── index.md ──┐
│ References
data/dictionary/ │
└── [topic-name]/ │
└── vocabulary.yaml ←┘
| Data File | Shortcode Reference |
|---|---|
data/dictionary/army-and-war/vocabulary.yaml | "dictionary.army-and-war.vocabulary" |
data/dictionary/css-week-1/vocabulary.yaml | "dictionary.css-week-1.vocabulary" |
data/dictionary/rag-course/vocabulary.yaml | "dictionary.rag-course.vocabulary" |
Rule: Replace / with . and use hyphens
Latest (v1.2) - Typography Improvements
Key Files Changed:
layouts/shortcodes/vocabulary-accordion.htmllayouts/shortcodes/vocabulary-list.htmlstatic/fonts/Jameel-Noori-Nastaleeq.ttf (new)Git: b3c2e95d - feat: improve Urdu text rendering
static/fonts/Jameel-Noori-Nastaleeq.ttf # Primary Urdu font
static/fonts/README.md # Installation guide
Accordion styling: layouts/shortcodes/vocabulary-accordion.html
.urdu-text class: lines 92-98List styling: layouts/shortcodes/vocabulary-list.html
.vocabulary-list .urdu-text class: lines 52-58 1/* Main Urdu text styling */
2.urdu-text # Accordion Urdu text
3.vocabulary-list .urdu-text # List Urdu text
4
5/* Container classes */
6.vocabulary-accordion # Accordion wrapper
7.vocabulary-list # List wrapper
8
9/* Bootstrap accordion */
10.accordion-button # Accordion header
11.accordion-body # Accordion content
1/* Accordion */
2font-size: 1.4em
3line-height: 2.2
4word-spacing: 0.2em
5
6/* List */
7font-size: 1.3em
8line-height: 2.2
9word-spacing: 0.2em
❌ Font not loading?
ls -lh static/fonts/Jameel-Noori-Nastaleeq.ttf❌ Urdu text looks wrong?
dir="rtl" in shortcode 1# Start dev server
2npm run dev:memory
3
4# Build production
5npm run build:production-fast
6
7# Create from archetype
8hugo new content/docs/dictionary/[topic]/index.md --kind dictionary
9
10# Check Hugo version
11hugo version
12
13# Validate YAML (online)
14# Visit: http://www.yamllint.com/
noun - Naming wordverb - Action wordadjective - Descriptive wordadverb - Modifies verb/adjectivephrase - Multi-word expressionnoun/verb - Multiple usestechnical-term - Specialized vocabularyabbreviation - Shortened formNote: Use these tags in the page frontmatter (index.md), not in vocabulary YAML data.
vocabulary, dictionary, military, technical, businessprogramming, ai, devops, css, web-developmentcourse, book, video, article, documentationbeginner, intermediate, advanced, reference| Issue | Solution |
|---|---|
| Shortcode not rendering | Check file path, rebuild with --disableFastRender |
| Urdu text broken | Verify UTF-8 encoding, check font loading |
| YAML error | Validate at yamllint.com, check indentation |
| Accordion not working | Verify Bootstrap JS loaded, check console |
| Wrong order | Use nav_weight in frontmatter |
1---
2title: "Topic Vocabulary"
3linkTitle: "Short Name"
4description: |
5 Brief description
6type: docs
7sourceType: course # course, book, video, article, general
8sourceName: "Full Source Name"
9topic: "Main Subject"
10tags:
11 - vocabulary
12 - your-topic
13categories:
14 - dictionary
15series:
16 - Dictionary
17nav_weight: 1
18---
ibm-rag-course not course1/data/dictionary/Pro Tip: Keep this file bookmarked for quick reference! 🔖