From 91c9a2b2073cc224c9f0509f16cbd213d349ee08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norbert=20Kami=C5=84ski?= Date: Wed, 7 Feb 2024 00:56:14 +0100 Subject: [PATCH 1/4] seo.yml: Use improved link checker action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Norbert Kamiński --- .github/workflows/seo.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/seo.yml b/.github/workflows/seo.yml index 5d48a44..3a26b6a 100644 --- a/.github/workflows/seo.yml +++ b/.github/workflows/seo.yml @@ -12,13 +12,11 @@ jobs: linkChecker: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.1.1 - - name: Link Checker - id: lychee - uses: lycheeverse/lychee-action@v1.9.2 - with: - fail: true - args: --max-redirects 10 -a 403,500,503 . + - name: Checkout repo + uses: actions/checkout@v4.1.1 + + - name: Test links + uses: 3mdeb/lychee-log-action@main seo_spy_orphan_pages: runs-on: ubuntu-latest name: Check orphan pages From 7619a465da64b02bbcf50a1d1719248b6282e01b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norbert=20Kami=C5=84ski?= Date: Wed, 7 Feb 2024 11:38:21 +0100 Subject: [PATCH 2/4] README.md: Add documentation on fixing broken links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Norbert Kamiński --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index f299d85..b9510c2 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,36 @@ $ docker run --init -it --rm -w $(pwd) -v $(pwd):$(pwd) lycheeverse/lychee --max-redirects 10 -a 403,429,500,502,503,999 . ``` +We also use the Lychee Log Parser, which evaluates whether the problems detected +by lychee are actual problems with the site or server. Whenever you add +changes, it is your responsibility to fix all problems (even if the erroneous +links are in a part of the code that you have not changed). In this way, +together we will maintain the quality of the links and fix the errors that +occur. + +To fix an error, open the job that crashed. In the log you will find +information about which file the error is in and which link is affected: + +```bash +2024-02-07 02:08:54 - ERROR - Broken links found! +2024-02-07 02:08:54 - ERROR - --- +2024-02-07 02:08:54 - ERROR - Broken links in "BROKEN.md": +2024-02-07 02:08:54 - ERROR - --- +2024-02-07 02:08:54 - ERROR - Broken link: https://use.fontawesome.com/ +2024-02-07 02:08:54 - ERROR - Failed: Network error: 404 +2024-02-07 02:08:54 - ERROR - --- +``` + +In this case, the file is `"BROKEN.md"` and the invalid link is +`https://use.fontawesome.com/`. Check whether the path has changed or the +page has expired. If the page has expired, use to +restore the older version. If the page does not have a saved version in +the archive, remove the link and add an annotation. + +If you think that the error that appeared is not an error of the site but +of the server you are connecting to, please open an issue and we will help +you solve the problem. + ### Relative links Please avoid using relative like: From 832d13f5fb6c7c25a87b000dc52e27fb9287ced2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norbert=20Kami=C5=84ski?= Date: Fri, 9 Feb 2024 14:26:36 +0100 Subject: [PATCH 3/4] README.md: And information about fix suggestions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Norbert Kamiński --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b9510c2..5cf4918 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,21 @@ information about which file the error is in and which link is affected: In this case, the file is `"BROKEN.md"` and the invalid link is `https://use.fontawesome.com/`. Check whether the path has changed or the page has expired. If the page has expired, use to -restore the older version. If the page does not have a saved version in -the archive, remove the link and add an annotation. +restore the older version. Lychee automatically suggests url fix for the broken +links: + +```shell + 2024-02-09 13:02:52 - ERROR - --- +2024-02-09 13:02:52 - INFO - Check if broken URL server is expired. If it's no longer available, you can fix broken links using the suggestions below: +2024-02-09 13:02:52 - INFO - --- +2024-02-09 13:02:52 - INFO - Suggestions for the "BROKEN.md" +2024-02-09 13:02:52 - INFO - --- +2024-02-09 13:02:52 - INFO - https://use.fontawesome.com/ - http://web.archive.org/web/20211220191310/https://use.fontawesome.com/ +2024-02-09 13:02:52 - INFO - --- +``` + +If the page does not have a saved version in the archive, remove the link and +add an annotation. If you think that the error that appeared is not an error of the site but of the server you are connecting to, please open an issue and we will help From 2d0f7cf8918f284e0aec8adf734c8bf460563033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norbert=20Kami=C5=84ski?= Date: Fri, 9 Feb 2024 17:34:17 +0100 Subject: [PATCH 4/4] seo.yml: Test PR and commits on develop branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Norbert Kamiński --- .github/workflows/seo.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/seo.yml b/.github/workflows/seo.yml index 3a26b6a..511c3fc 100644 --- a/.github/workflows/seo.yml +++ b/.github/workflows/seo.yml @@ -4,9 +4,11 @@ on: push: branches: - main + - develop pull_request: branches: - main + - develop jobs: linkChecker: