diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..a576b1a --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,29 @@ +name: GitHub Pages Deploy + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Deno + uses: denolib/setup-deno@v2 + with: + deno-version: v1.x + - name: Setup Typst + uses: typst-community/setup-typst@v3 + + - name: Compile Site + run: deno task build + + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./_site diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bd94159 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +_site +_cache +.DS_Store +.idea diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3c2e53b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "deno.enable": true +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..5ed6cd4 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# WüSpace VOS (Vereinsordnungssystem) + +## § 1 Beschreibung + +(1) Das Vereinsordnungssystem (VOS) dient als Publikationsplattform für Vereinsordnungen (inkl. der Satzung), welche mit delegis / Typst erstellt wurden. Das VOS ist ein Projekt des Vereins WüSpace e. V. und wird von diesem betrieben. + +(2) $^1$ Das VOS agiert als Static Site Generator (SSG) und generiert aus den Typst-Dateien eine statische Website. $^2$ Die Website wird auf einem Webserver gehostet und ist unter der Domain [vos.wuespace.de](https://vos.wuespace.de) erreichbar. + +## § 2 Bearbeitung + +(1) $^1$ Die Bearbeitung der Vereinsordnungen erfolgt in den Typst-Dateien im Ordner `vos`. $^2$ VOS extrahiert automatisch die delegis-Metadaten und generiert daraus die Website. $^3$ Die Website wird bei jedem Push auf den `main`-Branch automatisch neu generiert und auf dem Webserver aktualisiert. + +(2) Das VOS wird vom Vorstand gepflegt. diff --git a/_components/Aside.tsx b/_components/Aside.tsx new file mode 100644 index 0000000..645bf3e --- /dev/null +++ b/_components/Aside.tsx @@ -0,0 +1,63 @@ +import { clsx } from "@nick/clsx"; +import { MetadataSchema } from "../lib/metadata.ts"; + +export interface AsideProps { + data: Lume.Data; + hide?: boolean; +} + +export function Aside({ data, hide }: AsideProps) { + const liStyle = (targetUrl: string) => + clsx( + "block p-3 hover:bg-gray-100", + data.url === targetUrl && "bg-gray-200", + ); + + return ( + + ); +} + +const asideClass = (hide: boolean) => clsx( + "h-full overflow-y-auto md:max-w-64", + hide && "hidden md:block", +); + +const comparator = ([urlA]: [string, unknown], [urlB]: [string, unknown]) => { + return urlA.localeCompare(urlB); +}; diff --git a/_components/Preview.tsx b/_components/Preview.tsx new file mode 100644 index 0000000..631c3da --- /dev/null +++ b/_components/Preview.tsx @@ -0,0 +1,9 @@ +export interface PreviewProps { + src: string; +} + +export function Preview({src}: PreviewProps) { + return + + ; +} \ No newline at end of file diff --git a/_config.ts b/_config.ts new file mode 100644 index 0000000..8d84b88 --- /dev/null +++ b/_config.ts @@ -0,0 +1,21 @@ +import lume from "lume/mod.ts"; +import jsx from "lume/plugins/jsx.ts"; +import tailwindcss from "lume/plugins/tailwindcss.ts"; +import postcss from "lume/plugins/postcss.ts"; +import { typstDelegis } from "./lib/typst-delegis.ts"; +import { checkPrerequisities } from "./lib/check-prereqs.ts"; +import tailwindConfig from "./tailwind.config.ts"; + +await checkPrerequisities(); + +export const site = lume({}); + +site.use(jsx()); +site.use( + tailwindcss(tailwindConfig), +); +site.use(postcss()); +site.use(typstDelegis()); +site.copy("assets"); + +export default site; diff --git a/_includes/index.tsx b/_includes/index.tsx new file mode 100644 index 0000000..e1d2d96 --- /dev/null +++ b/_includes/index.tsx @@ -0,0 +1,11 @@ +export default function({content, title}: Lume.Data, helpers: Lume.Helpers) { + return + + {title} + + + + {content} + + +} \ No newline at end of file diff --git a/_includes/vo.tsx b/_includes/vo.tsx new file mode 100644 index 0000000..7c0c915 --- /dev/null +++ b/_includes/vo.tsx @@ -0,0 +1,14 @@ +import { Aside } from "../_components/Aside.tsx"; +import { Preview } from "../_components/Preview.tsx"; + +export const layout = "index.tsx"; +export default function (data: Lume.Data, helpers: Lume.Helpers) { + return ( + <> +