Published 2020-10-03.
Last modified 2023-06-09.
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 ifcite
was not specified. -
by
– Preface the citation with the preposition 'By'. Ignored ifcite
was not specified. cite
– Citation textclass
– Add specified CSS classes to outer div-
noprep
– Do not preface the citation with a preposition. Ignored ifcite
was not specified. style
– Add specified CSS styles to outer div-
url
– URL for the citation. Ignored ifcite
was 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
,cite
andurl
were 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
,cite
andurl
were 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
,cite
andurl
were 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 acite
was specified. – From Blaise Pascal -
HTML or markdown
{% quote by cite="Blaise Pascal" %} <code>By</code> and <code>cite</code> were specified. {% endquote %}
Renders as:
By
andcite
were 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
,By
andcite
were 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
,noprep
andcite
were specified.– Blaise Pascal -
HTML or markdown
{% quote %} No <code>cite</code> or <code>url</code> was provided for this quote. {% endquote %}
Renders as:
Nocite
orurl
was 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
.