...using a shortcode.
Say you maintain a Keywords file in your data folder data/keywords.yml with some contents:
catname: Frisky
dogname: Spot
pets: |
Pets are very
silly animals
aren't they?Add this shortcode to layouts/shortcodes/kwd.html:
{{ $key := .Get 0 }}{{ $val := index .Site.Data.keywords $key }}{{ $val }}Now, in your posts, you can easily access those keyword variables:
That crazy cat, {{% kwd catname %}}, just lept up and pounced right
on {{% kwd dogname %}}, the poor pooch. {{% kwd pets %}}