A Jekyll plugin to convert relative links to markdown files to their rendered equivalents
The Jekyll Relative Links plugin is a tool used to convert relative links to Markdown files into their rendered equivalents. It is designed to ensure that the links work properly when rendering Markdown files on GitHub Pages. This plugin is especially useful for ensuring that links with custom permalinks are correctly converted.
_config.yml file.To install the Jekyll Relative Links plugin, you need to add the following code to your site’s Gemfile:
gem 'jekyll-relative-links'
Then, add the following code to your site’s config file (_config.yml):
plugins:
- jekyll-relative-links
Note: If you are using a Jekyll version less than 3.5.0, use the gems key instead of plugins.
You can also configure the plugin in your _config.yml file under the relative_links key. Here is the default configuration:
relative_links:
enabled: true
If you want to exclude specific directories and/or files, you can add them as patterns under the exclude key:
relative_links:
exclude:
- _my_collection/some_subdir/
- some_file.md
To enable relative links from collection items, set the collections option to true:
relative_links:
collections: true
The Jekyll Relative Links plugin is a useful tool for ensuring that relative links to Markdown files are properly converted when rendering the files on GitHub Pages. It provides a simple solution for handling links with custom permalinks and allows for easy configuration and customization. By automatically converting the relative links, this plugin helps ensure a consistent rendering experience between Markdown files on GitHub.com and GitHub Pages.