Skip to content

Commit

Permalink
update citation to have permalink
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Apr 5, 2022
1 parent 2788f61 commit 047340a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion _includes/citation.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

<strong>Suggested Citation:</strong>

<blockquote>Sochat, Vanessa. "{{ page.title }}." @vsoch (blog), {{ page.date | date_to_string }}, {{ site.url }}{{ page.url }} (accessed {{ site.time | date: '%d %b %y' }}).</blockquote>
<blockquote>Sochat, Vanessa. "{{ page.title }}." @vsoch (blog), {{ page.date | date_to_string }}, <a href="{{ site.url }}{{ page.url }}">{{ site.url }}{{ page.url }}</a> (accessed {{ site.time | date: '%d %b %y' }}).</blockquote>
5 changes: 5 additions & 0 deletions _posts/2022/2022-04-05-jinja2-custom-loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Let's say we have "fruits.html" for the above, and then a list of fruits in Pyth
We might do:
```bash
from jinja2 import Template
fruits = ["apple", "orange", "banana"]
Expand All @@ -46,6 +47,8 @@ or rendered as html:
<ul><li>apple</li><li>orange</li><li>banana</li></ul>
<br>
So now let's pretend you have a bit of a more complex template. Instead of hard coding the list
into your file, you instead have a second template, list.html, that expects a listing of things.
Here is list.html:
Expand Down Expand Up @@ -78,7 +81,9 @@ So the solution is to provide it that context. Let's say we have a directory cal
same directory as the file that uses it. We would instead do:
```python
from jinja2 import Environment, FileSystemLoader
import os
here = os.path.dirname(os.path.abspath(__file__))
Expand Down

0 comments on commit 047340a

Please sign in to comment.