Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i provide site resources in the parent for all children modules to use?

In my parent project I have a site.xml (referencing a logo) and some resources:

src/site/resources/images/logo.gif src/site/resources/css/our.css

How do I make them available to all the children? The site.xml specifies the logo url as images/logo.gif but the file is not there when the child site is generated?

like image 451
GripnRip Avatar asked Dec 21 '25 00:12

GripnRip


1 Answers

Maven only inherits the site descriptor. You will need to use URLs that have knowledge of the relative path (or an appropriate absolute path) to reference the deployed location of the resources from the parent.

This makes it hard to preview the site, however, as the filesystem structure of the child modules, including target/site doesn't match the layout on the final site. In this case, you can use mvn site:stage to preview it in the consolidated layout.

Finally, if you are in need of copying these resources to several different sites (children or otherwise), you should create a skin. You can find documentation here: http://maven.apache.org/plugins/maven-site-plugin/examples/creatingskins.html or a practical example here: http://github.com/brettporter/centrepoint/tree/master/centrepoint/

like image 190
Brett Porter Avatar answered Dec 24 '25 01:12

Brett Porter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!