Add book shortcode for booking a tour date
All checks were successful
/ build (pull_request) Successful in 2m26s
/ accessibility (pull_request) Successful in 4m9s
/ cleanup-staging (pull_request) Successful in 4s

This commit is contained in:
Stefan Bethke 2026-11-14 21:14:59 +01:00
commit 934bf9d9f4
4 changed files with 41 additions and 0 deletions

View file

@ -264,6 +264,17 @@ span.content-image {
color: var(--color-text-meta);
}
/* Booking button after a tour date, see layouts/_shortcodes/book.html. */
.tour-book {
display: inline-flex;
align-items: center;
gap: 0.4em;
min-height: 24px;
margin-inline-start: 0.4em;
vertical-align: middle;
white-space: nowrap;
}
.fa-icon {
width: 1em;
height: 1em;

View file

@ -1,3 +1,4 @@
book_now: "Jetzt buchen"
calendar_meeting_point: "Hackertours-Desk"
calendar_ics: "iCal Download"
calendar_google: "Google Calendar"

View file

@ -1,3 +1,4 @@
book_now: "Book now"
calendar_ics: "iCal download"
calendar_google: "Google calendar"
calendar_meeting_point: "Hackertours Desk"

View file

@ -0,0 +1,14 @@
{{- /*
A button that books one date of a tour in the ticket shop, with a shopping cart icon. Meant
for the list of dates on a tour page, before the calendar links:
* Tag 1 (27.12.) **17:30 Uhr** {{< book url="https://…/" >}} {{< calendar … >}}
Param: url, the date in the ticket shop.
*/ -}}
{{- $url := .Get "url" -}}
{{- if not $url }}{{ errorf "book: no url: %s" .Position }}{{ end -}}
<a class="button button--small tour-book" href="{{ $url }}">
{{- partial "fa-icon.html" "solid/cart-shopping" }}{{ i18n "book_now" -}}
</a>
{{- /* chomp */ -}}