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

frontmatters scoped path #39

@FuckDoctors

Description

@FuckDoctors

Feature request

What problem does this feature solve?

With these settings:

frontmatters: [
  {
    // Unique ID of current classification
    id: 'tag',
    // Decide that the frontmatter keys will be grouped under this classification
    keys: ['tag', 'tags'],
    // Path of the `entry page` (or `list page`)
    path: '/tag/',
    frontmatter: { title: 'Tag' },
    layout: 'BlogTagsLayout',
    // Layout of the `scope page`
    scopeLayout: 'BlogTagLayout'
  },
  {
    // Unique ID of current classification
    id: 'en_tag',
    // Decide that the frontmatter keys will be grouped under this classification
    keys: ['tag', 'tags'],
    // Path of the `entry page` (or `list page`)
    path: '/en/tag/',
    frontmatter: { title: 'Tag' },
    layout: 'BlogTagsLayout',
    // Layout of the `scope page`
    scopeLayout: 'BlogTagLayout'
  }
]

I got:

[@vuepress/plugin-blog] ====== Automatically Added Index Pages ======
permalink               meta                                   pid     id             frontmatter
/tag/                   {"pid":"tag","id":"tag"}                                      {"layout":"BlogTagsLayout","title":"Tag"}
/en/tag/                {"pid":"en_tag","id":"en_tag"}                                {"layout":"BlogTagsLayout","title":"Tag"}
/tag/vuepress/          {"pid":"tag","id":"vuepress"}          tag     vuepress       {"layout":"BlogTagLayout","title":"vuepress tag"}
/tag/vuepress-blog/     {"pid":"tag","id":"vuepress-blog"}     tag     vuepress-blog  {"layout":"BlogTagLayout","title":"vuepress-blog tag"}
/tag/js/                {"pid":"tag","id":"js"}                tag     js             {"layout":"BlogTagLayout","title":"js tag"}
/en_tag/vuepress/       {"pid":"en_tag","id":"vuepress"}       en_tag  vuepress       {"layout":"BlogTagLayout","title":"vuepress en_tag"}
/en_tag/vuepress-blog/  {"pid":"en_tag","id":"vuepress-blog"}  en_tag  vuepress-blog  {"layout":"BlogTagLayout","title":"vuepress-blog en_tag"}
/en_tag/js/             {"pid":"en_tag","id":"js"}             en_tag  js             {"layout":"BlogTagLayout","title":"js en_tag"}

Expected:

...
/en/tag/vuepress/       {"pid":"en_tag","id":"vuepress"}       en_tag  vuepress       {"layout":"BlogTagLayout","title":"vuepress en_tag"}
/en/tag/vuepress-blog/  {"pid":"en_tag","id":"vuepress-blog"}  en_tag  vuepress-blog  {"layout":"BlogTagLayout","title":"vuepress-blog en_tag"}
/en/tag/js/             {"pid":"en_tag","id":"js"}             en_tag  js             {"layout":"BlogTagLayout","title":"js en_tag"}

What does the proposed API look like?

Like Dynamic Route Matching.

How should this be implemented in your opinion?

How about modifying these lines:
https://github.com/vuepressjs/vuepress-plugin-blog/blob/c156e91cafd090aa77f64b144fe58b545e0789a3/src/node/util.ts#L25
https://github.com/vuepressjs/vuepress-plugin-blog/blob/566aa380b611f6d25ebd0000ac3552736fcd03a9/src/node/index.ts#L134

Are you willing to work on this yourself?

I want to if I can...


Sorry for bad English.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions