Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Define root index of the project via route parameter #673

Closed
thangngoc89 opened this issue Aug 27, 2016 · 1 comment
Closed

Define root index of the project via route parameter #673

thangngoc89 opened this issue Aug 27, 2016 · 1 comment
Labels

Comments

@thangngoc89
Copy link
Contributor

Looks like there is no way you can define a route like this


---
route: /

---

and expect it to becomes the root of your project.

I tried with several alternative route like /index.html, index.html but no luck.

Investigating this

@thangngoc89
Copy link
Contributor Author

OK. I solved this. But I'm using phenomic@0.15

I'll find time to send a proper PR with test and everything. For anyone who is encountering this (or willing to fix this) this is what to add

At

const tmpUrl = urlify(

Make sure tmpUrl never starts with a slash

tmpUrl = (tmpUrl.substring(0, 1) === "/") ? tmpUrl.slice(1) : tmpUrl

const splatToUrl = (string) => ("/" + urlify(string))

Same story here. spatToUrl should not return this result //

So

const splatToUrl = (string) => {
  const url = "/" + urlify(string)
  return (url === "//") ? "/" : url
}

@MoOx MoOx closed this as completed in #721 Sep 5, 2016
MoOx pushed a commit that referenced this issue Sep 5, 2016
)

* Define root index of the project via `route` parameter

Fix #673

* Add tests

* Add changelog notes for #721

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

No branches or pull requests

1 participant