Instructions for managing vocabulary notes in the dictionary system
This guide explains how to use the dictionary system for managing vocabulary notes with English-Urdu translations using YAML data files and accordion rendering.
The dictionary system consists of:
content/docs/dictionary/[topic]/index.mddata/dictionary/[topic]/vocabulary.yaml 1.
2├── content/docs/dictionary/
3│ ├── _index.md # Main dictionary index
4│ └── [topic-name]/
5│ └── index.md # Topic page (renders from data)
6│
7├── data/dictionary/
8│ └── [topic-name]/
9│ └── vocabulary.yaml # Vocabulary data
10│
11├── layouts/shortcodes/
12│ ├── vocabulary-accordion.html # Accordion renderer
13│ └── vocabulary-list.html # Table renderer
14│
15└── archetypes/
16 └── dictionary.md # Template for new pages
Use Hugo’s archetype command:
1hugo new content/docs/dictionary/[topic-name]/index.md --kind dictionary
Example:
1hugo new content/docs/dictionary/ibm-rag-course/index.md --kind dictionary
Create the YAML file structure:
1mkdir -p data/dictionary/[topic-name]
2touch data/dictionary/[topic-name]/vocabulary.yaml
Edit content/docs/dictionary/[topic-name]/index.md:
1---
2title: "RAG Course Vocabulary"
3linkTitle: "RAG Course"
4description: |
5 Vocabulary from IBM RAG and Agentic AI Course
6sourceType: course
7sourceName: "IBM RAG and Agentic AI Professional Certificate"
8topic: "RAG, LangChain, Vector Databases"
9tags:
10 - vocabulary
11 - rag
12 - ai
13categories:
14 - dictionary
15 - courses
16series:
17 - Dictionary
18nav_weight: 3
19---
Update the shortcode reference:
1{{< vocabulary-accordion "dictionary.ibm-rag-course.vocabulary" >}}
1- word: string # Required: The English word
2 part_of_speech: string # Required: noun, verb, adjective, etc.
3 urdu_meaning: string # Required: Urdu translation
4 example_en: string # Required: English example sentence
5 example_ur: string # Required: Urdu example sentence
6 additional_example_ur: string # Optional: Additional Urdu example
Note: Tags and categories are managed in the page frontmatter (index.md), not in individual vocabulary entries.
1- word: retrieval
2 part_of_speech: noun
3 urdu_meaning: بازیافت، واپس لانا
4 example_en: Efficient retrieval of information is crucial for RAG systems.
5 example_ur: RAG سسٹمز کے لیے معلومات کی موثر بازیافت بہت اہم ہے۔
6 additional_example_ur: ڈیٹا بیس سے دستاویزات کی بازیافت تیزی سے ہونی چاہیے۔
7
8- word: embedding
9 part_of_speech: noun
10 urdu_meaning: سرایت، پیوستگی، ویکٹر نمائندگی
11 example_en: Text embeddings convert words into numerical vectors.
12 example_ur: ٹیکسٹ ایمبیڈنگز الفاظ کو عددی ویکٹرز میں تبدیل کرتی ہیں۔
noun, verb, adjective, adverbnoun/verb (for words with multiple uses)phrase, technical-term, abbreviationBest for: Detailed vocabulary with multiple examples
Usage:
1{{< vocabulary-accordion "dictionary.topic-name.vocabulary" >}}
Features:
Example:
1{{< vocabulary-accordion "dictionary.army-and-war.vocabulary" >}}
Best for: Quick reference, printable format
Usage:
1{{< vocabulary-list "dictionary.topic-name.vocabulary" >}}
Features:
Example:
1{{< vocabulary-list "dictionary.css-course-week-1.vocabulary" >}}
| Use Accordion When | Use List When |
|---|---|
| Many words (>20) | Few words (<15) |
| Detailed examples needed | Quick reference needed |
| Mobile-friendly view preferred | Desktop view with space |
| Progressive disclosure wanted | Everything visible at once |
Pattern:
1data/dictionary/[topic-name]/vocabulary.yaml
Shortcode Reference:
1"dictionary.[topic-name].vocabulary"
Examples:
| File Path | Shortcode Reference |
|---|---|
data/dictionary/army-and-war/vocabulary.yaml | "dictionary.army-and-war.vocabulary" |
data/dictionary/css-course-week-1/vocabulary.yaml | "dictionary.css-course-week-1.vocabulary" |
data/dictionary/ibm-rag/vocabulary.yaml | "dictionary.ibm-rag.vocabulary" |
Rules:
Open relevant YAML file: data/dictionary/[topic]/vocabulary.yaml
Add new entry at the end:
1- word: newword
2 part_of_speech: noun
3 urdu_meaning: نیا لفظ
4 example_en: This is the new word in a sentence.
5 example_en: This is the new word in a sentence.
6 example_ur: یہ جملے میں نیا لفظ ہے۔
Save and rebuild site
If you have vocabulary in markdown format:
Old format (manual markdown):
1## abandon
2- **part of speech:** verb
3- **urdu meaning:** چھوڑ دینا
4- **example:** He decided to abandon...
Convert to YAML:
1- word: abandon
2 part_of_speech: verb
3 urdu_meaning: چھوڑ دینا، ترک کرنا
4 example_en: He decided to abandon the project.
5 example_ur: اس نے منصوبہ چھوڑ دیا۔
Note: Tags are used in page frontmatter (index.md) for categorization, not in individual vocabulary YAML entries.
css, military, programming, ai1title: "Topic Vocabulary" # Display title
2linkTitle: "Short Name" # Navigation/sidebar
3description: | # SEO & summary
4 Detailed description...
5type: docs # Use 'docs' for dictionary
6sourceType: course # course, book, video, article
7sourceName: "Course/Book Name" # Full name of source
8topic: "Main Subject" # Key topic/domain
1nav_weight: 1 # Sidebar order
2nav_icon: # Custom icon
3 vendor: bootstrap
4 name: book
5 color: '#e24d0e'
6
7menu: # Add to main menu
8 main:
9 weight: 100
10 params:
11 icon:
12 vendor: bs
13 name: book
14
15draft: false # Publish status
16noindex: false # SEO indexing
The dictionary system uses Jameel Noori Nastaleeq font for authentic Urdu text rendering. This professional Nastaliq-style font is locally hosted for better performance and control.
1static/fonts/
2├── Jameel-Noori-Nastaleeq.ttf # 14MB TrueType font
3└── README.md # Installation guide
Both vocabulary shortcodes include embedded CSS with @font-face declarations:
Files:
layouts/shortcodes/vocabulary-accordion.htmllayouts/shortcodes/vocabulary-list.htmlFont Stack:
1@font-face {
2 font-family: 'Jameel Noori Nastaleeq';
3 src: url('/fonts/Jameel-Noori-Nastaleeq.ttf') format('truetype');
4 font-weight: normal;
5 font-style: normal;
6 font-display: swap;
7}
8
9.urdu-text {
10 font-family: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', 'Al Qalam Quran Majeed', 'Scheherazade New', serif;
11 font-size: 1.4em; /* Accordion size */
12 line-height: 2.2; /* Improved readability */
13 font-weight: normal; /* Authentic Nastaliq rendering */
14 word-spacing: 0.2em; /* Better word separation */
15}
List shortcode uses slightly smaller sizing:
1.vocabulary-list .urdu-text {
2 font-size: 1.3em; /* Compact for table view */
3 line-height: 2.2;
4 word-spacing: 0.2em;
5}
✅ Jameel Noori Nastaleeq (Primary)
✅ Fallback Fonts (if primary fails):
✅ Typography Settings:
If font is missing, follow instructions in static/fonts/README.md:
static/fonts/Jameel-Noori-Nastaleeq.ttfTo adjust word spacing, edit the shortcode files:
1.urdu-text {
2 word-spacing: 0.3em; /* Increase for more space */
3}
To change font size:
1.urdu-text {
2 font-size: 1.5em; /* Larger text */
3}
To add letter spacing:
1.urdu-text {
2 letter-spacing: 0.02em; /* Subtle character spacing */
3}
Accordion buttons use Bootstrap variables:
1.vocabulary-accordion .accordion-button:not(.collapsed) {
2 background-color: var(--bs-primary-bg-subtle);
3 color: var(--bs-primary-text);
4}
Problem: Blank space where vocabulary should appear
Solutions:
data/dictionary/[topic]/vocabulary.yaml existshugo server --disableFastRenderProblem: Boxes or garbled text instead of Urdu
Solutions:
dir="rtl" attribute is presentProblem: All items expanded or no interaction
Solutions:
Problem: Hugo build fails with YAML errors
Solutions:
v1.2 (Latest) - Font & Typography Enhancements
Git commit: b3c2e95d - feat: improve Urdu text rendering with Jameel Noori font
v1.1 - System Refinement
Git commit: 1411feab - refactor: improve dictionary system
v1.0 - Initial Release
Git commit: 10f078ba - feat: implement dictionary system
Why local font hosting?
Why remove italic styling?
Why word-spacing: 0.2em?
Why larger font sizes?
File: data/dictionary/army-and-war/vocabulary.yaml
1- word: battalion
2 part_of_speech: noun
3 urdu_meaning: فوجی دستہ، بٹالین
4 example_en: The battalion was deployed to the border.
5 example_ur: بٹالین کو سرحد پر تعینات کیا گیا۔
Page: content/docs/dictionary/army-and-war/index.md
1{{< vocabulary-accordion "dictionary.army-and-war.vocabulary" >}}
1# Create new dictionary topic
2hugo new content/docs/dictionary/[topic]/index.md --kind dictionary
3
4# Create data directory
5mkdir -p data/dictionary/[topic]
6
7# Create vocabulary file
8touch data/dictionary/[topic]/vocabulary.yaml
9
10# Start dev server
11npm run dev:memory
12
13# Build production
14npm run build:production-fast
15
16# Validate YAML online
17# Visit: http://www.yamllint.com/
For issues or enhancements:
/data/dictionary/Last Updated: {{ now.Format “2006-01-02” }}
Version: 1.0
Status: Active