SukkaW on master
feat(helper/toc): more flexible… (compare)
SukkaW on master
chore(test/extend/tag): async f… (compare)
SukkaW on master
feat(helper/is): add `is_home_f… (compare)
How to properly regsiter a filter?
Following documentation on the website:
hexo.extend.filter.register('before_post_render', function (data) {
console.log(Object.keys(data))
console.log(data)
data.title = data.title.toUpperCase()
return data
})
Doesn't log anything which means it's not being executed.
categories1 - post1,categories2 - post2
before_generate
, but it runs after before_post_render
.
before_post_render
on every site rebuild, i.e. if I run hexo server
and change anything, I’d like to have a filter that runs before everything starting generating.
Looking at moving a site from Hugo to Hexo and I'm currently a little confused about permalinks and the generated output. When I call url_for(page.path)
in a template, it correctly outputs directory/page-name
, but the output files are directory/page-name.html
. With Hugo, I would instead get directory/page-name/index.html
.
I tried building the source code for the Hexo website and it looks like it also generates directory/page-name.html
, but the served site works fine with directory/page-name
. I'm guessing it's using URL rewriting on the server to handle that.
Basically I'm wondering if there's any way to get the generated files to be directory/page-name/index.html
, but I can't seem to find any documentation around this. Is the expectation that you simply let the server do the rewrites? (I found it weird that hexo server
doesn't handle the configured permalinks that way, but that made me suspect that maybe my configuration is all wrong...)
{
and }
?