jekyll-autolinks

Automatically create <a> DOMs from standard URLs for your Jekyll site.

BSD-3-CLAUSE License

Downloads
1.8K
Stars
1
Committers
1

Jekyll::Autolinks

Automatically create <a> DOMs from standard URLs for your Jekyll site.

In any html page or post, standard URLs and emails will be autolinked.

Modified based on ivantsepp/jekyll-autolink_email.

Installation

  1. Add to your Gemfile:

    gem 'jekyll-autolinks'
    
  2. Add to your _config.yml:

    gems:
      - jekyll-autolinks
    

Configuration

Autolinking is done by Rinku so visit that gem for a more in-depth explanation of the configuration options:

autolinks:
  link_attr: 'target="_blank"'
  skip_tags: ["a", "pre", "code", "kbd", "script"]
  • link_attr is a string containing the link attributes for each link that will be generated. These attributes are not sanitized and will be include as-is in each generated link, e.g.

    link_attr: 'target="_blank" class="my-link"'
    # hi.com => '<a href="http://hi.com" target="_blank" class="my-link">hi.com</a>'
    
  • skip_tags is a list of strings with the names of HTML tags that will be skipped when autolinking. If nil, this defaults to the value of the global Rinku.skip_tags, which is initially ["a", "pre", "code", "kbd", "script"].

Suggestion, Bug Reporting, Contributing

Before opening new Issue/Discussion/PR and posting any comments, please read Contributing Guidelines.

Copyright and License

Copyright 2023-2024 ADoyle ([email protected]). Some Rights Reserved. The project is licensed under the BSD 3-clause License.

Read the LICENSE file for the specific language governing permissions and limitations under the License.

Read the NOTICE file distributed with this work for additional information regarding copyright ownership.

Package Rankings
Top 40.94% on Rubygems.org