This is the Hugo theme for Distill. It is aimed primarily at authors who'd like to self-host Distill like expositions with Hugo.
It is currently based off Distill Template v2.
See a hosted demo at https://distillpub.sanyamkapoor.com.
For an up-to-date list of front matter options, see distill.md.
There a few custom shortcodes for common use cases in addition to the presets provided by Hugo.
{{<date>}}
Writes the current date.
{{<footnote>}}This is a footnote{{</footnote>}}
Write a footnote (composable with other shortcodes).
{{<cite bib="comma,separated,list,of,bib,titles">}}
Make sure to have relevant BibTeX
file linked. See index.md
for usage.
{{<math>}}c^2 = a^2 + b^2{{</math>}}
To use block display, just add the optional named block
attribute with empty string as
{{<math block="true">}}c^2 = a^2 + b^2{{</math>}}
{{<code language="python" block="true">}}
# Python 3: Fibonacci series up to n
def fib(n):
a, b = 0, 1
while a < n:
print(a, end=' ')
a, b = b, a+b
{{</code>}}
language
and block
are optional attributes to specify the language and
block display options respectively.
You can also embed fully interactive graphs via vega-lite
by specifying a unique
id and the URL to a JSON Vega Grammar specification.
{{<vega id="viz" spec="https://raw.githubusercontent.com/vega/vega/master/docs/examples/bar-chart.vg.json">}}
You need to add the following parameter to your front matter to make sure the necessary libraries are loaded on the desired page.
vega = true
The example site can be built by running
$ make example
Start a hugo server using the following command and develop!
$ make devel
Distill for the amazing Template.
MIT