I have a habit of constantly tinkering with my blog, and every now and then, it leads to a happy accident. I recently discovered that I can use Jekyll’s config.yml
to store custom variables. You may have already known about this, and I’m probably not the first to make this discovery, but I’m very excited about the possibilities.
The reason for the tinkering which led to the discovery is this: if you visit this website’s home page, about page, and footer section, you’ll notice that they all have some content in common. Specifically, my tag line and bio are used in many places, and copy-pasting them every time I change them is annoying and error-prone. On more than one occasion, my bio has been different on different pages of the website. This is why I wanted to figure out a way to define them as variables in one place and use them everywhere.
from DZone.com Feed https://ift.tt/3uiEMkD
No comments:
Post a Comment