Skip to content

Commit

Permalink
Merge pull request #421 from Orange-OpenSource/420-bug-links-in-docum…
Browse files Browse the repository at this point in the history
…entation-are-broken-on-github-pages

420 - bug - links in documentation are broken on GitHub pages
  • Loading branch information
paulinea authored Feb 1, 2023
2 parents 28521dd + b11aded commit f55bae9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
9 changes: 5 additions & 4 deletions buildSrc/src/main/kotlin/release.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,17 @@ fun archiveDocumentation(version: String) {
from("docs")
into("docs/$version")
exclude("_*", "Gemfile*")
val versionRegex = "^\\d+.\\d+.\\d+$".toRegex()
exclude { versionRegex.matches(it.name) }
}

val jekyllConfigFile = File("docs/_config.yml")
jekyllConfigFile.appendText(
"""
val text = """
| - scope:
| path: "$version"
| values:
| version: "$version"
|
""".trimMargin()
)
File("docs/_config.yml").appendText(text)
File("docs/_config_netlify.yml").appendText(text)
}
2 changes: 2 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# If you update this file, please also update _config_netlify.yml with the exact same changes
plugins:
- jekyll-relative-links
relative_links:
enabled: true
collections: true
remote_theme: Orange-OpenSource/ods-jekyll-theme
baseurl: "/ods-android"
defaults:
- scope:
path: ""
Expand Down
12 changes: 12 additions & 0 deletions docs/_config_netlify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# If you update this file, please also update _config.yml with the exact same changes
plugins:
- jekyll-relative-links
relative_links:
enabled: true
collections: true
remote_theme: Orange-OpenSource/ods-jekyll-theme
defaults:
- scope:
path: ""
values:
version: ""
4 changes: 2 additions & 2 deletions docs/_layouts/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ <h3>{{ item.title }}</h3>
<div class="ods-content ps-lg-4 mb-3">
<ul>
{% for entry in item.subfolderitems %}
<li><a href="{{ urlPrefix }}{{ entry.url }}">{{ entry.page }}</a>
<li><a href="{{ site.baseurl }}{{ urlPrefix }}{{ entry.url }}">{{ entry.page }}</a>
{% if entry.subsubfolderitems[0] %}
<ul>
{% for subentry in entry.subsubfolderitems %}
<li><a href="{{ urlPrefix }}{{ subentry.url }}">{{ subentry.page }}</a></li>
<li><a href="{{ site.baseurl }}{{ urlPrefix }}{{ subentry.url }}">{{ subentry.page }}</a></li>
{% endfor %}
</ul>
{% endif %}
Expand Down

0 comments on commit f55bae9

Please sign in to comment.