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

Support xref aka cross reference link fix in adoc #649

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

georgecao
Copy link
Contributor

I use JBake version 2.6.5 and adoc to write some blog. JBake has two configuration properties to fix relative image src. And they are img.path.update and img.path.prepend.host. These two properties only affect img tag and it's src attribute.

But in adoc, we can add a reference in one doc to another by for examplexref:a-gentle-introduction-to-multithreading.adoc[introduction], like image , this will generate a <a href='a-gentle-introduction-to-multithreading.html''>...</> tag with relative path. This need fix too.

I introduce three new properties, relative.path.update, relative.path.prepend.host and relative.tag.attribute. relative.path.update and relative.path.prepend.host are for configuring all relative paths updates, not just img tag. And the third property relative.tag.attribute defines which tags need fix, for example relative.tag.attribute=img=src,a=href.

For backward compatible, both the new and old properties should work.

With a false default value, we should use the properties this way
boolean pathUpdate = config.getImgPathUpdate() || config.getRelativePathUpdate()
With a true default value, we should use the properties this way:
boolean prependSiteHost = configuration.getImgPathPrependHost() && configuration.getRelativePathPrependHost();

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 80.827% when pulling c056e6a on georgecao:ru into c9989a3 on jbake-org:master.

@jonbullock
Copy link
Member

Thanks for taking the time to raise this PR.

This area of functionality will be reviewed, hopefully for the 2.7.0 release, so it may be a while before this gets properly reviewed.

@jonbullock jonbullock added this to the v2.7.0 milestone Aug 4, 2020
@georgecao
Copy link
Contributor Author

Thanks for taking the time to raise this PR.

This area of functionality will be reviewed, hopefully for the 2.7.0 release, so it may be a while before this gets properly reviewed.

Good to know this.

@jonbullock jonbullock modified the milestones: v2.7.0, v2.8.0 May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support xref aka cross reference link fix in adoc
3 participants