Closed leesei closed 9 years ago
It should be a bug.
Having similar issue. I used the is_post()
helper function in my layout to change some styling, but all the generated html files were treated as if is_post()
is true, even home page, categories page...
This should be fixed by commit 62f521b.
http://hexo.io/docs/helpers.html#is_post
I believe
is_post()
should return true only if we are at a page rendered fromsource
.But if we set
then the regex in
is_post()
(lib/plugins/helper/is.js#L40-58) is/[^\/]+\//
which yields true for practically all URLs with trailing/
(including/tags/foo
).Is this a bug or by design?