Comments (7)
I am having the same issue.
The url is accessed in themes/generic/src/main/assets/source.st
which is used in themes/generic/src/main/assets/page.st
.
I think that source_url
is exposed to the template via the PageContents.getSource_url
(imposed by PageTemplate.Contents
).
getSource_url
is based on GithubLink.href
which uses GithubResolver.treeUrl
defined in terms of GithubResolver.baseUrl
that reads the github.base_url
property.
Writer.Context
is passed to the creation of GithubLink
and its properties are used to initialize variables
used in PropertyUrl.collect
Initally I thought that maybe this or this ++
could be responsible. If this is the case, both the properties
passed to process
and those coming from the page contain github.base_url
and one is taken in favor of the other (as map keys must be unique).
pageProperties
is used to build the Writer.Context
which is then used to build a PageContents
.
However if in my project sbt console I run show Paradox/paradoxProperties
, github.base_url
contains the correct address to the folder containing my md
files. So a conflict is not the problem.
from paradox.
I forget to post that I found a way to solve this, the drawback is that it very simple and link sources from a single branch, it involves overriding the source url template, and a simple js to fix the source url.
src/main/paradox/_template/source.st
:
<script type="text/javascript" src="$page.base$js/link_fix.js"></script>
$if(page.source_url)$
<div class="source-github">
The source code for this page can be found <a id="source-link" href="$page.source_url$">here</a>.
</div>
$endif$
<script type="text/javascript">jQuery(function(){sourceUrlFix('$page.source_url$')});</script>
src/main/paradox/_template/js/link_fix.js
(this just creates a function to link the correct source:
function sourceUrlFix(sourceUrl) {
// TODO: Use any branch instead of master
$("#source-link").attr("href", sourceUrl.replace("tree/master/docs/target/mdoc", "tree/master/docs/src/main/paradox"))
}
from paradox.
Thanks for sharing your workaround @AlexITC! However, I think it would be better if we could fix the root cause of the problem instead. I think the issue should be re-opened.
from paradox.
I agree wtih @julienrf . I do not like this solution and I think the issue should be still be open.
It is not an easy fix but I think it is very important. Paradox is one of the very few resources allowing to create a site without relying on node, yarn, jekyll or ruby and having a broken link on each page does not look great.
from paradox.
I know it is not an ideal workaround but at least, there is a way.
I'd have preferred to have a plugin option to either disable the generation, or to set the right source url.
from paradox.
This is pretty important
from paradox.
Here's my "solution" https://github.com/slick/slick/blob/dbb46ac190c7fc10bf39350f2ebe1fe2239fac4d/project/Docs.scala#L116-L128
from paradox.
Related Issues (20)
- scoping of settings (e.g. 'sourceDirectory in (Compile, paradox)') HOT 1
- Warn about scala binary version suffix on dependencies HOT 5
- Generate PDF (other architecture)
- Anchors below tabs don't correctly scroll in Firefox HOT 1
- Option to use highlightjs for syntax highlighting HOT 6
- Sublists are not rendered as expected HOT 1
- Explicitly specifying language on fenced block doesn't work HOT 3
- Tabbed groups not working with 0.9.0 release HOT 2
- Please include sbt-paradox-reveal in your extension list HOT 3
- Support retry count for validate link tasks HOT 1
- Java 16 support HOT 3
- override anchor HOT 1
- Very slow HOT 1
- Support blob links as part of Github Directive
- Migrate from scalariform to scalafmt HOT 4
- @apidoc doesn't support line break
- Error creating extended parser class HOT 2
- Formatting not honored inside @scaladoc links
- Support Mill in dependencies directive
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paradox.