Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 25, 2025

The link checker was failing with 9 errors because it was trying to validate URLs in _static/webpack-macros.html that contain unprocessed Jinja2 template variables. This file is generated by the quantecon_book_theme during the Jupyter Book build process but contains template syntax like:

{{ pathto('_static/scripts/bootstrap.js', 1) }}
{{ pathto('_static/styles/pydata-sphinx-theme.css', 1) }}
{{ pathto('_static/vendor/fontawesome/6.5.2/css/all.min.css', 1) }}

The link checker was interpreting these template variables as literal file URLs, causing "Cannot find file" errors for all 9 template references in the file.

Solution

Created a lychee.toml configuration file to centralize lychee settings and exclude _static/webpack-macros.html. This approach is cleaner and more maintainable than using command-line parameters in the workflow file. The configuration file includes:

  • Exclusion of the problematic template file with clear documentation
  • Acceptance of 403 and 503 HTTP status codes
  • Version-controlled settings that can be easily modified

This prevents false positive errors while maintaining link checking for all legitimate content files.

Fixes #248.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@netlify
Copy link

netlify bot commented Aug 25, 2025

Deploy Preview for lustrous-melomakarona-3ee73e ready!

Name Link
🔨 Latest commit 41923a0
🔍 Latest deploy log https://app.netlify.com/projects/lustrous-melomakarona-3ee73e/deploys/68abce4d9f24a00007c24acd
😎 Deploy Preview https://deploy-preview-249--lustrous-melomakarona-3ee73e.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
@mmcky
Copy link
Contributor

mmcky commented Aug 25, 2025

@copilot is there a way to specify this in a lychee toml or yaml configuration file?

Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
Copilot AI changed the title [WIP] Link Checker Report Fix link checker by excluding webpack-macros.html template file Aug 25, 2025
Copilot AI requested a review from mmcky August 25, 2025 02:42
Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 25, 2025

@copilot is there a way to specify this in a lychee toml or yaml configuration file?

Yes! I've moved the configuration to a lychee.toml file which is cleaner and more maintainable. Lychee automatically picks up the configuration from this file, so we no longer need the command-line arguments in the workflow. The configuration file includes the same settings (accepting 403/503 status codes and excluding the webpack-macros.html file) with clear documentation. See commit 41923a0.

Copilot AI changed the title Fix link checker by excluding webpack-macros.html template file Fix link checker by moving configuration to lychee.toml file Aug 25, 2025
@mmcky mmcky marked this pull request as ready for review August 25, 2025 02:58
@mmcky mmcky merged commit 43e9bc7 into main Aug 25, 2025
8 checks passed
@mmcky mmcky deleted the copilot/fix-248 branch August 25, 2025 02:59
@github-actions
Copy link

@github-actions github-actions bot temporarily deployed to pull request August 25, 2025 03:07 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link Checker Report

2 participants