Skip to content

Commit

Permalink
Mention .lycheeignore
Browse files Browse the repository at this point in the history
  • Loading branch information
mre committed Aug 30, 2024
1 parent 1b1c8a2 commit d919d79
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export default defineConfig({
label: "Recipes",
items: [
{ label: "Caching", link: "/recipes/caching" },
{ label: "Excluding Links", link: "/recipes/excluding-links" },
{ label: "Excluding Paths", link: "/recipes/excluding-paths" },
{ label: "Filtering Links", link: "/recipes/filtering-links" },
{
label: "Remapping One URL to Another",
link: "/recipes/migration",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
title: Filtering Links
title: Excluding Links
---

You can tell lychee to only check certain links by using a combination of the
`--include` and `--exclude` parameters. Both parameters take a regular
expression as an argument.
lychee allows you to selectively check links using `--include` and `--exclude` parameters. Both accept regular expressions.

Here are some examples:

Expand All @@ -25,3 +23,16 @@ you can use the following command:
```bash
lychee --exclude '.*' --include 'twitter\.com'
```

## Permanently Excluding Links

Do you have a bunch of URLs that you always want to exclude?
You can add them to a `.lycheeignore` file in the root of your project.

```plaintext title=".lycheeignore"
https://www.zombo.com/
# This is a comment, which will be ignored
https://www.youtube.com/watch?v=dQw4w9WgXcQ
# Regex is also supported
https?:\/\/(www\.)?reddit\.com\/r\/(funny||videos)
```
2 changes: 1 addition & 1 deletion src/content/docs/recipes/excluding-paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Excluding Paths
Sometimes it is necessary to skip paths from being checked.
For example, you might want to skip the `node_modules` directory or a `vendor` directory.

You might think that you can just put the path in the `.lycheeignore` file, but that won't work.
You might think that you can just put the path in the [`.lycheeignore`](/recipes/excluding-links) file, but that won't work.
The `.lycheeignore` file is only used for excluding URLs, not paths.

Instead, you can use the `--exclude-path` flag to exclude paths from being checked.
Expand Down

0 comments on commit d919d79

Please sign in to comment.