Skip to content

Commit cfba957

Browse files
Add last updated date
1 parent e7932a7 commit cfba957

File tree

7 files changed

+32
-1
lines changed

7 files changed

+32
-1
lines changed

.github/workflows/webpage.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
--toc-depth=1
4040
--resource-path=.
4141
--lua-filter=pandoc/paper.lua
42+
--lua-filter=pandoc/date.lua
4243
src/index.md
4344
4445
- name: Setup Pages

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ website:
1010
--toc-depth=1 \
1111
--resource-path=. \
1212
--lua-filter=pandoc/paper.lua \
13+
--lua-filter=pandoc/date.lua \
1314
src/index.md

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,20 @@ assume them to be empty otherwise), while the other fields (`venue`, `year`,
197197
* `link`
198198
* `git`
199199

200+
## Updating the HTML template
201+
202+
The `pandoc/template.html4` file contains an HTML template which you can edit
203+
to suit your taste. Any variable mentioned in the header of your `index.md` can
204+
be moved around, and you can even add your own.
205+
206+
There is also a special filter called `pandoc/date.lua` which produces an extra
207+
variable called `date` (unless it is already provided in the header) that is
208+
currently used in the footer of the template to indicate the last time the page
209+
was generated.
210+
211+
> [!NOTE]
212+
> It will only appear in the footer if the `footer` variable is set.
213+
200214
## Sharing files
201215

202216
Anything you put in the `website` directory will be available online too.

pandoc/date.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function Meta(m)
2+
if m.date == nil then
3+
m.date = os.date("%e %B %Y")
4+
return m
5+
end
6+
end

pandoc/template.html4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@
159159
$if(footer)$
160160
<footer>
161161
$footer$
162+
163+
<span class="lastupdate">Last updated: $date$</span>
162164
</footer>
163165
$endif$
164166
</body>

src/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ gitlab: gitlab
2121
bitbucket: bitbucket.com
2222
bluesky: https://bsky.app/
2323
linkedin: https://www.linkedin.com
24-
footer: Based on the [basicpage template](https://github.com/basicpage/basicpage.github.io), made to be easy to use! 🎓
24+
footer: >-
25+
Based on the
26+
[basicpage template](https://github.com/basicpage/basicpage.github.io),
27+
made to be easy to use! 🎓
2528
---
2629

2730
I am a (fake) PhD student, working on 👽 science on all kinds of related topics.

website/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,10 @@ div.files a:hover {
335335
text-decoration: none;
336336
}
337337

338+
span.lastupdate {
339+
color: #9e9d9d;
340+
}
341+
338342
@media screen and (min-width: 1000px) {
339343
header.split {
340344
flex-direction: row;

0 commit comments

Comments
 (0)