-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create CodeTag
plugin to render code files with and without solutions
#29
Conversation
To ensure the `link` liquid tag works
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ss-site into python-plugin
Maybe using the https://blog.sverrirs.com/2016/04/custom-jekyll-tags.html#accessing-post-variables-in-tags https://github.com/Shopify/liquid/blob/main/lib/liquid/context.rb#L176 Will investigate... edit: yep this works. example: # frozen_string_literal: true
module Jekyll
class MyTag < Liquid::Tag
def render(context)
context['page.nav_exclude'] == true # displays true when the tag is rendered if the variable is set to true
end
end
end
Liquid::Template.register_tag('my_tag', Jekyll::MyTag) |
- Undo changes to home.md - Use code tag in sample question and another question
PythonTag
plugin to render Python files with and without solutionsCodeTag
plugin to render code files with and without solutions
Copying conversation from Slack: @.cycomachead
@.phrdang
|
Created a custom Liquid tag called
CodeTag
as a Jekyll plugin. This tag allows staff to easily "import" code snippets located in the_includes/
directory, and hide/show solutions as needed.Fixes phrdang#14
Next steps (in separate PRs)
highlight
block"*** YOUR CODE HERE ***"
if@show_solution
isfalse
?