andriusvelykis / reflow-maven-skin

Reflow is an Apache Maven site skin built on Bootstrap. It allows various structural and stylistic customizations to create a modern-looking Maven-generated website.
http://andriusvelykis.github.io/reflow-maven-skin/
Apache License 2.0
133 stars 54 forks source link

/project/custom/reflowSkin/pages/index@project-id="$artifactId" doesn't work as advertised. #27

Closed christian-schlichtherle closed 10 years ago

christian-schlichtherle commented 10 years ago

Filtering a module by it's artifactId doesn't quite work because the test seems to use the given project-id as starting characters only. Consider this example:

<project>
    <custom>
        <reflowSkin>
            <pages>
                <index project-id="xyz">
                    <shortTitle>Welcome</shortTitle>
                    <breadcrumbs>false</breadcrumbs>
                </index>
            </pages>
        </reflowSkin>
    </custom>
</project>

Now consider if the submodules are named "xyz-api", "xyz-impl" etc then the configuration would be applied to them all.

andriusvelykis commented 10 years ago

The attribute is project, not project-id.

Assuming this is a typo in the issue report - is this what is really happening with your project? Because the code checks the project attribute value to be equal to the "slug" of the current project name - see line 200 at SkinConfigTool.

Do you have a reproducible example? Thanks!

christian-schlichtherle commented 10 years ago

Interesting. As said, I do get this weird behavior with the configuration as explained above. However, when I follow your advice and use the attribute name projectinstead of project-id, then it works as advertised. I suppose the code ignores the invalid attribute name and thus the element applies to all pages named index.*, right?

I got the attribute name from the documentation of this project, so may I suggest to update the documentation? You might even want to display an error message on any invalid attribute name.

andriusvelykis commented 10 years ago

Yea, if the code does not find the project attribute, per-project filtering does not happen and the element applies to all these pages. Supporting warnings for invalid attribute names would be quite a bit of additional work, though :)

Where in the documentation did you get this from? I gave a look at the source code and documentation and I did not find any project-id attributes used..

christian-schlichtherle commented 10 years ago

Sorry, I can't figure out anymore where I got the invalid attribute name project-id from.