jekyll-target-blank | Automatically opens external links in a new browser | Plugin library

 by   keithmifsud Ruby Version: v2.0 License: MIT

kandi X-RAY | jekyll-target-blank Summary

kandi X-RAY | jekyll-target-blank Summary

jekyll-target-blank is a Ruby library typically used in Plugin, Jekyll applications. jekyll-target-blank has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Automatically adds a target="_blank" rel="noopener noreferrer" attribute to all external links in Jekyll's content plus several other automation features for the external links. Read more here.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              jekyll-target-blank has a low active ecosystem.
              It has 91 star(s) with 18 fork(s). There are 4 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 14 open issues and 22 have been closed. On average issues are closed in 72 days. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of jekyll-target-blank is v2.0

            kandi-Quality Quality

              jekyll-target-blank has 0 bugs and 0 code smells.

            kandi-Security Security

              jekyll-target-blank has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              jekyll-target-blank code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              jekyll-target-blank is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              jekyll-target-blank releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              jekyll-target-blank saves you 257 person hours of effort in developing the same functionality from scratch.
              It has 624 lines of code, 33 functions and 6 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of jekyll-target-blank
            Get all kandi verified functions for this library.

            jekyll-target-blank Key Features

            No Key Features are available at this moment for jekyll-target-blank.

            jekyll-target-blank Examples and Code Snippets

            Jekyll Target Blank,Usage,Configuration
            Rubydot img1Lines of Code : 19dot img1License : Permissive (MIT)
            copy iconCopy
            target-blank:
                css_class: ext-link
            
            target-blank:
                add_css_classes: css-class-one css-class-two
            
            target-blank:
               noopener: false
            
            target-blank:
               noreferrer: false
            
            target-blank:
               noopener: false
               noreferrer: false
            
            target-blank:
                rel:  
            Jekyll Target Blank,Installation
            Rubydot img2Lines of Code : 5dot img2License : Permissive (MIT)
            copy iconCopy
            gem 'jekyll-target-blank'
            
            plugins:
              - jekyll-target-blank
            
            gems:
              - jekyll-target-blank
              
            Jekyll Target Blank,Usage,Examples
            Rubydot img3Lines of Code : 4dot img3License : Permissive (MIT)
            copy iconCopy
            Google
            
            Google
            
            [Google](https://google.com)
              

            Community Discussions

            QUESTION

            How to Install/Use Jekyll Plugins in GitHubPages?
            Asked 2018-Aug-28 at 09:38

            I've created a GitHubPage together with Jekyll, and currently I'm trying to use some of the basic plugins that are available. So far nothing fancy, I'm using the whitelisted plugins, specifically this one. It opens links in new tabs, which isn't supported by default in Markdown.

            So far, I've created the site using myusername.github.io repo, cloned it to local, and created a basic site using jekyll new . as is instructed here. Then I pushed all changes to GitHub and it's all working fine.

            Then, to install the above mentioned plugin, I followed the steps mentioned in the help section, namely, these things:

            ...

            ANSWER

            Answered 2018-Aug-23 at 05:10

            I'm the developer of Jekyll Target Blank. GH Pages only support some plugins https://help.github.com/articles/adding-jekyll-plugins-to-a-github-pages-site/. I have requested for this plugin to become supported but they their response was a maybe.

            Source https://stackoverflow.com/questions/51977736

            QUESTION

            Process Jekyll content to replace first occurrence of any post title with a hyperlink of the post with that title
            Asked 2018-Jul-02 at 01:51
            What I'm trying to do

            I am building a Jekyll ruby plugin that will replace the first occurrence of any word in the post copy text content with a hyperlink linking to the URL of a post by the same name.

            The problems I'm having

            I've gotten this to work but I can't figure out two problems in the process_words method:

            1. How to only search for a post title in the main content copy text of the post, and not the meta tags before the post or the table of contents (which is also generated before main post copy text)? I can't get this to work with Nokigiri, even though that seems to be the tool of choice here.
            2. If a post's URL is not at post.data['url'], where is it?
            3. Also, is there a more efficient, cleaner way to do this?

            The current code works but will replace the first occurrence even if it's the value of an HTML attribute, like an anchor or a meta tag.

            Example result

            We have a blog with 3 posts:

            • Hobbies
            • Food
            • Bicycles

            And in the "Hobbies" post body text, we have a sentence with each word appearing in it for the first time in the post, like so:

            ...

            ANSWER

            Answered 2018-Jul-01 at 13:05

            this code looks very familiar :) I suggest you look into the Rspecs test file to test against your issues: https://github.com/keithmifsud/jekyll-target-blank

            I'll try to answer your questions, sorry I couldn't test these myself the time of writing.

            How to only search for a post title in the main content copy text of the post, and not the meta tags before the post or the table of contents (which is also generated before main post copy text)? I can't get this to work with Nokigiri, even though that seems to be the tool of choice here.

            Your requirements here are:

            1) Ignore content outside the tags.

            This seems to already be implemented in the process_html() method. This method is stating the only process the body_content and it should work as it is. Have you got tests for it? How are you debugging it? The same string splitting works in my plugin. I.e. only content inside the body is processed.

            2) Ignore content inside the Table of Contents (TOC). I suggest you extend the process_html() method by further splitting the body_content variable. Search for content in between the opening and closing tags of your TOC (by id, css class etc..) and exclude it, then add it back in it's position before or after process_words string.

            3) Whether to use the Nokigiri plugin? This plugin is great for parsing html. I think you are parsing strings and then creating html. So vanilla Ruby and the URI plugin should suffice. You can still use it if you want but it won't be any faster then splitting strings in ruby.

            If a post's URL is not at post.data['url'], where is it?

            I think you should a have method to get all all post titles and then match the "words" against the array. You can get all the posts collection from the doc itself doc.site.posts and foreach post return the title. The the process_words() method can check each work to see if it matched an item from the array. But what if the title is made of more than one word?

            Also, is there a more efficient, cleaner way to do this?

            So far so good. I'll start with getting the issues fixed and then refactor for speed and coding standards.

            Again I suggest you use testing to help you with this.

            Let me know if I can help more :)

            Source https://stackoverflow.com/questions/51121867

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install jekyll-target-blank

            Add the following to your site's Gemfile. and add the following to your site's _config.yml.

            Support

            Simply create an issue and I will respond as soon as possible.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/keithmifsud/jekyll-target-blank.git

          • CLI

            gh repo clone keithmifsud/jekyll-target-blank

          • sshUrl

            git@github.com:keithmifsud/jekyll-target-blank.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link