Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Generated router uses back slashes for permalink #103

Closed
Towerism opened this issue Oct 21, 2017 · 1 comment
Closed

Generated router uses back slashes for permalink #103

Towerism opened this issue Oct 21, 2017 · 1 comment
Assignees

Comments

@Towerism
Copy link

Towerism commented Oct 21, 2017

I am on windows.

My generated route looks like this:

		{
			path: "\\posts\\:year\\:slug",
			component: _0a3eb4af,
			name: "posts-slug"
		}

My config looks like this:

  nuxtent: {
    content: [
      ['posts', {
        page: 'posts/_slug',
        permalink: 'posts/:year/:slug',
        data: {
          author: 'Martin Fracker'
        }
      }]
    ]
  },

This is what I get from hitting the content-api endpoint:

{"content-endpoints":["\\posts"]}

If I manually edit the router and change the backslashes to forward slashes which is what they should be in the first place, then it works.

I tried this with the starter template as well and after removing the component in the markdown file to get rid of the module build fail warning, the same back slash is observed in the generated router.js file.

This question is available on Nuxt.js community (#c86)
@dahrens
Copy link
Contributor

dahrens commented Oct 22, 2017

Looks like this one breaks in that case. It uses path.join to manipulate the route.

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

No branches or pull requests

3 participants