-
Notifications
You must be signed in to change notification settings - Fork 78
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
directory vs .md file #101
Comments
Thanks @q5sys for creating this issue. You can (maybe) handle this by using a custom config with the BASEURL option. In your custom configuration file use the following: {
"projectBaseUrl": "website.com",
"replacementPatterns": [
{
"pattern": "^/",
"replacement": "{{BASEURL}}/"
}
]
} or {
"projectBaseUrl": "website.com",
"replacementPatterns": [
{
"pattern": "^/",
"replacement": "{{BASEURL}}/index.html"
}
]
} Try an let me know if that works, is your repository publicly available? Share a link here if it is. |
Thanks for the reply, I'll try that when I get time. I'm a bit confused how using {{baseurl}} will make a difference in the The repo is public, its the TrueNAS Documentation repo, an example of the run throwing hundreds of errors is here: |
Here is an example to make it more clear. {
"projectBaseUrl": "https://www.truenas.com/docs",
"replacementPatterns": [
{
"pattern": "^/",
"replacement": "{{BASEURL}}/"
}
]
}
|
The example in my previous comment will only work for existing published pages. You can also try the following: {
"projectBaseUrl": "content/en",
"replacementPatterns": [
{
"pattern": "\/$",
"replacement": ".md"
},
{
"pattern": "^/",
"replacement": "{{BASEURL}}/"
}
]
} I am not sure if it will work. However, the logic should replace |
Ok, thanks for the additional information. I should be able to get time today to work on it. |
I tried out the substitution you suggested and while it did work, it ended up having the unintended consequence of breaking every link off site that we link to. I tried various things to see what else I could work out, but I think this is going to take a much more complex regex, so I'll keep working on it. |
Looking through the docs you have, I had an additional question. You have a |
@q5sys Yes.
Please always include links to failed checks, it makes it easy to debug. The idea of having two check runs is also good, let me know how you solve this issue and I can add it to the README file. |
Thanks for the additional info, I really appreciate your help. Is there anyway I can buy you a beer or a coffee? haha. The replies you've given have definitely helped cleaned up a lot of the false positives that I was running into, but I'm still running into a few odd issues. Once I get these figured out, I'll write up a little troubleshooting thing and do a PR into the ReadMe in your repo. I've tried to make the links with # alot simpiler but they are still failing: https://github.com/freenas/documentation/pull/524/checks?check_run_id=1825026546#step:4:97 I'm not sure what's going wrong here: And then I've got a really odd situation of this it is able to scan this file, but cant find references back to itself: And in that same file I get issues where it doesn't find files which are there, this seems at this point to be majority of the issues I have left: |
@q5sys I tried your repository with https://github.com/gaurav-nelson/documentation/blob/8523b2584808e1db03dafef83fc39dae2560e669/static/config.json The problems I see are:
I think you'll need a custom script to cater for all these different cases. |
I'm going to close this ticket out as its clear that this is not a bug it's just a complicated configuration issue. Thanks for your assistance with tweaking the regex. |
I'm not 100% sure if this is something I'm screwing up or not, so if that's the case let me know what I'm doing wrong so I can fix it.
I'm using Hugo, so all .md files get turned into directories when built.
So if I have
/content/article/newthing.md
in my repo that will get turned intowebsite.com/content/article/newthing/
when built and published onlineso if I want to link to that page from another page I would use
/content/article/newthing/
as the link, because/content/article/newthing.md
will not exist on the website when published.But this leads to practically every link being flagged as bad because
/content/article/newthing/
doesn't exist in the repo.../content/article/newthing.md
does... and the link checker doesn't know there's one in the same.Is there something in the config I can set to fix this... or is this just not something the link checker can do?
The text was updated successfully, but these errors were encountered: