Skip to content

Instantly share code, notes, and snippets.

@jessgusclark
Last active October 24, 2018 20:01
Show Gist options
  • Save jessgusclark/ceb68b45832a118e7f586c2968e014ca to your computer and use it in GitHub Desktop.
Save jessgusclark/ceb68b45832a118e7f586c2968e014ca to your computer and use it in GitHub Desktop.
Hello World Jekyll Plugin
module Jekyll
class HelloWorld < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@text = text
end
def render(context)
"Hello World, #{@text}!"
end
end
end
Liquid::Template.register_tag('hello', Jekyll::HelloWorld)
@jessgusclark
Copy link
Author

Save this file in _plugins and add {% hello Jesse %} to a markdown file or template. Then run bundle exec jekyll serve and navigate to the page. Based on the Jekyll docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment