Using .Site variables within .md content?

Hi, I wonder if someone might let me know if I am approaching this correctly or not?

I have many short text variables which I would like to make accessible throughout my site so that they can be updated within all content segments. In order to do this, I currently:

  1. Define the new variable in my config.toml file

  2. Create a new shortcode .html file where the new variable is referenced

  3. Refer to the shortcode .html file by name within my actual content block / .md file

So I am wondering if I have that correct? Is it correct that each variable will always require its own shortcode file to go along with it? I would like to make sure I am understanding and that this is the right way to do this, as it doesn’t seem quite right to me? It seems like I will end up with a lot of duplicate files / references? But perhaps that is normal and expected?

thanks so much for any advice or pointers on the best practice for something like this.

You can’t place template code with markdown. Use the built-in param shortcode.


ah! Thank you so much @jmooring - that was just what I was looking for!

thank you

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.