Skip to content

[Question] Can we read information from environment variables? #1144

Answered by MasterOdin
tomkerkhove asked this question in General
Discussion options

You must be logged in to vote

I would recommend using JavaScript to change things dynamically on load as Slate does not offer dynamic content out of the box as it's only really for static generation. You can embed the environment variable into the layout.erb using <%=ENV['foo'] %> and if you want it in a markdown file, you can enable ERB (https://github.com/slatedocs/slate/wiki/Embedding-Ruby-in-Markdown).

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tomkerkhove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1144 on May 20, 2020 22:07.