FAQ Feature Engineering Notes
The FAQ page is a static, client-side searchable interface. It generates content at build time using Jekyll data files but handles search and filtering dynamically in the browser using Alpine.js.
This approach ensures the page is SEO-friendly (all content is in the initial HTML) while remaining instant for the user (no page reloads when filtering).
| File | Description |
faq.html |
The main page template. Contains the Alpine.js logic and Jekyll Liquid loops. |
_data/faqs.yml |
The source of truth. Contains all questions, answers, and categories. |
assets/css/faq.css |
Specific styles for the FAQ page (loaded via extra_css front matter). |
/tools/convert_faq.py |
Utility script to convert Spreadsheet exports (TSV) into the YAML format. |
https://docs.google.com/spreadsheets/d/13x8hrf6-3-dst0Gj9lFsHAtxQHQPS2kIreVQMY7oeiw/edit?usp=sharing |
Google Sheet where CGs can maintain the FAQ easily, and then we use the tool to convert to a yml |
Build Time: Jekyll reads _data/faqs.yml and loops through it in faq.html. It renders every single FAQ item into the DOM.
Run Time: Alpine.js initializes with { searchTerm: '', selectedCategory: 'all' }.
Interactivity:
Search: The input binds to searchTerm.
Filter: Buttons bind to selectedCategory.
Visibility: Each FAQ item has an x-show directive that evaluates:
(categoryMatch) && (searchMatch)
Python 3.x installed.
Dependencies: The ruamel.yaml library is required to preserve block formatting.
# First time setup
python -m pip install ruamel.yaml
category (e.g., General, Rules, Downtime)
question (Plain text)
answer (HTML allowed)
Important Formatting Rules:
Newlines: Do not press Enter inside a cell. Use the character sequence \n to indicate a paragraph break.
Links: Use standard HTML anchors: <a href="...">Link</a> or [name of the link](link url). Note I tried to use relative internal links, but it doesn’t work. Adding code to try to accomodate it became too complex for what it’s worth.
No Tabs: Do not use tab characters within the text.
File > Download > Tab-separated values (.tsv). it will be named faqs - Sheet1.tsv by default
Save the file as faqs - Sheet1.tsv in the same folder as the Python script. (/tools))
Execute the script to generate the production YAML file (via your command prompt)
python convert_faq.py
tools/faqs - Sheet1.tsv (or root, depending on script config)_data/faqs.ymlCheck _data/faqs.yml to ensure the formatting looks correct.