robin/maivi

a tiny cute lua web framework

git clone https://git.robinwobin.dev/robin/maivi

robindocs: meow1be4c9c

push-srxvuswpkqxx
3.3 KiB108 linesraw
1local function headcomment()
2  return h.comment([[
3Copyright 2026 robinwobin
4Licensed under EUPL-1.2; you may not use this file except in compliance with the License.
5    You may obtain a copy of the License at
6    https://codeberg.org/comfysage/maivi/src/branch/main/LICENSE
7
8Source is available at https://codeberg.org/comfysage/maivi/src/branch/main/docs
9]])
10end
11
12return function(_)
13  return h({
14    headcomment(),
15    h.document({
16      h.head({
17        h.meta({ charset = "utf-8" }),
18        h.meta({
19          name = "viewport",
20          content = "width=device-width, initial-scale=1",
21        }),
22        h.meta({ name = "color-scheme", content = "dark" }),
23        h.meta({ name = "darkreader-lock" }),
24
25        h.title("maivi :3"),
26        h.meta({ name = "author", content = "robinwobin" }),
27        h.meta({
28          name = "description",
29          content = "a tiny cute lua web framework",
30        }),
31        h.link({ rel = "canonical", href = this.base_url }),
32
33        h.meta({ property = "og:title", content = "maivi :3" }),
34        h.meta({ property = "og:url", content = this.base_url }),
35        h.meta({ property = "og:site_name", content = "maivi docs" }),
36        h.meta({
37          property = "og:description",
38          content = "a tiny cute lua web framework",
39        }),
40        h.meta({ property = "og:type", content = "website" }),
41
42        h.meta({ name = "theme-color", content = "#febdd4" }),
43
44        h.link({ rel = "icon", href = "/favicon.svg" }),
45        h.link({
46          rel = "mask-icon",
47          href = "/favicon.svg",
48          color = "#febdd4",
49        }),
50
51        h.style(
52          ---@language css
53          [[ @layer reset, theme, base, layout, components, partials, page, media; ]]
54        ),
55        -- reset
56        h.stylesheet({ href = "/styles/reset.css" }),
57        h.stylesheet({ href = "/styles/media.css" }),
58        h.stylesheet({ href = "/styles/fonts.css" }),
59        h.stylesheet({ href = "/styles/base.css" }),
60        h.stylesheet({ href = "/styles/colors.css" }),
61        h.stylesheet({ href = "/styles/text.css" }),
62        h.stylesheet({ href = "/styles/style.css" }),
63        h.stylesheet({ href = "/styles/syntax.css" }),
64
65        h.script({
66          defer = "",
67          type = "module",
68          src = "https://cdn.jsdelivr.net/npm/microlighter@2.2.0/dist/microlighter.min.js",
69        }),
70      }),
71      h.body({
72        h.div({
73          id = "root-bg",
74          h.div({
75            id = "root-bg-noise",
76            h.svg({
77              width = "0",
78              height = "0",
79              h.filter({
80                id = "noise",
81                maivi.elem("feTurbulence", { empty = true })({
82                  type = "fractalNoise",
83                  baseFrequency = ".66",
84                  numOctaves = "3",
85                  stitchTiles = "stitch",
86                  result = "noise",
87                }),
88                maivi.elem("feBlend", { empty = true })({
89                  ["in"] = "SourceGraphic",
90                  in2 = "noise",
91                  mode = "multiply",
92                }),
93              }),
94            }),
95          }),
96        }),
97        h.div({
98          id = "root",
99          h.div({
100            id = "page",
101            maivi.mod("sidebar"),
102            maivi.mod("content"),
103          }),
104        }),
105      }),
106    }),
107  })
108end