Adjust css a bit more
[blog.git] / _plugins / jekyll-umlauts.rb
1 # coding: utf-8
2 # From: https://github.com/webchef/jekyll-umlauts
3 # This generator converts all umlauts äÄöÖüÜ and ß in its correct html equivalent
4 # ü = ü Ü = Ü
5 # ä = ä Ä = Ä
6 # ö = ö Ö = Ö
7 # ß = ß ẞ = ẞ
8 # Author: Arne Gockeln
9 # Website: http://www.Webchef.de
10 module Jekyll
11 class UmlautsGenerator < Generator
12 safe true
13 priority :highest
14
15 def generate(site)
16 site.pages.each do |page|
17 page.content = replace(page.content)
18 end
19
20 site.posts.docs.each do |post|
21 post.content = replace(post.content)
22 end
23 end
24
25 def replace(content)
26 content.gsub!(/ü/, '&uuml;')
27 content.gsub!(/Ü/, '&Uuml;')
28 content.gsub!(/ö/, '&ouml;')
29 content.gsub!(/Ö/, '&Ouml;')
30 content.gsub!(/ä/, '&auml;')
31 content.gsub!(/Ä/, '&Auml;')
32 content.gsub!(/ß/, '&szlig;')
33 content.gsub!(/ẞ/, '&#7838;')
34
35 content
36 end
37 end
38 end