Company Name As A Variable? #2012
Unanswered
chrisativonne
asked this question in
Q&A
Replies: 1 comment 8 replies
-
You could put it in a global data file, although that probably requires the use of a prefix. For example, if you had _data/site.json like this: {
"company_name": "ABC Widgets"
} You could reference it in your templates like And you should be able to create a global data file named "eleventyComputed.js" which might do the trick too. See https://www.11ty.dev/docs/data-computed/#advanced-details Or Eleventy v1 (currently in beta channel) will allow you to set global data programmatically in your config file: https://www.11ty.dev/docs/data-global-custom/ |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to add my company name as a variable? to each page, so that any references can easily be updated later.
What is the process to do this? e.g. Company name is ABC Widgets, and the company name is mentioned in various paragraphs throughout the website. I'd rather have {{company_name}} in the body reference one company_name.njk file?
Is this possible?
Beta Was this translation helpful? Give feedback.
All reactions