-
Notifications
You must be signed in to change notification settings - Fork 236
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
Docs: Fixed broken template links, fixed script versions #662
Conversation
docs/generated/checks.md
Outdated
@@ -10,7 +10,7 @@ KubeLinter includes the following built-in checks: | |||
|
|||
**Remediation**: Where possible, remove create access to pod objects in the cluster. | |||
|
|||
**Template**: [access-to-resources](templates.md#access-to-resources) | |||
**Template**: [access-to-resources](generated/templates.md#access-to-resources) |
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.
This link is broken. If you go to https://github.com/stackrox/kube-linter/blob/553365517c108e7cb200af7d98527b8716e236ac/docs/generated/checks.md and click that link it will give you https://github.com/stackrox/kube-linter/blob/553365517c108e7cb200af7d98527b8716e236ac/docs/generated/generated/templates.md#access-to-resources that does not exists
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'm not sure how GitHub is handling the links. I've built the site locally with docsify and used docsify serve ./docs
command to check.
For example, go to https://stackblitz.com/~/github.com/gaurav-nelson/kube-linter/tree/fix-template-links and run npm i docsify-cli
and then docsify server ./docs
commands to check.
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.
Ah, that's how it's done. How about keeping it working on github and docksify by adding
relativePath: true
in
Lines 16 to 19 in 5533655
window.$docsify = { | |
name: 'KubeLinter', | |
logo: 'https://raw.githubusercontent.com/stackrox/kube-linter/main/images/logo/KubeLinter-vertical.svg', | |
coverpage: false, |
Then we only need to change
index.html
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 tried this locally. It fixes the check and template links. But if you click another topic, for example, Using KubeLinter it tries to open http://localhost:3000/#/generated/using-kubelinter
404.
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.
Good catch! So we need to change index and https://github.com/stackrox/kube-linter/blob/553365517c108e7cb200af7d98527b8716e236ac/docs/_sidebar.md to use absolute paths. Then it will not work on github and IDE but probably it's fine as nobody will use this file
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 tried it locally, changed the links for:
- Checks to
checks.md
- Templates to
templates.md
But then we get 404 with http://localhost:3000/#/templates
when we click the links from sidebar. However, if we go to http://localhost:3000/#/generated/templates
and then click the sidebar link it works fine.
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.
Hmm, it's working for me with this patch
diff --git a/docs/_sidebar.md b/docs/_sidebar.md
index 3457af1..3412f76 100644
--- a/docs/_sidebar.md
+++ b/docs/_sidebar.md
@@ -1,5 +1,5 @@
* [Introduction](/)
-* [Using KubeLinter](using-kubelinter.md)
-* [Configuring KubeLinter](configuring-kubelinter.md)
-* [KubeLinter checks](generated/checks.md)
-* [KubeLinter templates](generated/templates.md)
\ No newline at end of file
+* [Using KubeLinter](/using-kubelinter.md)
+* [Configuring KubeLinter](/configuring-kubelinter.md)
+* [KubeLinter checks](/generated/checks.md)
+* [KubeLinter templates](/generated/templates.md)
diff --git a/docs/index.html b/docs/index.html
index dc7b2eb..deab721 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -27,6 +27,7 @@
errorText : 'Error',
successText: 'Copied'
},
+ relativePath: true,
'flexible-alerts': {
style: 'flat'
},
This reverts commit 5533655.
@gaurav-nelson I've fixed this on your PR. Could you check. It's working for me |
Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
e726dba
to
f082060
Compare
Fixes #576
I see that
generated
was removed in #439 which I am think was caused by changes indocsify
library. Therefore, I've updated the script tags to load a fixed version so that it doesn't happen again.