Skip to content

Instantly share code, notes, and snippets.

@salemine
Created April 15, 2019 12:17
Show Gist options
  • Save salemine/a47f8db048ed79e3d7f320b780a9733c to your computer and use it in GitHub Desktop.
Save salemine/a47f8db048ed79e3d7f320b780a9733c to your computer and use it in GitHub Desktop.
# 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