@@ -6,9 +6,12 @@ Using this job you will be able to detect most (see [here](#types-of-link-verifi
It uses the tool [`Liche`](https://github.com/raviqqe/liche){:target="_blank"} in [Go](https://golang.org/){:target="_blank"} to test and find the links in your documents. In its default state, this job will analyze your whole project for eligible files to verify.
!!! warning
This job may generate a lot errors about local broken links in your document if you are using **absolute paths** or **rewriting urls**. See [Absolute paths and rewriting urls](#absolute-paths-and-rewriting-urls)
## How to use it
1. Have `.md` or `.html` files in your project
1. Have `.md`, `.html` or `.htm` files in your project
2. Add the corresponding URL to your `.gitlab-ci.yml` file (see [Getting
started](/getting-started)). Example:
@@ -33,17 +36,62 @@ It uses the tool [`Liche`](https://github.com/raviqqe/liche){:target="_blank"} i
| Name | Description | Default |
| ---- | ----------- | ------- |
| `LICHE_DIRECTORY`<imgwidth=450/> | Path to the directory to be scanned | `` |
| `LICHE_DIRECTORY`<imgwidth=450/> | Path to the directory to be scanned | `/` |
| `LICHE_FILES` | A list of files (separated with spaces) to scan. It can be used with `LICHE_DIRECTORY` | ` ` |
| `LICHE_EXCLUDE` | A [regular expression](https://en.wikipedia.org/wiki/Regular_expression){:target="_blank"} | ` ` |
| `LICHE_PRINT_OK` | In addition to broken links, it will add not-broken links in the report (see [artifacts](#artifacts)) | `true` |
| `LICHE_RECURSIVE` | When `LICHE_DIRECTORY` is filled it will search for files recursively | `true` |
| `FAIL_ON_BROKEN` | Make your pipeline fails when a broken link is found | `false` |
| `ROOT_DIRECTORY` | Used for absolute paths, it define the root of HTML projects | ` ` |
If you are using absolute paths in your HTML documents, be sure to fill the variable `ROOT_DIRECTORY`. By default, if you use `LICHE_DIRECTORY`, `ROOT_DIRECTORY` will be filled with the same path.
If you use URL rewriting in your static website, using this job, most of the internal links will be considered as broken. To avoid that, you can define that you
only want to check external links, by using `LICHE_EXCLUSE` with the following value: `"^[^http]"`
### Artifacts
We use [Junit](https://junit.org/junit5/){:target="_blank"}'s XML report to display error report