From 515839890d05cd9afccfa7dc275cf3f338351a44 Mon Sep 17 00:00:00 2001 From: oddgrd <29732646+oddgrd@users.noreply.github.com> Date: Thu, 19 Jan 2023 23:11:31 +0100 Subject: [PATCH 1/2] feat: fix broken links A few links were broken by not having their underscores replaced with hyphens, meaning they weren't matching the filenames. --- .github/workflows/contrib.yml | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/contrib.yml b/.github/workflows/contrib.yml index 73f2620..0274411 100644 --- a/.github/workflows/contrib.yml +++ b/.github/workflows/contrib.yml @@ -29,8 +29,8 @@ jobs: - name: Copy CONTRIBUTING.md into docs run: | sed -i -e 's|./docs/||g' hyper/CONTRIBUTING.md - cp -a hyper/CONTRIBUTING.md hyper/docs - + cp -a hyper/CONTRIBUTING.md hyper/docs/CONTRIBUTING.md + # Insert frontmatter borders, replace markdown header with # frontmatter title and insert layout: guide - name: Convert doc titles to frontmatter @@ -49,8 +49,9 @@ jobs: sed -i -e '4i permalink: /contrib/' hyper/docs/README.md mv hyper/docs/README.md hyper/docs/index.md - # Lowercase the internal links so they will correctly point to - # the lowercased filenames. + + # Lowercase the internal links and replace underscores with + # hyphens, so they will point to the correct file. - name: Lowercase internal links run: | for filename in hyper/docs/*.md; do @@ -58,14 +59,24 @@ jobs: filename=${filename::-3}; for file in hyper/docs/*.md; do + # filename without parent path + filename=${filename##*/} + # don't lowercase MSRV - if [[ "${filename##*/}" == 'MSRV' ]]; then + if [[ "${filename}" == 'MSRV' ]]; then continue fi - # match instances of only the filename, not including - # the parent path, and convert them to lowercase - sed -i -e "s|${filename##*/}|\L\0|g" $file; + # lowercase filenames + sed -i -e "s|${filename}|${filename,,}|g" $file; + + # match on the lowercased filename from here on + lowercased=${filename,,} + + hyphenated=${lowercased//_/-} + + # replace underscores in internal links with hyphens + sed -i -e "s|${lowercased}|${hyphenated}|g" $file; done done @@ -75,7 +86,7 @@ jobs: mv -vn "$f" "$(echo "$f" | tr '[:upper:]' '[:lower:]' | tr '_' '-')"; done - - name: Copy docs to contrib + - name: Copy the hyper docs to contrib run: | mkdir -p _contrib cp -a hyper/docs/. _contrib/ From 3f21b82da645b45fb6abc6345e2d55ae68fe6553 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 19 Jan 2023 22:12:04 +0000 Subject: [PATCH 2/2] doc: update contrib docs --- _contrib/contributing.md | 4 ++-- _contrib/governance.md | 2 +- _contrib/issues.md | 4 ++-- _contrib/tenets.md | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/_contrib/contributing.md b/_contrib/contributing.md index 39db483..ca12c4c 100644 --- a/_contrib/contributing.md +++ b/_contrib/contributing.md @@ -8,7 +8,7 @@ You want to contribute? You're awesome! Don't know where to start? Check the [li [easy tag]: https://github.com/hyperium/hyper/issues?q=label%3AE-easy+is%3Aopen -## [Pull Requests](pull_requests.md) +## [Pull Requests](pull-requests.md) -- [Submitting a Pull Request](pull_requests.md#submitting-a-pull-request) +- [Submitting a Pull Request](pull-requests.md#submitting-a-pull-request) - [Commit Guidelines](commits.md) diff --git a/_contrib/governance.md b/_contrib/governance.md index 2a64bec..d8d6044 100644 --- a/_contrib/governance.md +++ b/_contrib/governance.md @@ -109,6 +109,6 @@ Maintainers are the project admins. Besides being a collaborator, they take care of house-keeping duties, help lead the direction, and have the final authority when required. -[coc]: ./code_of_conduct.md +[coc]: ./code-of-conduct.md [contrib]: ../contributing.md [triage-guide]: ./issues.md#triaging diff --git a/_contrib/issues.md b/_contrib/issues.md index 587acf7..ee499b4 100644 --- a/_contrib/issues.md +++ b/_contrib/issues.md @@ -112,6 +112,6 @@ The severity marks how _severe_ the issue is. Note this isn't "importance" or "p - **S-refactor**: improve internal code to help readability and maintenance. [issues]: https://github.com/hyperium/hyper/issues -[COC]: ./code_of_conduct.md -[PRs]: ./pull_requests.md +[COC]: ./code-of-conduct.md +[PRs]: ./pull-requests.md [MRE]: https://en.wikipedia.org/wiki/Minimal_reproducible_example diff --git a/_contrib/tenets.md b/_contrib/tenets.md index d5e56c1..0f7d308 100644 --- a/_contrib/tenets.md +++ b/_contrib/tenets.md @@ -20,7 +20,7 @@ community building and using it. All contributions are in the open. We don't maintain private versions, and don't include features that aren't useful to others. -[We prioritize kindness](./code_of_conduct.md), compassion and empathy towards all +[We prioritize kindness](./code-of-conduct.md), compassion and empathy towards all contributors. Technical skill is not a substitute for human decency. ### Examples