Skip to content

Commit

Permalink
Merge pull request #121 from 3mdeb/develop
Browse files Browse the repository at this point in the history
Seo link checker improvments
  • Loading branch information
artur-rs authored Feb 9, 2024
2 parents 62a12ce + da26c40 commit 11e341f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/seo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Link Checker
id: lychee
uses: lycheeverse/[email protected]
with:
fail: true
args: --timeout 60 --max-redirects 10 -a 403,500,502,503,504 .
- name: Checkout repo
uses: actions/[email protected]

- name: Test links
uses: 3mdeb/lychee-log-action@main

seo_spy_orphan_pages:
runs-on: ubuntu-latest
Expand Down
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,49 @@ $ 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 <https://web.archive.org/> to
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
you solve the problem.
### Relative links
Please avoid using relative like:
Expand Down

0 comments on commit 11e341f

Please sign in to comment.