dash-docs/_plugins/liquid-warn.rb
David A. Harding cbebe461ff Releases: Variablize Release Notes
Add additional variables to the release note files to allow setting the
version number and date.  The version number is required, and can be
used to automatically set the release notes title.  The date is optional
and can be set hours/days after the release.

Additionally, a Makefile test is added that checks whether the download
files exist on the Bitcoin.org server.  This can help prevent creating a
broken Download page.

* Set variables for all previous releases

* Document variables in README.md

* Update code and templates to use variables

* Add the Download page links to the "dl" CSS class. Also add newlines
  to make the HTML a bit easier to parse using sed

* Add a new Liquid plugin to print warnings. This is used to print a
  non-error warning if any release is created without the optional date
2015-02-27 08:15:50 -05:00

31 lines
785 B
Ruby

# This file is licensed under the MIT License (MIT) available on
# http://opensource.org/licenses/MIT.
## liquid-warn.rb prints a warning to stdout (not stderr). This can allow
## someone manually building the site (or reviewing logs) to detect a problem
## Example:
## {% if some_variable_is_set %}
## ...content...
## {% else %}
## {% warn "Optional message" %}
## {% endif %}
module Jekyll
class LiquidWarn < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@warning = text
end
def render(context)
## Use "notice" instead of "warning" because we use grep to
## treat some Jekyll warnings as errors
print "Notice: " + @warning + "\n"
end
end
end
Liquid::Template.register_tag('warn', Jekyll::LiquidWarn)