Class: Jekyll::Zettel::Blatt

Inherits:
Object
  • Object
show all
Includes:
Jekyll::Zettel
Defined in:
lib/jekyll/zettel/blatt.rb

Overview

Scaffolder for infotype Glosse

Constant Summary

Constants included from Jekyll::Zettel

LOG_KEY, VERSION

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
# File 'lib/jekyll/zettel/blatt.rb', line 8

def scaffold(args)
  return nil if args_empty?(args)

  slug = create_slug(args.first)
  file = "arbeitsblatt/#{slug}/index.md"
  return file if create_dir_defensively('Arbeitsblatt', slug, file).nil?

  create_page({ 'slug' => slug, 'title' => args.first }, file, 'blatt.md')

  Jekyll.logger.info '', "Created blatt with slug `#{slug}`"
  file
end