Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

micrositeDocumentationUrl and micrositeHompage with non-empty path #251

Closed
BenFradet opened this issue Dec 26, 2017 · 7 comments
Closed

Comments

@BenFradet
Copy link
Contributor

The top-right documentation link for cats is broken: https://typelevel.org/cats, as it links to https://typelevel.org/api/cats/index.html instead of https://typelevel.org/cats/api/cats/index.html.

I believe the issues lies with https://github.com/47deg/sbt-microsites/blob/cddebf121135347fc68b50b6cebbc5fe1b0ff91c/src/main/scala/microsites/layouts/Layout.scala#L286 because it doesn't take into account a possible path for micrositeHomepage.

@juanpedromoreno
Copy link
Member

Weird, it doesn't work from https://typelevel.org/cats, but it's working fine for https://typelevel.org/cats/ (notice final slash). I guess the problem might be how Jekyll rewrite those urls/paths.

What do you think?

@BenFradet
Copy link
Contributor Author

BenFradet commented Dec 27, 2017

ah nice catch! Indeed that would be causing the issue, what do you reckon would solve it?

@juanpedromoreno
Copy link
Member

Sadly, I don't know how to solve it :( .

Any ideas how to solve this issue @calvellido ? Thanks.

@calvellido
Copy link
Contributor

It looks like the URL gets formed by applying a partial route to the current one, probably looking for slash occurrences and working from the final one, hence not doing it alright when the main one doesn't rewrite the path by adding the final slash. The issue also happens on https://typelevel.org/scala

Yeah, maybe just a small regexp change could solve it, let me have a look (these days are a bit slow, though 🎅).

@juanpedromoreno
Copy link
Member

👍 thanks a lot @calvellido

@calvellido
Copy link
Contributor

Hey @BenFradet, sorry for the lack of news, Christmas have been slow indeed 😅.

I was thinking about the best approach to take on this, and as the documentation states that the relative URL micrositeDocumentationUrl should be set as root-relative links, hence the starting slash in the documentation example settings, I think the best way would be to change them on the Cats and Scala Typelevel projects settings.

An aggregation using micrositeHomepage and micrositeDocumentationUrl from the sbt-microsites side would also work, but that would mean change the initial grasp of those settings, and also could imply some undesired side-effects.

I proposed a couple of PRs to those projects, would you think that this would be ok to solve this issue?

@BenFradet
Copy link
Contributor Author

Yup, thanks a bunch! 👍

LukaJCB pushed a commit to typelevel/cats that referenced this issue Jan 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants