Add PocketBase client with contracts and sharp build tooling

This commit is contained in:
tleininger committed 2026-09-22 19:32:32 +02:00
1 parent 56922707ea
commit 251f2d818b
24 files changed
+578 -20

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
using System.Text.Json.Serialization;
namespace Elternbeirat.Contracts;
/// <summary>
/// A content page. Pages also drive the site navigation: <see cref="Location"/>
/// and <see cref="Order"/> decide where and in which order a page appears in the
/// header or footer menu, and <see cref="Embed"/> lists dynamic blocks (posts,
/// events, faqs) rendered below the page body.
/// </summary>
public record Page
{
/// <summary>PocketBase record id.</summary>
[JsonPropertyName("id")]
public string Id { get; init; } = "";
/// <summary>Heading shown to visitors; may contain umlauts and spaces.</summary>
[JsonPropertyName("title")]
public string Title { get; init; } = "";
/// <summary>Page body in Markdown.</summary>
[JsonPropertyName("body")]
public string Body { get; init; } = "";
/// <summary>Where the page appears in the navigation: "header" or "footer".</summary>
[JsonPropertyName("location")]
public string Location { get; init; } = "";
/// <summary>Sort order within its navigation location; smaller is earlier.</summary>
[JsonPropertyName("order")]
public double Order { get; init; }
/// <summary>URL slug (lowercase, no umlauts), e.g. "board" -> /board.</summary>
[JsonPropertyName("slug")]
public string Slug { get; init; } = "";
/// <summary>
/// Dynamic blocks to render below the body: any of "posts", "events", "faqs".
/// Empty for a plain text page.
/// </summary>
[JsonPropertyName("embed")]
public IReadOnlyList<string> Embed { get; init; } = [];
/// <summary>Whether the page is visible to visitors.</summary>
[JsonPropertyName("public")]
public bool Public { get; init; }
}