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

Not able to handle pages in subdirectories #13

Closed
toniocus opened this issue Jul 17, 2013 · 4 comments
Closed

Not able to handle pages in subdirectories #13

toniocus opened this issue Jul 17, 2013 · 4 comments
Assignees
Labels
Milestone

Comments

@toniocus
Copy link

I was trying to use reflow-maven-skin with an already done site, and face an important problem:

I have my pages subdivided in this directory structure

apt/index.apt
apt/dev/developer01.apt
apt/dev/developer02.apt
......
apt/user/user01.apt
apt/user/user02.apt
......

This is working correctly in standard maven-site skin when calling, or with fluido skin.

mvn site:run

But when using reflow-maven-skin once I get into any page inside
user or dev directory I cannot reach any other page.

PAGE NOT FOUND Error is returned

So for now just keep using old skins.

@andriusvelykis
Copy link
Owner

Hi - sorry for the delay. Would you mind attaching a minimal example demonstrating this? It would be easier to check.

@gerhardgossen
Copy link

I ran into the same problem and created a minimal example at https://github.com/gerhardgossen/reflow-13.

To reproduce:

  1. run mvn site on this project
  2. open the generate site in your browser
  3. click on "dev" in the bottom menu
  4. click on "user" in the bottom menu, which leads to a "file not found"-error, because this link leads to .../site/dev/user/index.html instead of .../site/user/index.html.

Using the default skin the link is created correctly.

This problem also occurs for images (e.g. the banner image), they do not appear in files in subdirectories.

@andriusvelykis
Copy link
Owner

Thanks for the example - that did help to show the issue. I have fixed this in b289d67.

The problem was arising from extra normalisation of relative links that Reflow skin is doing. It is needed for 'active' link calculation, e.g. to highlight links to the current page. Other skins do not seem to be doing that. In your example, when you open /dev/index.html, you can see that the "Dev" link is actually ../dev/index.html, rather than empty or index.html. Reflow skin performs additional normalisation to get the empty link and thus indicate it as 'active'.

The problem was that to do that, the skin expected project.url to be set. This also helps with highlighting absolute links as 'active'.. I have fixed it so that if no project.url is set in pom.xml, I use a dummy URL to relativize the links.

Thanks to you both for reporting - I have pushed the updated SNAPSHOT build. Let me know if you still encounter the problem.

@gerhardgossen
Copy link

Works both for the minimal example as well as for my actual project. Thanks for the quick turnaround!

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

No branches or pull requests

3 participants