You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update --base-url recipe docs, and add warning box (#138)
* Update --base-url recipe docs, and add warning box
The goal is to add more detail where I can, and to remove information
which I think is no longer correct. I think this page was originally
written when --base-url behaved quite differently (before --root-dir?).
I've left all of the examples even though I think they will not work.
The examples are all very brief so I don't know what they're intended
to show. I've left them to be safe.
The statements which I've removed or changed because I think they're no
longer correct are:
> Even though your site isn't deployed yet, lychee can verify that the
> files your links point to exist in your project.
> The `--base-url` parameter works similarly to other tools you might know:
> --base-url: Use it when you care about your site's final URL structure
* Apply suggestion from @mre
Co-authored-by: Matthias Endler <matthias@endler.dev>
* address some more important review feedback
---------
Co-authored-by: Matthias Endler <matthias@endler.dev>
Even though your site isn't deployed yet, lychee can verify that the files your links point to exist in your project. This helps catch broken links before they go live!
98
120
:::
121
+
*/}
99
122
100
123
### GitHub Pages
101
124
@@ -158,21 +181,15 @@ lychee can't automatically add the slash because both forms are valid - they jus
158
181
159
182
## `--base-url` vs `--root-dir`
160
183
161
-
These solve different problems:
162
-
163
-
-`--base-url` is for URLs (like `https://example.com/docs/`)
164
-
- Use it when you care about your site's final URL structure
165
-
- Helps validate relative links
166
-
167
-
-[`--root-dir`](/recipes/root-dir) is for file paths (like `./public/`)
168
-
- Use it to find files on your computer
169
-
- Helps validate absolute paths
184
+
These solve different problems, and using both together is generally not recommended.
170
185
171
-
You can use both together:
186
+
-`--base-url` requires a URL (like `https://example.com/docs/`), and it:
187
+
- Applies to all relative links in local files.
188
+
- Resolves all relative links relative to the given base URL.
0 commit comments