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

feat: generate paths of frontmatter scope pages properly (fix #39) #40

Merged
merged 3 commits into from
Dec 7, 2019
Merged

feat: generate paths of frontmatter scope pages properly (fix #39) #40

merged 3 commits into from
Dec 7, 2019

Conversation

FuckDoctors
Copy link
Contributor

Summary

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of default theme, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)

You have tested in the following browsers: (Providing a detailed version will be better.)

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated
  • Related tests have been updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

src/node/util.ts Outdated
return (key, pageKey) => {
if (key) {
if (!map[key]) {
map[key] = {}
map[key].key = key
map[key].scope = scope
map[key].path = `/${scope}/${key}/`
map[key].path = path ? `${path}${key}` : `/${scope}/${key}/`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Since path is required, the condition will never be false.
  2. The slash in the end is missing.
Suggested change
map[key].path = path ? `${path}${key}` : `/${scope}/${key}/`
map[key].path = `${path}${key}/`

src/node/index.ts Outdated Show resolved Hide resolved
@FuckDoctors
Copy link
Contributor Author

@newsbielt703
Sorry for that, I'm a beginner of VuePress.
Now fixed according to your comments.

@billyyyyy3320
Copy link
Member

@FuckDoctors Don't feel sorry. We're grateful for your contribution.

@billyyyyy3320 billyyyyy3320 changed the title feat: Support frontmatters scoped path (fix #39) feat: generate paths of frontmatter scope pages properly (fix #39) Dec 7, 2019
@billyyyyy3320 billyyyyy3320 merged commit 094ecc0 into vuepress:master Dec 7, 2019
billyyyyy3320 pushed a commit that referenced this pull request Dec 7, 2019
* feat: Support frontmatters scoped path (#39)

* fix: frontmatters scopeLayout path

* refactor: clean code
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants