Last active
October 24, 2018 20:01
-
-
Save jessgusclark/ceb68b45832a118e7f586c2968e014ca to your computer and use it in GitHub Desktop.
Hello World Jekyll Plugin
This file contains hidden or 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
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Save this file in
_plugins
and add{% hello Jesse %}
to a markdown file or template. Then runbundle exec jekyll serve
and navigate to the page. Based on the Jekyll docs.