Add calendar shortcode
This commit is contained in:
parent
925737eff5
commit
6eceb15f18
6 changed files with 140 additions and 0 deletions
20
README.md
20
README.md
|
|
@ -47,6 +47,25 @@ For a different event than the page's section, pass its name: `{{< schedule 39c3
|
|||
|
||||
Without a data file, or without any tours in it, the shortcode renders nothing and the build logs a warning. To silence it, for example for an upcoming event, add `warning-schedule-empty` to `ignoreLogs` in `hugo.yaml`.
|
||||
|
||||
## Shortcode: Calendar entry
|
||||
|
||||
`{{< calendar >}}` adds two links after a tour date: a calendar file (`.ics`) and a link that adds the date in Google Calendar. Hackertours-Admin puts it into the list of dates on each tour page:
|
||||
|
||||
```markdown
|
||||
* Tag 1 (27.12.) **17:30 Uhr** {{< calendar date="2026-12-27" time="17:30" duration="210" >}}
|
||||
```
|
||||
|
||||
| Param | Required | Content |
|
||||
|---|---|---|
|
||||
| `date` | yes | `YYYY-MM-DD` |
|
||||
| `time` | yes | Start time `HH:MM`, local time in Hamburg |
|
||||
| `duration` | no | Length in minutes. Without it, `duration` of the tour in `tours` in the schedule file is used (see "Map data in the schedule file"); without either, the calendar entry has no end time and the build logs a warning with the ID `warning-calendar-duration`. |
|
||||
| `title` | no | Title of the calendar entry. Without it, the `title` of this date in the schedule file is used, then the page title. |
|
||||
|
||||
The `.ics` file is in the iCalendar format (RFC 5545), which Apple Calendar, Outlook, Thunderbird and most other calendar apps open directly, as does Google Calendar when importing a file. The extra Google Calendar link is there because the Google Calendar app on Android doesn't open downloaded `.ics` files.
|
||||
|
||||
Each entry starts at the time given, in Hamburg time, at the Hackertours desk (with `map.origin` from the schedule file as the address, if there is one). Its description is the tour summary and a link to the tour page. The files are generated next to the tour page, one per date and language, e.g. `/de/40c3/tour-of-the-giants/tour-of-the-giants-2026-12-27-1730.ics`.
|
||||
|
||||
## Shortcode: Tour map
|
||||
|
||||
`{{< tour-map >}}` on an event's overview page shows a map of the tour locations, with the routes from the Congress, on OpenStreetMap. For a different event than the page's section, pass its name: `{{< tour-map 39c3 >}}`. It uses [Leaflet](https://leafletjs.com), which is kept in [assets/vendor/leaflet/](assets/vendor/leaflet/).
|
||||
|
|
@ -101,6 +120,7 @@ days:
|
|||
| `icon` | no | Name of an icon for the marker, see "Map icons" below. Without it, or with an unknown name, the marker is a plain coloured circle; an unknown name also logs a build warning. |
|
||||
| `directions` | no | How to get there from the origin, per language (`de`, `en`) as Markdown, usually a short list of steps. |
|
||||
| `route` | no | The way from `map.origin` to `geo` as a list of legs in travel order. Without it the tour only gets a marker. |
|
||||
| `duration` | no | Length of the tour in minutes, used by the calendar entries when the `calendar` shortcode doesn't pass one. |
|
||||
|
||||
Each leg in `route` has:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue