upash / peco

nothing here, move on..
MIT License
209 stars 12 forks source link

`Cannot get /` when declaring root #26

Closed johnsonjo4531 closed 6 years ago

johnsonjo4531 commented 6 years ago

Hey I really enjoy Peco your static site generator so far. I know it's in beta, but I seem to be running into an issue. When I declare the root to for example '/blog/' in my peco.config.yml and run peco dev the site at http://localhost:4000/ only displays 'Cannot get /'. If I go to http://localhost:4000/blog/ it instead says, 'Cannot get /blog/'. Also am I supposed to be hard coding in the /blog/ into the links to my post, because the root option doesn't seem to be showing up in the paths to the articles.

If you can't recreate the issue I can post the link to my github repo for my Peco blog. Thanks.

egoist commented 6 years ago

Fixed in v0.1.8, the website is always served at root path / during development

egoist commented 6 years ago

btw you don't really need to worry about the path stuffs, we handle all the path relative to the root path you set. (we use vue-router under the hood.)

I just took a look at your blog: https://github.com/johnsonjo4531/blog/blob/241345e985d448eac400653254391a2e028c448b/theme/layouts/_components/Nav.vue#L4

You should use <router-link> component for proper client-side router navigation without refreshing the whole page. In this case, it should be <router to="/about">about</router>

johnsonjo4531 commented 6 years ago

Thanks egoist that is very helpful. I'm new to Vue router, and wasn't sure I needed to use it in Peco for links and routing. Also thanks again for Peco!