Giter Site home page Giter Site logo

Comments (7)

vincenzobaz avatar vincenzobaz commented on August 16, 2024

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.

AlexITC avatar AlexITC commented on August 16, 2024

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.

julienrf avatar julienrf commented on August 16, 2024

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.

vincenzobaz avatar vincenzobaz commented on August 16, 2024

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.

AlexITC avatar AlexITC commented on August 16, 2024

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.

nafg avatar nafg commented on August 16, 2024

This is pretty important

from paradox.

nafg avatar nafg commented on August 16, 2024

Here's my "solution" https://github.com/slick/slick/blob/dbb46ac190c7fc10bf39350f2ebe1fe2239fac4d/project/Docs.scala#L116-L128

from paradox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.