pattex / jekyll-tagging

Jekyll plugin to automatically generate a tag cloud and tag pages.
385 stars 76 forks source link

Remove accents on tags url #53

Open eamaral92 opened 8 years ago

eamaral92 commented 8 years ago

I've made a tag cloud on Jekyll with jekyll-tagging plugin. The plugin works fine, but when o need to iterate trough tags and append the name to a url, the accents still there, wich causes a error, even with the slugfy method. I'm new with RUBY and i didn't found any native RUBY method to remove the accents, even on Jekyll.

MikkCZ commented 1 year ago

The solution would be to replace the current implementation of jekyll_tagging_slug in the Helper module https://github.com/pattex/jekyll-tagging/blob/76fbc51bc644c660144ed9f6a1b0a854b23ee0f8/lib/jekyll/tagging.rb#L15 with the following line

Jekyll::Utils::slugify(str.to_s, mode: 'latin', cased: true)
MikkCZ commented 1 year ago

What you can to work around this without forking the plugin (based on the activity it seems unlikely this will get fixed):

  1. In your Jekyll website source code create a folder _plugins.
  2. In the _plugins folder, create a new file with arbitrary name (e.g. tagging.rb) and the following content

    require 'jekyll/tagging'
    
    module Jekyll
      module Helpers
        def jekyll_tagging_slug(str)
          Jekyll::Utils::slugify(str.to_s, mode: 'latin', cased: true)
        end
      end
    end
  3. Remove the existing registration of jekyll/tagging from the gems/plugins in your _config.yml, or require 'jekyll/tagging' from _plugins/ext.rb, which is the method described in this repository README.