]>
git.r.bdr.sh - rbdr/r.bdr.sh/blob - _plugins/tag_generator.rb
1f616b6cd5fe081494c17e92bc6b76e3118f71b4
4 def initialize(site
, base
, dir
, tag
)
11 self.read_yaml(File
.join(base
, '_layouts'), 'tag_index.html')
12 self.data['tag'] = tag
14 tag_title_prefix
= site
.config
['tag_title_prefix'] || 'Tag: '
15 self.data['title'] = "#{tag_title_prefix}#{tag}"
16 self.data['description'] = "Lista de articulos con la etiqueta #{tag} en Abuguet, el blog mas guapo de videojuegos."
20 class TagGenerator
< Generator
24 if site
.layouts
.key
? 'tag_index'
25 dir
= site
.config
['tag_dir'] || 'tags'
26 site
.tags
.keys
.each
do |tag
|
27 write_tag_index(site
, File
.join(dir
, tag
), tag
)
32 def write_tag_index(site
, dir
, tag
)
33 index
= TagIndex
.new(site
, site
.source
, dir
, tag
)
34 index
.render(site
.layouts
, site
.site_payload
)
35 index
.write(site
.dest
)