Skip to content

Add option to validate links #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Add option to validate links #96

wants to merge 4 commits into from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented May 19, 2025

This PR adds a new configuration option validate_links to the Jekyll Relative Links plugin. When enabled, it provides functionality similar to Jekyll's native {% link %} tag by validating that linked files actually exist.

Features

  • Added new validate_links configuration option (default: false for backward compatibility)
  • When enabled, the plugin will raise an error when a link points to a nonexistent file
  • Added documentation in README explaining the new feature
  • Added tests to verify validation behavior

Usage

To enable link validation, add this to your _config.yml:

relative_links:
  validate_links: true

With this option enabled, Jekyll will raise an error during build if any relative link points to a nonexistent file, helping to prevent broken links in your site.

Fixes #77.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: benbalter <282759+benbalter@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Validating links? Add option to validate links May 19, 2025
@Copilot Copilot AI requested a review from benbalter May 19, 2025 18:41
Copilot finished work on behalf of benbalter May 19, 2025 18:41
@benbalter benbalter marked this pull request as ready for review May 19, 2025 20:29
@benbalter
Copy link
Owner

@copilot can you fix the failing tests?

@benbalter
Copy link
Owner

@copilot can you fix the failing tests?

Co-authored-by: benbalter <282759+benbalter@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented May 21, 2025

@copilot can you fix the failing tests?

I've fixed the failing tests by addressing the RuboCop violations. The main issues were:

  1. Trailing whitespace in both source and test files
  2. Minor style issues in the test code for regular expressions and block syntax
  3. A pre-existing complexity issue in the replace_relative_links! method

All tests are now passing. The commit that fixes these issues is 6440423.

Copilot finished work on behalf of benbalter May 21, 2025 16:24
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.

Validating links?
2 participants