Class: Jekyll::Zettel::Zeitleiste
- Inherits:
-
Object
- Object
- Jekyll::Zettel::Zeitleiste
- Includes:
- Jekyll::Zettel
- Defined in:
- lib/jekyll/zettel/zeitleiste.rb
Overview
Scaffolder for infotype Glosse
Constant Summary
Constants included from Jekyll::Zettel
Instance Method Summary collapse
Methods included from Jekyll::Zettel
#args_empty?, #create_dir_defensively, #create_page, #create_slug, #evaluate_template, #write_catalog
Instance Method Details
#scaffold(args) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/jekyll/zettel/zeitleiste.rb', line 8 def scaffold(args) return nil if args_empty?(args) slug = create_slug(args.first) file = "zeitleiste/#{slug}/index.md" return file if create_dir_defensively('Zeitleiste', slug, file).nil? create_page({ 'slug' => slug, 'title' => args.first }, file, 'zeitleiste.md') string = File.read(File.('../stubs/timeline.json', __dir__)) File.open("zeitleiste/#{slug}/timeline.json", 'w') { |out| out.write string } Jekyll.logger.info '✓', "Created zeitleiste with slug `#{slug}`" file end |