This 11ty (Eleventy) plugin adds a Links section to a page (post, page, whatever) listing the all the links on the current page. This is useful if you put a lot of links in your site's articles and want to provide an easy way for readers to see all the links in one place.
To use this plugin, within the page content, add the following shortcode where you want the links to appear:
{% pageLinks %}
With that in place, the plugin automatically generates a list of links at that location on the page. You can set global configuration options that apply to the generated links on every page. You can also override the default settings through parameters passed to the shortcode.
The plugin supports the following options:
List Types:
- Simple list - (default) Generates a simple list of page links with each link in a separate paragraph.
- Ordered list - Generates a list of page links as an ordered list using the
<ol>and</ol>tags - Unordered list - Generates a list of page links as an ordered list using the
<ul>and</ul>tags
List Options:
- New Tab - (default) Links open in a new tab (using
target="_blank" rel="noopener noreferrer"in the generated anchor tag). - Same Tab - Links open in a the same browser window.
- Collapsible list - Link list and renders it in a collapsed section on the page using the
<details>and<summary>tags. - Styled List - Allows you to apply a CSS class to the list container on the page.
- Minimum Links - Only generate the link list when there's at least a specified number of links on the page.
- External Only - Don't generate links for any internal (local) links.
Use the menu at the top of the page see examples of each of the available options in action.