Jekyll Target Blank screenshot

Jekyll Target Blank

Author Avatar Theme by Keithmifsud
Updated: 25 Apr 2023
114 Stars

Automatically opens external links in a new browser for Jekyll Pages, Posts and Docs.

Overview

Jekyll Target Blank is a plugin for Jekyll that automatically adds attributes to all external links in Jekyll’s content. It also provides additional automation features for external links.

Features

  • Automatically adds a target="_blank" rel="noopener noreferrer" attribute to all external links in Jekyll’s content
  • Excludes plain text links from the automation
  • Allows customization of the default behavior for opening links in a new browser tab
  • Adds additional CSS classes to qualifying external links
  • Overrides the default rel attribute with custom values

Installation

To install Jekyll Target Blank, follow these steps:

  1. Add the following code snippet to your site’s Gemfile:
    gem 'jekyll-target-blank'
    
  2. Add the following code snippet to your site’s _config.yml file:
    plugins:
      - jekyll-target-blank
    
    Note: If your Jekyll version is less than 3.5, use the following code snippet instead:
    gems:
      - jekyll-target-blank
    

Summary

Jekyll Target Blank is a useful plugin for Jekyll that automates the process of adding attributes to external links in Jekyll’s content. It offers features such as opening links in a new browser tab, adding CSS classes to links, and customizing the rel attribute. By installing this plugin, users can save time and effort in manually adding these attributes to their external links.