Published 2020-10-03.
Last modified 2025-01-14.
Time to read: 2 minutes.
jekyll_plugins collection.
This Jekyll plugin formats citations and quotes in a Jekyll website.
Installation
Add the following highlighted line to your Jekyll project's Gemfile,
within the jekyll_plugins group:
group :jekyll_plugins do gem 'jekyll_quote' end
And then execute:
$ bundle
Syntax
{% quote OPTIONS %}
Content of quote goes here.
{% endquote %}
The default preposition is 'From'.
OPTIONS are:
-
break– Put the citation on a separate line. Ignored ifcitewas not specified. -
by– Preface the citation with the preposition 'By'. Ignored ifcitewas not specified. cite– Citation textclass– Add specified CSS classes to outerdivid– HTML id attribute for the enclosingdiv-
noprep– Do not preface the citation with a preposition. Ignored ifcitewas not specified. style– Add specified CSS styles to outer div-
url– URL for the citation. Ignored ifcitewas not specified.
Usage Examples
-
HTML or markdown
{% quote cite="Blaise Pascal, in Lettres provinciales" url="https://en.wikipedia.org/wiki/Lettres_provinciales" %} I have only made this letter longer because I have not had the time to make it shorter. {% endquote %}
Renders as:
I have only made this letter longer because I have not had the time to make it shorter. – From Blaise Pascal, in Lettres provinciales -
HTML or markdown
{% quote break cite="Blaise Pascal" url="https://en.wikipedia.org/wiki/Lettres_provinciales" %} <code>break</code>, <code>cite</code> and <code>url</code> were provided. {% endquote %}
Renders as:
break,citeandurlwere provided.– From Blaise Pascal -
HTML or markdown
{% quote break by cite="Blaise Pascal" url="https://en.wikipedia.org/wiki/Lettres_provinciales" %} <code>by</code>, <code>break</code>, <code>cite</code> and <code>url</code> were provided. {% endquote %}
Renders as:
by,break,citeandurlwere provided.– By Blaise Pascal -
HTML or markdown
{% quote break noprep cite="Blaise Pascal" url="https://en.wikipedia.org/wiki/Lettres_provinciales" %} <code>noprep</code>, <code>break</code>, <code>cite</code> and <code>url</code> were provided. {% endquote %}
Renders as:
noprep,break,citeandurlwere provided. -
HTML or markdown
{% quote noprep cite="Blaise Pascal" url="https://en.wikipedia.org/wiki/Lettres_provinciales" %} <code>noprep</code>, <code>cite</code> and <code>url</code> were provided. {% endquote %}
Renders as:
Without Url
-
HTML or markdown
{% quote cite="Blaise Pascal" %} Only a <code>cite</code> was specified. {% endquote %}
Renders as:
Only acitewas specified. – From Blaise Pascal -
HTML or markdown
{% quote by cite="Blaise Pascal" %} <code>By</code> and <code>cite</code> were specified. {% endquote %}
Renders as:
Byandcitewere specified. – By Blaise Pascal -
HTML or markdown
{% quote break by cite="Blaise Pascal" %} <code>Break</code>, <code>By</code> and <code>cite</code> were specified. {% endquote %}
Renders as:
Break,Byandcitewere specified.– By Blaise Pascal -
HTML or markdown
{% quote break noprep cite="Blaise Pascal" %} <code>Break</code>, <code>noprep</code> and <code>cite</code> were specified. {% endquote %}
Renders as:
Break,noprepandcitewere specified.– Blaise Pascal -
HTML or markdown
{% quote %} No <code>cite</code> or <code>url</code> was provided for this quote. {% endquote %}
Renders as:
Nociteorurlwas provided for this quote.
Without Cite
{% quote url="https://en.wikipedia.org/wiki/Lettres_provinciales" %}
No cite was provided for this quote.
{% endquote %}
Renders as:
cite was provided for this quote.
Demo
A demo / test website is provided in the demo directory.
It can be used to debug the plugin or to run freely.
Please examine the HTML files in the demo to see how the plugin works.
-
To run the demo freely from the command line, type:
Shell$ demo/_bin/debug -r - View the generated website at
localhost:4444.