Chirpy theme: 'a' tag is missing a reference

Hi, I am using Chirpy theme and here is my project GitHub - SRodi/srodi.github.io

Since this morning the GH Actions jobs are failing with the error below, but I can’t seem to find the root cause.

Can someone help please? thank you!

Running 3 checks (Scripts, Links, Images) in ["_site"] on *.html files...


Checking 43 internal links
Checking internal link hashes in 2 files
Ran on 17 files!


For the Links check, the following failures were found:

* At _site/posts/how-to-test-terraform-modules/index.html:1:

  'a' tag is missing a reference


HTML-Proofer found 1 failure!
Error: Process completed with exit code 1.

I’m guessing the missing reference is the anchor with an empty HREF attribute:

<a href="">Simone Rodigari</a>

The root cause is probably the incomplete author info added in commit:

https://github.com/SRodi/srodi.github.io/commit/fb2fda6cc456257b3f0d95e9687e8e8e8f633d6d

The file data/authors.yml is missing a homepage URL, which probably results in the empty HREF. Here’s the theme’s author doc:

postscript: the theme behavior in the absence of an author’s URL should probably be reported as a bug.

thanks @chuckhoupt ! that was the exact problem. Since I am the only author for now, I have removed the explicit author information in _data/authors.yml and use the default from _config.yml as mentioned in the doc. The GH action jobs are now passing.

I have also created a GH Issue here. Chirpy theme: ‘a’ tag is missing a reference when author url is missing · Issue #1403 · cotes2020/jekyll-theme-chirpy · GitHub

Thanks for the support!

Posting this here in case someone else runs into this.
These kind of errors are a bit tricky to catch locally.
Doing bundle exec jekyll serve , locally builds the website and things look good. But when run on github.com it throws an error about missing a href tags.
Here’s how to re-create the error locally

  1. First build the site locally bundle exec jekyll build
  2. Run HTML proofer locally with these options
bundle exec htmlproofer _site \
    \-\-disable-external \
    \-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"

This should throw an error with the offending bit of HTML, which can then provide more clues as to the real problem
In my case it was a non existent HTTP link in the markdown

1 Like