-
Notifications
You must be signed in to change notification settings - Fork 61
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
Dynamic site properties in base view model #126
Comments
Do you have a use-case you're trying to solve, it sounds like an interesting idea, would be good to know what your perspective is. |
Thanks for the feedback! The idea struck me when I realized that properties such author, blog title and site url was not available in the base view model, only in the post view model. I would like to use the model to render the name and owner of the site for example. This is usually done in the default layout but the those specific properties from snow.config are not available. The properties I mentioned above are already part of the configuration and should be possible to provide using the base view model. But there can be other properties that I would like to provide through the base view model such as user account urls for Twitter, GitHub, StackOverflow, Google+ etc. Those might not be of general interest of all Sandra Snow users but it would be nice to be able to configure them in one place and use them in the view models. This allows for more general themes that are more easily shared between users. |
I've thought about porting this from Jekyll: http://jekyllrb.com/docs/datafiles/
Wouldn't that cover your use case? |
Spot on! That would be awesome! |
This all sounds awesome. I wanted to add dynamic properties to posts but if we can add to global and posts. Would be great. I'm on holiday untill the 21st so can't help much till then. But keen for dynamic properties! -----Original Message----- Spot on! That would be awesome! |
I've started working on this, I don't have anything to base a PR off yet, and even then I think that there will be a bit of work involved before it's in a state where Phil will accept the pull. |
I would really love to see this coming on a next release 👍 |
Just like you can have dynamic properties on each post it would be nice to define dynamic site properties that are available on all pages. They could be defined in snow.config like this:
"properties": { "key1": "value1", "key2": "value2"}
This could be useful for themes when you do not want to hard code certain content.
The text was updated successfully, but these errors were encountered: