[skip ci] Added url, original_url and archive_date to the cite_book shortcode

This commit is contained in:
Nicola Belluti 2025-01-29 12:42:37 +01:00
parent 7076d2fd83
commit f2b95eacc9
4 changed files with 16 additions and 7 deletions

View File

@ -9,11 +9,10 @@
{{ with .date }}({{ . }}).{{ end }}
{{/* Chapter */}}
{{ with .chapter }}"{{ . }}"{{ end }}
{{ with .chapter }}"{{ . }}" in{{ end }}
{{/* Title and edition */}}
{{ with .title }}in <i>{{ . }}</i>{{ end }}
{{ with .edition }}({{ . }} ed.){{ end }}.
{{/* Title, edition and URL */}}
{{ with .url }}<a href="{{ . }}">{{ end }}{{ with .title }}<i>{{ . }}</i>{{ end }}{{ with .edition }}({{ . }} ed.){{ end }}{{ if .url }}</a>{{ end }}.
{{/* Publisher */}}
{{ with .publisher }}{{ . }}.{{ end }}
@ -25,4 +24,7 @@
{{/* ISBN */}}
{{ with .isbn }}ISBN <a target="_blank" href="https://en.wikipedia.org/wiki/Special:BookSources/{{ . }}">{{ . }}</a>.{{ end }}
{{/* Archive info */}}
{{ with .original_url }}Archived from <a href="{{ . }}">the original</a>{{ end }}{{ with .archive_date }} on {{ . }}{{ end }}.
</div>

View File

@ -28,9 +28,12 @@ A template for citing books inspired by the "cite book" template of Wikipedia.
"pages" (.Get "pages")
"title" (.Get "title")
"edition" (.Get "edition")
"url" (.Get "url")
"date" (.Get "date")
"publisher" (.Get "publisher")
"isbn" (.Get "isbn")
"author" (.Get "author")
"author2" (.Get "author2")
"original_url" (.Get "original_url")
"archive_date" (.Get "archive_date")
) }}

View File

@ -16,8 +16,8 @@ Wikipedia.
date = "2007-06-09"
location = "San Diego, CA"
original-url = "https://www.csc2.ncsu.edu/faculty/efg/wcae/ISCA2007/FinalProgram.html"
archive-date = "2025-01-29"
original_url = "https://www.csc2.ncsu.edu/faculty/efg/wcae/ISCA2007/FinalProgram.html"
archive_date = "2025-01-29"
>}}
```
@ -41,6 +41,6 @@ Wikipedia.
{{ with .Get "location" }}{{ . }}.{{ end }}
{{/* Archive info */}}
{{ with .Get "original-url" }}Archived from <a href="{{ . }}">the original</a>{{ end }}{{ with .Get "archive-date" }} on {{ . }}{{ end }}.
{{ with .Get "original_url" }}Archived from <a href="{{ . }}">the original</a>{{ end }}{{ with .Get "archive_date" }} on {{ . }}{{ end }}.
</div>

View File

@ -50,4 +50,8 @@ specifically
"publisher" "McGraw-Hill Higher Education"
"author" "Patt, Yale N."
"author2" "Patel, Sanjay J."
"url" ""
"original_url" ""
"archive_date" ""
) }}