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

generateSite: images-hrefs not correct #831

Closed
dieterbaier opened this issue Mar 23, 2022 · 1 comment
Closed

generateSite: images-hrefs not correct #831

dieterbaier opened this issue Mar 23, 2022 · 1 comment

Comments

@dieterbaier
Copy link

When I use the generateSite task within the generated site, the images-hrefs got rendered like ../..//images/someImage.png. Note the double-slash before 'images'.

When I change the header.gsp within the template like adding content.body = content.body?.replaceAll('//images', '/images') after the line content.body = content.body?.replaceAll('src="/', 'src="' + content.rootpath) the href is rendered correct.

To Reproduce
Steps to reproduce the behavior:

  1. see error

Expected behavior
The images-href is correct, after the site is rendered

Screenshots
If applicable, add screenshots to help explain your problem.

Configuration

  • docToolchain wrapper: V0.29
  • use docker installation
  • docToolchain version: V2.0.5
  • OS: MacOS
  • Browser chrome

Gradle 6.9.2

Build time: 2021-12-21 20:18:38 UTC
Revision: 5d94aa68c0fdbe443838bb977080e3b9f273e889

Kotlin: 1.4.20
Groovy: 2.5.12
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 14-ea (Oracle Corporation 14-ea+33)
OS: Linux 5.10.76-linuxkit amd64

Additional context
Add any other context about the problem here.

Find a good headline
Now it is time to find a good headline/subject for the problem.
Please prefix it with the name of the task which fails.

Example:
exportContributors throws exception when ...

@bit-jkraushaar
Copy link
Contributor

Source of the problem is

"imagesDir=${config.microsite.contextPath}/images@",

config.microsite.contextPath is initially set to '/'. This leads to the duplicated double slashes. A workaround is to set contextPath to ''. This works at least locally. I have not tested it with a deployed version.

IMHO bugfix would be to add the slash conditionally if contextPath does not end with a slash.

bit-jkraushaar added a commit to bit-jkraushaar/docToolchain that referenced this issue Mar 23, 2023
generateSite script checks now for trailing slashes
@bit-jkraushaar bit-jkraushaar mentioned this issue Mar 23, 2023
5 tasks
rdmueller pushed a commit that referenced this issue Mar 27, 2023
* Fix for #831: generateSite script checks now for trailing slashes
* Fixed behavior if contextPath not set
@mh182 mh182 closed this as completed Apr 7, 2023
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