-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Outdated imports of variables from json file #2283
Comments
Hi @tlylt |
Sure 👍. Note that this issue is slightly more involved, thus when in doubt please consult the dev guide https://markbind-master.netlify.app/devguide/devguide |
Hi @ang-zeyu, do you still have the context for this variable feature?
|
The global variables file does not support
Site variables are available for use anywhere and override everything (it's a very odd behaviour.. #1261).
is this still in the docs somewhere? we should definitely remove if so.
not sure I understood this, having the idea of global variables is still very useful (e.g. in our docs). My only nit is the priority should be the opposite (why have something global override something more specific (nunjucks variables)? 👀) |
Thanks @ang-zeyu for the comment. Sorry because there are a few things here...let me clarify further to ensure that I understand what you mean:
As for global variable,
I wasn't proposing to remove it, just checking if it is still valid (since we are defining variables using the
(also p.s. pinging you on slack in case you didn't get notified :)) |
Yes, except:
+ site/global variables
Yes,
This is a Nunjucks feature, so where relevant, we should stick to the term "Nunjucks variable" as much as possible for context.
oh.. 👍
Not sure I understood this, I don't see it this way, the syntax is only a means to end. We have 3 types of variables
I think, global variables were the first to adopt that syntax as well, then page variables which are now removed. Imo, it is now inconsistent with
This is not supported inside it, so we could just remove those lines. (oversight in #1407) |
We should change this to "Nunjucks variables" and link there instead to be clear. |
Got it thanks.
Last qn, won't this be useful tho? So there's no way to globally import variables from a JSON file since we can't import it from variables.md? |
It could be, we can also think of how we want to achieve it with ⬇️
|
Okay sure will put up a separate issue for that 🙏 |
Please confirm that you have searched existing issues in the repo
Yes, I have searched the existing issues
Any related issues?
#2270, #1407
Tell us about your environment
Windows 10
MarkBind version
Master branch
Describe the bug and the steps to reproduce it
A warning is being logged when running
markbind serve/build
on a new site (that you can generate viamarkbind init
)This is because in our template, we are still using the deprecated way of importing variables from external json files.
This way has been removed in #1407 and the proper way should be the stated one in https://markbind.org/userGuide/reusingContents.html#importing-variables-from-other-external-file-formats
Expected behavior
markbind build
on a newly generated sitenpm run test
Anything else?
No response
The text was updated successfully, but these errors were encountered: