Skip to content

Commit d72fd99

Browse files
committed
improve order in readme
1 parent 640f9cd commit d72fd99

1 file changed

Lines changed: 35 additions & 35 deletions

File tree

README.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,41 @@ links. However, it can do more.
117117
* `exit 1`: There have been errors (hard 404s)
118118
* `exit 2`: There have been only warnings (broken anchors)
119119

120+
## Redirects
121+
122+
Since 0.2.0 `hyperlink` supports reading configured redirects from a file.
123+
124+
At the root of your site, make a file `_redirects`:
125+
126+
```
127+
# lines starting with # are ignored
128+
/old-url.html /new-url.html
129+
130+
# on the next line, trailing data like the 301 status code is ignored
131+
/old-url2.html /new-url2.html 301
132+
133+
# /old-url.html will become a valid link target
134+
# hyperlink will validate that /new-url.html exists.
135+
```
136+
137+
This format is supported by at least Netlify, [Codeberg
138+
pages](https://codeberg.page) and [Grebedoc](https://grebedoc.dev)
139+
140+
References for this format can be found at
141+
[Codeberg](https://docs.codeberg.org/codeberg-pages/redirects/) and
142+
[Netlify](https://docs.netlify.com/manage/routing/redirects/overview/).
143+
144+
The major things missing from the implementation are:
145+
146+
* `hyperlink` completely ignores any status codes or country code conditions.
147+
The only thing it parses are `from to`, and the rest is ignored.
148+
149+
* "Splat sources" (`/articles/*`) and "splat targets" (`/posts/:splat`) are
150+
not supported.
151+
152+
* Generally speaking, `hyperlink` does not support "pretty URLs", i.e. one
153+
cannot request `/mypage` and expect `mypage.html` to be loaded.
154+
120155
## External links
121156

122157
Hyperlink does not know how to check external links, but it gives you some tools to
@@ -184,41 +219,6 @@ and `--github-actions` feature.
184219
fairly feature-rich, but was a non-starter due to performance. This applies
185220
to other countless link checkers we tried that are not mentioned here.
186221

187-
## Redirects
188-
189-
Since 0.2.0 `hyperlink` supports reading configured redirects from a file.
190-
191-
At the root of your site, make a file `_redirects`:
192-
193-
```
194-
# lines starting with # are ignored
195-
/old-url.html /new-url.html
196-
197-
# on the next line, trailing data like the 301 status code is ignored
198-
/old-url2.html /new-url2.html 301
199-
200-
# /old-url.html will become a valid link target
201-
# hyperlink will validate that /new-url.html exists.
202-
```
203-
204-
This format is supported by at least Netlify, [Codeberg
205-
pages](https://codeberg.page) and [Grebedoc](https://grebedoc.dev)
206-
207-
References for this format can be found at
208-
[Codeberg](https://docs.codeberg.org/codeberg-pages/redirects/) and
209-
[Netlify](https://docs.netlify.com/manage/routing/redirects/overview/).
210-
211-
The major things missing from the implementation are:
212-
213-
* `hyperlink` completely ignores any status codes or country code conditions.
214-
The only thing it parses are `from to`, and the rest is ignored.
215-
216-
* "Splat sources" (`/articles/*`) and "splat targets" (`/posts/:splat`) are
217-
not supported.
218-
219-
* Generally speaking, `hyperlink` does not support "pretty URLs", i.e. one
220-
cannot request `/mypage` and expect `mypage.html` to be loaded.
221-
222222
## Testimonials
223223

224224
> We use Hyperlink to check for dead links on

0 commit comments

Comments
 (0)