Sha256: 4ec105cc1796a847d4fd1d90efc525eeb3aee816752b38ae2b5ea1619498ae7f

Contents?: true

Size: 715 Bytes

Versions: 7

Compression:

Stored size: 715 Bytes

Contents

module Jekyll
  module Zettel
    # Scaffolder for infotype Glosse
    class Zeitleiste

      include Jekyll::Zettel

      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.expand_path('../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
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
jekyll-zettel-0.7.2 lib/jekyll/zettel/zeitleiste.rb
jekyll-zettel-0.7.1 lib/jekyll/zettel/zeitleiste.rb
jekyll-zettel-0.7.0 lib/jekyll/zettel/zeitleiste.rb
jekyll-zettel-0.6.10 lib/jekyll/zettel/zeitleiste.rb
jekyll-zettel-0.6.9 lib/jekyll/zettel/zeitleiste.rb
jekyll-zettel-0.6.8 lib/jekyll/zettel/zeitleiste.rb
jekyll-zettel-0.6.7 lib/jekyll/zettel/zeitleiste.rb