Closed reggi closed 10 years ago
OK. I'll try to implement this feature in 2.7.
@tommy351 THIS
Seriously, this could be awesome. I could use a variable named language
to define the post language, reflect it on the permalink, write a theme which queries posts by language
variable and we'll be so close to resolve this: #474 :smiley:
I think it would also be wise to have some kind of "Hook" that allowed plugins to manipulate these variables before they're used, kind of like a "Middleware". This would allow me to have a post named hello-world.md
which is mapped to :title
and have the title be rendered out as Hello World
(rather then hello world
) in my blog post without any redundant YML front-matter or functions within the layout, could also be used to manipulate date with moment.js. Thoughts on this?
@reggi Hexo has "Filter" currently. But it's still weak. This part will be enhanced in future.
This feature will be released in 2.8.
:D great! El jul 6, 2014 5:52 a.m., "SkyArrow" notifications@github.com escribió:
This feature will be released in 2.8.
— Reply to this email directly or view it on GitHub https://github.com/hexojs/hexo/issues/649#issuecomment-48106393.
Thank you so much for implementing. This works like a charm! :thumbsup:
This is a feature request, for a way to standardize the variable system. It revolves around the idea that any variable can be set within the post file-name and within the YML front-matter and that these variables can be both used in the layouts and in the permalink, (any place a variable can be used).
Here's an example of my
config
file.Given the example file name:
It's rendering out the url to:
I would expect it to be:
It would be nice if the YML front-matter variables could be used for the permalink as well (a priority would need to take place between file-name and front-matter).
for instance.
Or without setting it in the
md
post and it just being in the file name, being able to use thecrazyid
variable within the template / layout would be more universal.