0

I have been code a Hexo theme recently, now I stuck with the variables. I read the doc, but could not get much info.

For example: On the last paragraph of the variables of the doc:

Tag (tag): Same as index layout but add the following variables.

Variable    Description
page.tag    Tag name

Is this means I could use 'page.tag' in tag layout? But what made a tag layout?

I have created a tag.jade, and a page named tags using tag.jade, and I also add some test tags in other articles,

In my tag.jade, I have p= page.tag But there is nothing output.

Also, the doc says

Same as index layout

But try to use page.posts ( I can use it in index.jade) in tag.jade, but undefined,

So What does it mean Tag (tag) in the doc, is it the scope of the variables? what makes these scope?

Sorry for my writings, I am really comfused about these variables.

sfy
  • 2,810
  • 1
  • 20
  • 22

1 Answers1

0

You may have misunderstood the tag layout.

A tag layout is used for generate a tag cloud page, like my blog: http://blog.xcatliu.com/tags/

You don't need to write a page which layout is tag, instead, you can use https://github.com/hexojs/hexo-generator-tag to generate the tag page.

xcatliu
  • 791
  • 7
  • 19