More Premium Hugo Themes Premium Jekyll Themes

Jekyll Target Blank

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

Jekyll Target Blank

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

Author Avatar Theme by keithmifsud
Github Stars Github Stars: 114
Last Commit Last Commit: Apr 25, 2023 -
First Commit Created: Jan 15, 2024 -
Jekyll Target Blank screenshot

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.