Any way to ignore localhost link with `zola check`?

Hello

I ran zola check to check dead links for my project and it outputted something like this

[shuto@laptop ~/code/blog]$ zola check
Checking site... 
Checking all internal links with anchors. 
> Successfully checked 0 internal link(s) with anchors. 
Checking 89 external link(s). Skipping 0 external link(s). 
> Checked 94 external link(s): 2 error(s) found. 
Error: Failed to check the site 
Error: Found 2 broken external link(s) 
  1. Broken link in /home/shuto/code/blog/content/blog/create-simple-blog-with-zola/index.md to http://127.0.0.1:1111 
/: error sending request for url (http://127.0.0.1:1111/): error trying to connect: tcp connect error: Connection ref 
used (os error 111) 
  2. Broken link in /home/shuto/code/blog/content/blog/create-simple-blog-with-zola/index.md to http://127.0.0.1:1111 
/blog: error sending request for url (http://127.0.0.1:1111/blog): error trying to connect: tcp connect error: Connec 
tion refused (os error 111) 

Are there any workarounds to ignore checking local loopback address?

an ugly hack:

{% if config.mode.check != true %}
    im a prickly link
{% endif %}

You can use skip_prefixes as described in Configuration | Zola

2 Likes

After adding the following to the config.toml, it fixed the problem.

[link_checker]
skip_prefixes = [
    "http://127.0.0.1:1111/",
]

When running zola check, it skipped the link with the prefix I specified.

$ zola check
Checking site...
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
Checking 88 external link(s). Skipping 2 external link(s).

This has solved the problem for me. Thank you!