mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 01:36:13 +00:00
Clean and improve redirects.rb
Use _redirects/ for more consistency with other plugins Fix an inaccurate redirection association in sitemap.rb
This commit is contained in:
parent
dbb1823e69
commit
d58a1690da
6 changed files with 28 additions and 23 deletions
|
@ -37,8 +37,13 @@ module Jekyll
|
|||
lang = file.split('.')[0]
|
||||
locs[lang] = YAML.load_file("_translations/"+file)[lang]
|
||||
end
|
||||
#Load redirections
|
||||
redirects = YAML.load_file('_redirects.yml')['redirects']
|
||||
#Load redirections files
|
||||
redirects = {}
|
||||
Dir.foreach('_redirects') do |file|
|
||||
next if file == '.' or file == '..'
|
||||
id = file.split('.')[0]
|
||||
redirects[id] = YAML.load_file("_redirects/" + file)
|
||||
end
|
||||
#Generate each translated page based on templates
|
||||
locs.each do |lang,value|
|
||||
Dir.foreach('_templates') do |file|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue