Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default defineConfig({
"recipes/base-url",
"recipes/root-dir",
"recipes/pretty-urls",
"recipes/wikilinks",
"recipes/md-wikilinks",
],
},
{
Expand Down
41 changes: 41 additions & 0 deletions src/content/docs/recipes/md-wikilinks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: Markdown Wikilinks
---

## Relevant CLI Flags

Lychee provides a built-in `WikilinkResolver` to check Wikilinks in Markdown Files. This `WikilinkResolver` indexes all files in a given directory (incl. available subdirectories) by their filenames.
Symlinks are ignored during this procedure.
It then tries to resolve the extracted Wikilinks by looking up the Wikilink in the created index.

Both Extraction and Resolving are **deactivated by default**.

For checking Wikilinks please specify the following CLI Flags:

- `--include-wikilinks` to enable the extraction of Wikilinks
- `--base-url /path/to/your/directory` where the `WikilinkResolver` should start indexing
- `--fallback-extensions`, e.g. `--fallback-extensions md, mdx`

:::note[Good to know]
Because Wikilinks do not include a file extension, lychee needs you to specify the extensions you are using with `--fallback-extensions`
:::

Summed up the following command might be a good starting point to check for the existance of files used by Wikilinks:

```bash
lychee --include-wikilinks \
--base-url /path/to/your/local/directory \
--fallback-extensions md,mdx .
```

## Link Renaming

Some tools provide a possibility to rename Wikilinks by specifying the alternative title after a so-called pothole: `|`. Lets have a look at an example:

```Markdown
[[Filename|Alternative Title]]
[[Filename|Another Alternative Title]]
```

Both Wikilinks will be displayed with their alternative titles but link to the same file.
Lychee tries to resolve these Links by stripping away the alternative title and resolving by the remaining Filename only.
26 changes: 0 additions & 26 deletions src/content/docs/recipes/wikilinks.md

This file was deleted.