Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

require title keyword for frontmatters #52

Closed
yuchanns opened this issue Jan 5, 2020 · 2 comments · Fixed by #55
Closed

require title keyword for frontmatters #52

yuchanns opened this issue Jan 5, 2020 · 2 comments · Fixed by #55

Comments

@yuchanns
Copy link
Contributor

yuchanns commented Jan 5, 2020

Feature request

What problem does this feature solve?

give users customized title in tags page

What does the proposed API look like?

when people use plugin like this:

plugins: [
  [
    '@vuepress/blog',
    {
      frontmatters: [
        id: 'tags',
        keys: ['tags'],
        path: '/tags/',
        layout: 'Tag',
        scopeLayout: 'Tag',
        title: '标签'
      ]
    }
  ]
]

then they shall see the html <title> element when visit /tags/anyTag like anyTag 标签 | $siteTitle.

How should this be implemented in your opinion?

Do not know

Are you willing to work on this yourself?

@billyyyyy3320
Copy link
Member

Actually, the title is generated by id. Try:

      frontmatters: [
        {
          id: "標籤",
          keys: ['tag'],
          path: '/tag/',
        },
      ],

@yuchanns
Copy link
Contributor Author

yuchanns commented Jan 5, 2020

Actually, the title is generated by id. Try:

      frontmatters: [
        {
          id: "標籤",
          keys: ['tag'],
          path: '/tag/',
        },
      ],

I have tried this way before the issue, and it caused another problem: I got the global computed variable like $标签.But what I want is that I can always use the variable as $tags and I am able to custom the <title> element in any language anytime without changing my code to adapt the changing variable name:)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants