-
Notifications
You must be signed in to change notification settings - Fork 18
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
Set correct source directory for jekyll gh-action page and add {{ site.ur l}} to fix links and styling #123
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #123 +/- ##
=======================================
Coverage 86.80% 86.80%
=======================================
Files 35 35
Lines 2092 2092
=======================================
Hits 1816 1816
Misses 276 276 ☔ View full report in Codecov by Sentry. |
docs/index.html
Outdated
@@ -54,7 +56,7 @@ <h5>(The rest is a bit more difficult though)</h5> | |||
$ cd your-module | |||
$ rspec-puppet-init | |||
</code></pre></div> | |||
<p>Then continue on to the <a href="/tutorial/">tutorial!</a></p> | |||
<p>Then continue on to the <a href="{{site.url}}/tutorial">tutorial!</a></p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd consistently use baseurl
instead of including the whole domain
<p>Then continue on to the <a href="{{site.url}}/tutorial">tutorial!</a></p> | |
<p>Then continue on to the <a href="{{site.baseurl}}/tutorial">tutorial!</a></p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its better to use site.url across these pages, otherwise it has difficulty loading in the CSS, even when Ive tried to concat the jekyll variables, the CSS still fails to loads.
This code produces the below output href="{{site.url}}/{{site.baseurl}}/assets/css/styles.css">
From the description of site.baseurl
you would think its something we need as it mentions using this if your site is served from a sub directory, i find this slightly confusing as we are serving our documentation from ./docs
but we would only need baseurl
if our project site was https://puppetlabs.github.io/rspec-puppet/docs
and ./docs
being the subdomain but as thats not the case we do not need baseurl
as its not served from subdomain
Ive tested this with baseurl but if I remember, it broke the css, I will test this out again this morning before opening the PR |
Summary
The jekyll gh-pages action "sources" its documentation from the root "/" of the repository however respec-puppet holds its documentation under a sub-directory
/docs
. This points the action to the correct directory to build the documention from with more advanced configuration options under/docs/config.yml
. This PR also fixes the issue with the broken links by using Jekyll's global variablesite.url
configured in/docs/config.yaml
. The default css theming is expected to be served from the default root directory and ours isrespec-puppet
and thesite.url
is used to fixed this and serve the css from the correct location.Related Issues (if any)
Mention any related issues or pull requests.
Checklist