Skip to content
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

Better broken link detection #166

Merged
merged 3 commits into from
Dec 16, 2021

Conversation

MrFlick
Copy link
Contributor

@MrFlick MrFlick commented Dec 16, 2021

Issues

There were a few false positives in the broken link detection. The main issue was that some links had a trailing slash and some did not:
https://umcarpentries.org/intro-curriculum-r/05-r-markdown/ vs
https://umcarpentries.org/intro-curriculum-r/05-r-markdown

In that case, it's hard to know whether 05-r-markdown is a page or a folder. I changed the code to request the page and then check if the server issued a redirect. So if you request the page without the slash, you are redirected to the version with the slash (the canonical name for the resource). This means we a better able to check relative links in that case.

It's still not possible for the client to know for sure that https://umcarpentries.org/intro-curriculum-r/05-r-markdown/ and https://umcarpentries.org/intro-curriculum-r/05-r-markdown/index.html are the same resources. It would be nice to standardize all URLs either to use the "index.html" file or to leave it off and end the path with a slash. But this just means that values are repeated for the identical pages with different URLs.

I also cleaned up some existing broken links. I noticed that many of the existing links in the Rmd files were already fixed by @kelly-sovacool but it seems that the Rmd files were not rendered into HTML files for the website. I am unable to run the build steps on my own machine to render the site.

The last issue is that all-in-one page (aio) has several duplicate IDs. Sections like "#bonus" are repeated in multiple lessons. So when everything is combined on the same page, those IDs are no longer unique. This means that if you click a later "bonus" link, you are sent to the first bonus section, for example. I'm not sure how important that is but we could make the section names unique across all lessons.

Checklist

  • If you edited any files in _episodes_rmd/, run make lesson-md.
  • Run make serve locally to view the website and make sure the formatting renders correctly.
  • The build-website workflow succeeds on your most recent commit.

@kelly-sovacool
Copy link
Member

Thanks @MrFlick! I ran make site and pushed it to your branch. For some reason the GitHub Actions workflow isn't pushing commits correctly...

@kelly-sovacool kelly-sovacool merged commit 5c21965 into UMCarpentries:gh-pages Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants