Skip to content

Commit

Permalink
Add last updated date
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoWinterhalter committed Nov 7, 2024
1 parent e7932a7 commit cfba957
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/webpage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
--toc-depth=1
--resource-path=.
--lua-filter=pandoc/paper.lua
--lua-filter=pandoc/date.lua
src/index.md
- name: Setup Pages
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ website:
--toc-depth=1 \
--resource-path=. \
--lua-filter=pandoc/paper.lua \
--lua-filter=pandoc/date.lua \
src/index.md
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,20 @@ assume them to be empty otherwise), while the other fields (`venue`, `year`,
* `link`
* `git`

## Updating the HTML template

The `pandoc/template.html4` file contains an HTML template which you can edit
to suit your taste. Any variable mentioned in the header of your `index.md` can
be moved around, and you can even add your own.

There is also a special filter called `pandoc/date.lua` which produces an extra
variable called `date` (unless it is already provided in the header) that is
currently used in the footer of the template to indicate the last time the page
was generated.

> [!NOTE]
> It will only appear in the footer if the `footer` variable is set.

## Sharing files

Anything you put in the `website` directory will be available online too.
Expand Down
6 changes: 6 additions & 0 deletions pandoc/date.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function Meta(m)
if m.date == nil then
m.date = os.date("%e %B %Y")
return m
end
end
2 changes: 2 additions & 0 deletions pandoc/template.html4
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@
$if(footer)$
<footer>
$footer$

<span class="lastupdate">Last updated: $date$</span>
</footer>
$endif$
</body>
Expand Down
5 changes: 4 additions & 1 deletion src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ gitlab: gitlab
bitbucket: bitbucket.com
bluesky: https://bsky.app/
linkedin: https://www.linkedin.com
footer: Based on the [basicpage template](https://github.com/basicpage/basicpage.github.io), made to be easy to use! 🎓
footer: >-
Based on the
[basicpage template](https://github.com/basicpage/basicpage.github.io),
made to be easy to use! 🎓
---

I am a (fake) PhD student, working on 👽 science on all kinds of related topics.
Expand Down
4 changes: 4 additions & 0 deletions website/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ div.files a:hover {
text-decoration: none;
}

span.lastupdate {
color: #9e9d9d;
}

@media screen and (min-width: 1000px) {
header.split {
flex-direction: row;
Expand Down

0 comments on commit cfba957

Please sign in to comment.