Add events calendar with ICS feed and switch content naming to English
This commit is contained in:
1 parent
f24a4e73a2
commit
9459d2aeaa
28 files changed
+607
-29
No files matched your search
@@ -10,6 +10,7 @@ builder.Services.AddRazorComponents();
|
||||
// Content is read once at startup and cached -> singletons.
|
||||
builder.Services.AddSingleton<PageService>();
|
||||
builder.Services.AddSingleton<PostService>();
|
||||
builder.Services.AddSingleton<EventService>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
@@ -40,4 +41,9 @@ app.UseAntiforgery();
|
||||
app.MapStaticAssets();
|
||||
app.MapRazorComponents<App>();
|
||||
|
||||
// Subscribable calendar feed of all events. A minimal API endpoint rather than
|
||||
// a Razor page because it returns text/calendar, not HTML.
|
||||
app.MapGet("/termine.ics", (EventService events) =>
|
||||
Results.Text(IcsCalendar.Build(events.All), "text/calendar; charset=utf-8"));
|
||||
|
||||
app.Run();
|
||||
Reference in new issue
Block a user