File: another-test-plugin.rb

package info (click to toggle)
ruby-jekyll-data 1.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 420 kB
  • sloc: ruby: 909; sh: 95; makefile: 10
file content (19 lines) | stat: -rw-r--r-- 415 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

require "jekyll"

# code abstracted from the official 'jekyll-feed' plugin
# at https://github.com/jekyll/jekyll-feed/

Jekyll::Hooks.register :site, :pre_render do |site|
  page = AnotherTestPlugin::NoFile.new(site, "", "", "test-sitemap.xml")
  site.pages << page
end

module AnotherTestPlugin
  class NoFile < Jekyll::Page
    def read_yaml(*)
      @data ||= {}
    end
  end
end