Created
April 15, 2019 12:17
-
-
Save salemine/a47f8db048ed79e3d7f320b780a9733c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require 'plugin_name/version' | |
require 'fileutils' | |
module plugin_name | |
class Error < StandardError; end | |
# Your code goes here... | |
Jekyll::Hooks.register :site, :after_init do |_jekyll| | |
p '========> GOT HERE INSIDE GEM AFTER_INIT HOOK' | |
File.open('index.md', 'w') { |file| file.write("---\nlayout: home\n---\n") } | |
# puts 'current JEKYLL theme is ' | |
# puts _jekyll.theme.inspect | |
faq_index_file = "#{_jekyll.theme.root}/faqs.md" | |
FileUtils.cp faq_index_file, 'faqs.md' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment