diff options
| author | Kyren223 <contact@kyren.codes> | 2026-10-06 20:46:31 +0300 |
|---|---|---|
| committer | Kyren223 <contact@kyren.codes> | 2026-10-06 20:46:31 +0300 |
| commit | ba1be9573ef20d6424ae987257a1c727c47d4b53 (patch) | |
| tree | e59ef56f19142215070d0516a9b3a110d15557b6 | |
| parent | ea056b6e080669ba4b6f16c2757b4e2e88ea0553 (diff) | |
Initial setup for website rewrite
| -rw-r--r-- | go.mod | 5 | ||||
| -rw-r--r-- | go.sum | 2 | ||||
| -rw-r--r-- | old_stuff/astro.config.mjs (renamed from astro.config.mjs) | 0 | ||||
| -rw-r--r-- | old_stuff/package.json (renamed from package.json) | 0 | ||||
| -rw-r--r-- | old_stuff/pnpm-lock.yaml (renamed from pnpm-lock.yaml) | 0 | ||||
| -rw-r--r-- | old_stuff/src/components/BlogItem.astro (renamed from src/components/BlogItem.astro) | 0 | ||||
| -rw-r--r-- | old_stuff/src/components/Head.astro (renamed from src/components/Head.astro) | 0 | ||||
| -rw-r--r-- | old_stuff/src/components/Link.astro (renamed from src/components/Link.astro) | 0 | ||||
| -rw-r--r-- | old_stuff/src/components/Markdown.astro (renamed from src/components/Markdown.astro) | 0 | ||||
| -rw-r--r-- | old_stuff/src/components/Nav.astro (renamed from src/components/Nav.astro) | 0 | ||||
| -rw-r--r-- | old_stuff/src/components/Project.astro (renamed from src/components/Project.astro) | 0 | ||||
| -rw-r--r-- | old_stuff/src/components/RadarChart.astro (renamed from src/components/RadarChart.astro) | 0 | ||||
| -rw-r--r-- | old_stuff/src/components/TerminalBorder.astro (renamed from src/components/TerminalBorder.astro) | 0 | ||||
| -rw-r--r-- | old_stuff/src/content/blogs/_degoogle-your-life.mdx (renamed from src/content/blogs/_degoogle-your-life.mdx) | 0 | ||||
| -rw-r--r-- | old_stuff/src/content/blogs/_my-webdev-experience.md (renamed from src/content/blogs/_my-webdev-experience.md) | 0 | ||||
| -rw-r--r-- | old_stuff/src/content/blogs/_test.md (renamed from src/content/blogs/_test.md) | 0 | ||||
| -rw-r--r-- | old_stuff/src/content/blogs/discord-sucks-so-i-made-my-own.mdx (renamed from src/content/blogs/discord-sucks-so-i-made-my-own.mdx) | 0 | ||||
| -rw-r--r-- | old_stuff/src/content/blogs/how-computer-memory-actually-works.md (renamed from src/content/blogs/how-computer-memory-actually-works.md) | 0 | ||||
| -rw-r--r-- | old_stuff/src/content/blogs/hytale-modding-my-honest-concerns.md (renamed from src/content/blogs/hytale-modding-my-honest-concerns.md) | 0 | ||||
| -rw-r--r-- | old_stuff/src/content/blogs/making-a-game-in-3-days.mdx (renamed from src/content/blogs/making-a-game-in-3-days.mdx) | 0 | ||||
| -rw-r--r-- | old_stuff/src/content/blogs/nixos-the-perfect-distro-for-a-production-server.mdx (renamed from src/content/blogs/nixos-the-perfect-distro-for-a-production-server.mdx) | 0 | ||||
| -rw-r--r-- | old_stuff/src/content/blogs/rust-is-great.md (renamed from src/content/blogs/rust-is-great.md) | 0 | ||||
| -rw-r--r-- | old_stuff/src/content/blogs/the-search-for-the-perfect-ssh-key.mdx (renamed from src/content/blogs/the-search-for-the-perfect-ssh-key.mdx) | 0 | ||||
| -rw-r--r-- | old_stuff/src/content/config.ts (renamed from src/content/config.ts) | 0 | ||||
| -rw-r--r-- | old_stuff/src/env.d.ts (renamed from src/env.d.ts) | 0 | ||||
| -rw-r--r-- | old_stuff/src/layouts/Blog.astro (renamed from src/layouts/Blog.astro) | 0 | ||||
| -rw-r--r-- | old_stuff/src/layouts/Terminal.astro (renamed from src/layouts/Terminal.astro) | 0 | ||||
| -rw-r--r-- | old_stuff/src/pages/404.astro (renamed from src/pages/404.astro) | 0 | ||||
| -rw-r--r-- | old_stuff/src/pages/blogs.astro (renamed from src/pages/blogs.astro) | 0 | ||||
| -rw-r--r-- | old_stuff/src/pages/blogs/[...slug].astro (renamed from src/pages/blogs/[...slug].astro) | 0 | ||||
| -rw-r--r-- | old_stuff/src/pages/index.astro (renamed from src/pages/index.astro) | 0 | ||||
| -rw-r--r-- | old_stuff/src/pages/projects.astro (renamed from src/pages/projects.astro) | 0 | ||||
| -rw-r--r-- | old_stuff/src/pages/shell.astro (renamed from src/pages/shell.astro) | 0 | ||||
| -rw-r--r-- | old_stuff/src/pages/skills.astro (renamed from src/pages/skills.astro) | 0 | ||||
| -rw-r--r-- | old_stuff/src/styles/fonts/JetBrainsMono.css (renamed from src/styles/fonts/JetBrainsMono.css) | 0 | ||||
| -rw-r--r-- | old_stuff/src/styles/fonts/Monocraft.css (renamed from src/styles/fonts/Monocraft.css) | 0 | ||||
| -rw-r--r-- | old_stuff/src/styles/markdown/asides.css (renamed from src/styles/markdown/asides.css) | 0 | ||||
| -rw-r--r-- | old_stuff/src/styles/markdown/markdown.css (renamed from src/styles/markdown/markdown.css) | 0 | ||||
| -rw-r--r-- | old_stuff/src/styles/markdown/props.css (renamed from src/styles/markdown/props.css) | 0 | ||||
| -rw-r--r-- | old_stuff/src/styles/markdown/reset.css (renamed from src/styles/markdown/reset.css) | 0 | ||||
| -rw-r--r-- | old_stuff/src/styles/markdown/shiki.css (renamed from src/styles/markdown/shiki.css) | 0 | ||||
| -rw-r--r-- | old_stuff/src/styles/markdown/util.css (renamed from src/styles/markdown/util.css) | 0 | ||||
| -rw-r--r-- | old_stuff/src/styles/terminal.css (renamed from src/styles/terminal.css) | 0 | ||||
| -rw-r--r-- | old_stuff/tailwind.config.mjs (renamed from tailwind.config.mjs) | 0 | ||||
| -rw-r--r-- | old_stuff/tsconfig.json (renamed from tsconfig.json) | 0 | ||||
| -rw-r--r-- | public/main.css | 5 | ||||
| -rw-r--r-- | public/style.css | 732 | ||||
| -rw-r--r-- | website.go | 37 | ||||
| -rw-r--r-- | website.templ | 81 | ||||
| -rw-r--r-- | website_templ.go | 280 |
50 files changed, 1142 insertions, 0 deletions
@@ -0,0 +1,5 @@ +module website + +go 1.26.8 + +require github.com/a-h/templ v0.3.1070 // indirect @@ -0,0 +1,2 @@ +github.com/a-h/templ v0.3.1070 h1:3iCOXHXqFXa99OQzgkUOLJbNzv/QjFGLwKZkBAg+ADA= +github.com/a-h/templ v0.3.1070/go.mod h1:iIqB3g2RHBe/WlnPwa+Bvhh1TKXHWLRnBD9NWHOLm78= diff --git a/astro.config.mjs b/old_stuff/astro.config.mjs index e437788..e437788 100644 --- a/astro.config.mjs +++ b/old_stuff/astro.config.mjs diff --git a/package.json b/old_stuff/package.json index 2817ff5..2817ff5 100644 --- a/package.json +++ b/old_stuff/package.json diff --git a/pnpm-lock.yaml b/old_stuff/pnpm-lock.yaml index f97061c..f97061c 100644 --- a/pnpm-lock.yaml +++ b/old_stuff/pnpm-lock.yaml diff --git a/src/components/BlogItem.astro b/old_stuff/src/components/BlogItem.astro index 8440d85..8440d85 100644 --- a/src/components/BlogItem.astro +++ b/old_stuff/src/components/BlogItem.astro diff --git a/src/components/Head.astro b/old_stuff/src/components/Head.astro index a1a6e35..a1a6e35 100644 --- a/src/components/Head.astro +++ b/old_stuff/src/components/Head.astro diff --git a/src/components/Link.astro b/old_stuff/src/components/Link.astro index e8396ec..e8396ec 100644 --- a/src/components/Link.astro +++ b/old_stuff/src/components/Link.astro diff --git a/src/components/Markdown.astro b/old_stuff/src/components/Markdown.astro index 104b57e..104b57e 100644 --- a/src/components/Markdown.astro +++ b/old_stuff/src/components/Markdown.astro diff --git a/src/components/Nav.astro b/old_stuff/src/components/Nav.astro index da08b32..da08b32 100644 --- a/src/components/Nav.astro +++ b/old_stuff/src/components/Nav.astro diff --git a/src/components/Project.astro b/old_stuff/src/components/Project.astro index 0b15a68..0b15a68 100644 --- a/src/components/Project.astro +++ b/old_stuff/src/components/Project.astro diff --git a/src/components/RadarChart.astro b/old_stuff/src/components/RadarChart.astro index 0a3d434..0a3d434 100644 --- a/src/components/RadarChart.astro +++ b/old_stuff/src/components/RadarChart.astro diff --git a/src/components/TerminalBorder.astro b/old_stuff/src/components/TerminalBorder.astro index 4e8bfb3..4e8bfb3 100644 --- a/src/components/TerminalBorder.astro +++ b/old_stuff/src/components/TerminalBorder.astro diff --git a/src/content/blogs/_degoogle-your-life.mdx b/old_stuff/src/content/blogs/_degoogle-your-life.mdx index d6fa8e1..d6fa8e1 100644 --- a/src/content/blogs/_degoogle-your-life.mdx +++ b/old_stuff/src/content/blogs/_degoogle-your-life.mdx diff --git a/src/content/blogs/_my-webdev-experience.md b/old_stuff/src/content/blogs/_my-webdev-experience.md index 6949572..6949572 100644 --- a/src/content/blogs/_my-webdev-experience.md +++ b/old_stuff/src/content/blogs/_my-webdev-experience.md diff --git a/src/content/blogs/_test.md b/old_stuff/src/content/blogs/_test.md index 344a479..344a479 100644 --- a/src/content/blogs/_test.md +++ b/old_stuff/src/content/blogs/_test.md diff --git a/src/content/blogs/discord-sucks-so-i-made-my-own.mdx b/old_stuff/src/content/blogs/discord-sucks-so-i-made-my-own.mdx index bfd4057..bfd4057 100644 --- a/src/content/blogs/discord-sucks-so-i-made-my-own.mdx +++ b/old_stuff/src/content/blogs/discord-sucks-so-i-made-my-own.mdx diff --git a/src/content/blogs/how-computer-memory-actually-works.md b/old_stuff/src/content/blogs/how-computer-memory-actually-works.md index 42a4acc..42a4acc 100644 --- a/src/content/blogs/how-computer-memory-actually-works.md +++ b/old_stuff/src/content/blogs/how-computer-memory-actually-works.md diff --git a/src/content/blogs/hytale-modding-my-honest-concerns.md b/old_stuff/src/content/blogs/hytale-modding-my-honest-concerns.md index 2ae3fd2..2ae3fd2 100644 --- a/src/content/blogs/hytale-modding-my-honest-concerns.md +++ b/old_stuff/src/content/blogs/hytale-modding-my-honest-concerns.md diff --git a/src/content/blogs/making-a-game-in-3-days.mdx b/old_stuff/src/content/blogs/making-a-game-in-3-days.mdx index 47b0949..47b0949 100644 --- a/src/content/blogs/making-a-game-in-3-days.mdx +++ b/old_stuff/src/content/blogs/making-a-game-in-3-days.mdx diff --git a/src/content/blogs/nixos-the-perfect-distro-for-a-production-server.mdx b/old_stuff/src/content/blogs/nixos-the-perfect-distro-for-a-production-server.mdx index 7b8c235..7b8c235 100644 --- a/src/content/blogs/nixos-the-perfect-distro-for-a-production-server.mdx +++ b/old_stuff/src/content/blogs/nixos-the-perfect-distro-for-a-production-server.mdx diff --git a/src/content/blogs/rust-is-great.md b/old_stuff/src/content/blogs/rust-is-great.md index 6916867..6916867 100644 --- a/src/content/blogs/rust-is-great.md +++ b/old_stuff/src/content/blogs/rust-is-great.md diff --git a/src/content/blogs/the-search-for-the-perfect-ssh-key.mdx b/old_stuff/src/content/blogs/the-search-for-the-perfect-ssh-key.mdx index 09cc13c..09cc13c 100644 --- a/src/content/blogs/the-search-for-the-perfect-ssh-key.mdx +++ b/old_stuff/src/content/blogs/the-search-for-the-perfect-ssh-key.mdx diff --git a/src/content/config.ts b/old_stuff/src/content/config.ts index 17aeedb..17aeedb 100644 --- a/src/content/config.ts +++ b/old_stuff/src/content/config.ts diff --git a/src/env.d.ts b/old_stuff/src/env.d.ts index 9bc5cb4..9bc5cb4 100644 --- a/src/env.d.ts +++ b/old_stuff/src/env.d.ts diff --git a/src/layouts/Blog.astro b/old_stuff/src/layouts/Blog.astro index aa773c2..aa773c2 100644 --- a/src/layouts/Blog.astro +++ b/old_stuff/src/layouts/Blog.astro diff --git a/src/layouts/Terminal.astro b/old_stuff/src/layouts/Terminal.astro index e13a8ac..e13a8ac 100644 --- a/src/layouts/Terminal.astro +++ b/old_stuff/src/layouts/Terminal.astro diff --git a/src/pages/404.astro b/old_stuff/src/pages/404.astro index 9d3910e..9d3910e 100644 --- a/src/pages/404.astro +++ b/old_stuff/src/pages/404.astro diff --git a/src/pages/blogs.astro b/old_stuff/src/pages/blogs.astro index 7e1b576..7e1b576 100644 --- a/src/pages/blogs.astro +++ b/old_stuff/src/pages/blogs.astro diff --git a/src/pages/blogs/[...slug].astro b/old_stuff/src/pages/blogs/[...slug].astro index a7394ca..a7394ca 100644 --- a/src/pages/blogs/[...slug].astro +++ b/old_stuff/src/pages/blogs/[...slug].astro diff --git a/src/pages/index.astro b/old_stuff/src/pages/index.astro index e286117..e286117 100644 --- a/src/pages/index.astro +++ b/old_stuff/src/pages/index.astro diff --git a/src/pages/projects.astro b/old_stuff/src/pages/projects.astro index 9174b0e..9174b0e 100644 --- a/src/pages/projects.astro +++ b/old_stuff/src/pages/projects.astro diff --git a/src/pages/shell.astro b/old_stuff/src/pages/shell.astro index c1ae14e..c1ae14e 100644 --- a/src/pages/shell.astro +++ b/old_stuff/src/pages/shell.astro diff --git a/src/pages/skills.astro b/old_stuff/src/pages/skills.astro index 6d6f4b1..6d6f4b1 100644 --- a/src/pages/skills.astro +++ b/old_stuff/src/pages/skills.astro diff --git a/src/styles/fonts/JetBrainsMono.css b/old_stuff/src/styles/fonts/JetBrainsMono.css index 807fe1f..807fe1f 100644 --- a/src/styles/fonts/JetBrainsMono.css +++ b/old_stuff/src/styles/fonts/JetBrainsMono.css diff --git a/src/styles/fonts/Monocraft.css b/old_stuff/src/styles/fonts/Monocraft.css index 34fd24a..34fd24a 100644 --- a/src/styles/fonts/Monocraft.css +++ b/old_stuff/src/styles/fonts/Monocraft.css diff --git a/src/styles/markdown/asides.css b/old_stuff/src/styles/markdown/asides.css index 86aff8d..86aff8d 100644 --- a/src/styles/markdown/asides.css +++ b/old_stuff/src/styles/markdown/asides.css diff --git a/src/styles/markdown/markdown.css b/old_stuff/src/styles/markdown/markdown.css index eccbf7d..eccbf7d 100644 --- a/src/styles/markdown/markdown.css +++ b/old_stuff/src/styles/markdown/markdown.css diff --git a/src/styles/markdown/props.css b/old_stuff/src/styles/markdown/props.css index 58a09f6..58a09f6 100644 --- a/src/styles/markdown/props.css +++ b/old_stuff/src/styles/markdown/props.css diff --git a/src/styles/markdown/reset.css b/old_stuff/src/styles/markdown/reset.css index 42be0c5..42be0c5 100644 --- a/src/styles/markdown/reset.css +++ b/old_stuff/src/styles/markdown/reset.css diff --git a/src/styles/markdown/shiki.css b/old_stuff/src/styles/markdown/shiki.css index 704eea8..704eea8 100644 --- a/src/styles/markdown/shiki.css +++ b/old_stuff/src/styles/markdown/shiki.css diff --git a/src/styles/markdown/util.css b/old_stuff/src/styles/markdown/util.css index 63ede50..63ede50 100644 --- a/src/styles/markdown/util.css +++ b/old_stuff/src/styles/markdown/util.css diff --git a/src/styles/terminal.css b/old_stuff/src/styles/terminal.css index 58da91d..58da91d 100644 --- a/src/styles/terminal.css +++ b/old_stuff/src/styles/terminal.css diff --git a/tailwind.config.mjs b/old_stuff/tailwind.config.mjs index 94db283..94db283 100644 --- a/tailwind.config.mjs +++ b/old_stuff/tailwind.config.mjs diff --git a/tsconfig.json b/old_stuff/tsconfig.json index 36f8465..36f8465 100644 --- a/tsconfig.json +++ b/old_stuff/tsconfig.json diff --git a/public/main.css b/public/main.css new file mode 100644 index 0000000..8457bc5 --- /dev/null +++ b/public/main.css @@ -0,0 +1,5 @@ +@import "tailwindcss"; + +@source "../**/*.go"; +@source "../**/*.templ"; +@source ".."; diff --git a/public/style.css b/public/style.css new file mode 100644 index 0000000..5369786 --- /dev/null +++ b/public/style.css @@ -0,0 +1,732 @@ +/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */ +@layer properties; +@layer theme, base, components, utilities; +@layer theme { + :root, :host { + --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial, + sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; + --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', + monospace; + --color-fuchsia-600: oklch(59.1% 0.293 322.896); + --color-gray-700: oklch(37.3% 0.034 259.733); + --spacing: 0.25rem; + --text-3xl: 1.875rem; + --text-3xl--line-height: calc(2.25 / 1.875); + --font-weight-bold: 700; + --default-font-family: var(--font-sans); + --default-mono-font-family: var(--font-mono); + } +} +@layer base { + *, ::after, ::before, ::backdrop, ::file-selector-button { + box-sizing: border-box; + margin: 0; + padding: 0; + border: 0 solid; + } + html, :host { + line-height: 1.5; + -webkit-text-size-adjust: 100%; + tab-size: 4; + font-family: var(--default-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'); + font-feature-settings: var(--default-font-feature-settings, normal); + font-variation-settings: var(--default-font-variation-settings, normal); + -webkit-tap-highlight-color: transparent; + } + hr { + height: 0; + color: inherit; + border-top-width: 1px; + } + abbr:where([title]) { + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; + } + h1, h2, h3, h4, h5, h6 { + font-size: inherit; + font-weight: inherit; + } + a { + color: inherit; + -webkit-text-decoration: inherit; + text-decoration: inherit; + } + b, strong { + font-weight: bolder; + } + code, kbd, samp, pre { + font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace); + font-feature-settings: var(--default-mono-font-feature-settings, normal); + font-variation-settings: var(--default-mono-font-variation-settings, normal); + font-size: 1em; + } + small { + font-size: 80%; + } + sub, sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; + } + sub { + bottom: -0.25em; + } + sup { + top: -0.5em; + } + table { + text-indent: 0; + border-color: inherit; + border-collapse: collapse; + } + :-moz-focusring:where(:not(iframe)) { + outline: auto; + } + progress { + vertical-align: baseline; + } + summary { + display: list-item; + } + ol, ul, menu { + list-style: none; + } + img, svg, video, canvas, audio, iframe, embed, object { + display: block; + vertical-align: middle; + } + img, video { + max-width: 100%; + height: auto; + } + button, input, select, optgroup, textarea, ::file-selector-button { + font: inherit; + font-feature-settings: inherit; + font-variation-settings: inherit; + letter-spacing: inherit; + color: inherit; + border-radius: 0; + background-color: transparent; + opacity: 1; + } + :where(select:is([multiple], [size])) optgroup { + font-weight: bolder; + } + :where(select:is([multiple], [size])) optgroup option { + padding-inline-start: 20px; + } + ::file-selector-button { + margin-inline-end: 4px; + } + ::placeholder { + opacity: 1; + } + @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) { + ::placeholder { + color: currentcolor; + @supports (color: color-mix(in lab, red, red)) { + color: color-mix(in oklab, currentcolor 50%, transparent); + } + } + } + textarea { + resize: vertical; + } + ::-webkit-search-decoration { + -webkit-appearance: none; + } + ::-webkit-date-and-time-value { + min-height: 1lh; + text-align: inherit; + } + ::-webkit-datetime-edit { + display: inline-flex; + } + ::-webkit-datetime-edit-fields-wrapper { + padding: 0; + } + ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field { + padding-block: 0; + } + ::-webkit-calendar-picker-indicator { + line-height: 1; + } + :-moz-ui-invalid { + box-shadow: none; + } + button, input:where([type='button'], [type='reset'], [type='submit']), ::file-selector-button { + appearance: button; + } + ::-webkit-inner-spin-button, ::-webkit-outer-spin-button { + height: auto; + } + [hidden]:where(:not([hidden='until-found'])) { + display: none !important; + } +} +@layer utilities { + .invisible { + visibility: hidden; + } + .visible { + visibility: visible; + } + .absolute { + position: absolute; + } + .fixed { + position: fixed; + } + .static { + position: static; + } + .top-\[-0\.7em\] { + top: -0.7em; + } + .bottom-\[-0\.7em\] { + bottom: -0.7em; + } + .left-\[0\.5em\] { + left: 0.5em; + } + .m-0 { + margin: 0px; + } + .m-\[-0\.1vw\] { + margin: -0.1vw; + } + .m-auto { + margin: auto; + } + .mx-\[0\.2vw\] { + margin-inline: 0.2vw; + } + .mx-\[1vw\] { + margin-inline: 1vw; + } + .my-\[0\.625vw\] { + margin-block: 0.625vw; + } + .my-\[2\.5vw\] { + margin-block: 2.5vw; + } + .my-\[3vw\] { + margin-block: 3vw; + } + .my-\[5vw\] { + margin-block: 5vw; + } + .mt-\[0\.625vw\] { + margin-top: 0.625vw; + } + .mt-\[1vw\] { + margin-top: 1vw; + } + .mt-\[8vw\] { + margin-top: 8vw; + } + .mt-\[10vw\] { + margin-top: 10vw; + } + .mr-\[0\.1vw\] { + margin-right: 0.1vw; + } + .mr-\[2\.5vh\] { + margin-right: 2.5vh; + } + .mb-0 { + margin-bottom: 0px; + } + .mb-\[1\.5625vw\] { + margin-bottom: 1.5625vw; + } + .mb-\[5vw\] { + margin-bottom: 5vw; + } + .mb-\[7vw\] { + margin-bottom: 7vw; + } + .ml-\[-4vw\] { + margin-left: -4vw; + } + .block { + display: block; + } + .flex { + display: flex; + } + .grid { + display: grid; + } + .hidden { + display: none; + } + .inline-block { + display: inline-block; + } + .table { + display: table; + } + .h-0 { + height: 0px; + } + .h-\[9\.5vw\] { + height: 9.5vw; + } + .h-\[62\%\] { + height: 62%; + } + .h-\[80svh\] { + height: 80svh; + } + .h-\[85svh\] { + height: 85svh; + } + .h-\[97vh\] { + height: 97vh; + } + .h-\[100\%\] { + height: 100%; + } + .h-full { + height: 100%; + } + .max-h-\[80svh\] { + max-height: 80svh; + } + .w-0 { + width: 0px; + } + .w-\[30\%\] { + width: 30%; + } + .w-\[67\%\] { + width: 67%; + } + .w-\[70\%\] { + width: 70%; + } + .w-\[95vw\] { + width: 95vw; + } + .w-\[100\%\] { + width: 100%; + } + .w-\[334\%\] { + width: 334%; + } + .w-full { + width: 100%; + } + .min-w-0 { + min-width: 0px; + } + .flex-1 { + flex: 1; + } + .transform { + transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,); + } + .cursor-pointer { + cursor: pointer; + } + .resize { + resize: both; + } + .grid-cols-2 { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + .grid-cols-3 { + grid-template-columns: repeat(3, minmax(0, 1fr)); + } + .grid-cols-5 { + grid-template-columns: repeat(5, minmax(0, 1fr)); + } + .flex-col { + flex-direction: column; + } + .items-center { + align-items: center; + } + .justify-between { + justify-content: space-between; + } + .gap-16 { + gap: calc(var(--spacing) * 16); + } + .gap-\[1\.25vw\] { + gap: 1.25vw; + } + .gap-x-\[5vw\] { + column-gap: 5vw; + } + :where(.space-x-\[1\.25vw\] > :not(:last-child)) { + --tw-space-x-reverse: 0; + margin-inline-start: calc(1.25vw * var(--tw-space-x-reverse)); + margin-inline-end: calc(1.25vw * calc(1 - var(--tw-space-x-reverse))); + } + .truncate { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .overflow-auto { + overflow: auto; + } + .overflow-x-hidden { + overflow-x: hidden; + } + .overflow-y-auto { + overflow-y: auto; + } + .border { + border-style: var(--tw-border-style); + border-width: 1px; + } + .border-\[0\.1vw\] { + border-style: var(--tw-border-style); + border-width: 0.1vw; + } + .border-\[0\.25vh\] { + border-style: var(--tw-border-style); + border-width: 0.25vh; + } + .border-solid { + --tw-border-style: solid; + border-style: solid; + } + .border-\[var\(--alt\)\] { + border-color: var(--alt); + } + .fill-\[\#7ed4fb\]\/50 { + fill: color-mix(in oklab, #7ed4fb 50%, transparent); + } + .stroke-\[var\(--alt\)\] { + stroke: var(--alt); + } + .stroke-\[var\(--primary\)\] { + stroke: var(--primary); + } + .object-cover { + object-fit: cover; + } + .p-0 { + padding: 0px; + } + .p-\[0\.8em\] { + padding: 0.8em; + } + .p-\[2\.2svh\] { + padding: 2.2svh; + } + .p-\[3vw\] { + padding: 3vw; + } + .px-\[0\.1vw\] { + padding-inline: 0.1vw; + } + .px-\[0\.5em\] { + padding-inline: 0.5em; + } + .py-16 { + padding-block: calc(var(--spacing) * 16); + } + .py-\[0\.625vw\] { + padding-block: 0.625vw; + } + .pt-\[1\.0625em\] { + padding-top: 1.0625em; + } + .pt-\[1vw\] { + padding-top: 1vw; + } + .pt-\[5vw\] { + padding-top: 5vw; + } + .pr-\[1\.25vw\] { + padding-right: 1.25vw; + } + .text-left { + text-align: left; + } + .text-right { + text-align: right; + } + .font-\[\'JetBrains_Mono\'\] { + font-family: 'JetBrains Mono'; + } + .text-3xl { + font-size: var(--text-3xl); + line-height: var(--tw-leading, var(--text-3xl--line-height)); + } + .text-\[0\.96vw\] { + font-size: 0.96vw; + } + .text-\[2\.5vw\] { + font-size: 2.5vw; + } + .text-\[3\.5vw\] { + font-size: 3.5vw; + } + .text-\[3vw\] { + font-size: 3vw; + } + .text-\[5vw\] { + font-size: 5vw; + } + .text-\[60\%\] { + font-size: 60%; + } + .text-\[110\%\] { + font-size: 110%; + } + .text-\[130\%\] { + font-size: 130%; + } + .font-bold { + --tw-font-weight: var(--font-weight-bold); + font-weight: var(--font-weight-bold); + } + .text-\[var\(--accent\)\] { + color: var(--accent); + } + .text-\[var\(--secondary\)\] { + color: var(--secondary); + } + .underline { + text-decoration-line: underline; + } + .opacity-0 { + opacity: 0%; + } + @media (hover: hover) { + .group-hover\:text-\[var\(--alt\)\]:is(:where(.group):hover *) { + color: var(--alt); + } + .group-hover\:text-gray-700:is(:where(.group):hover *) { + color: var(--color-gray-700); + } + .group-hover\:underline:is(:where(.group):hover *) { + text-decoration-line: underline; + } + .hover\:text-\[var\(--alt\)\]:hover { + color: var(--alt); + } + .hover\:text-\[var\(--secondary\)\]:hover { + color: var(--secondary); + } + .hover\:text-gray-700:hover { + color: var(--color-gray-700); + } + } + @media (width >= 40rem) { + .sm\:invisible { + visibility: hidden; + } + .sm\:visible { + visibility: visible; + } + .sm\:top-\[-0\.75vw\] { + top: -0.75vw; + } + .sm\:bottom-\[-0\.75vw\] { + bottom: -0.75vw; + } + .sm\:left-\[0\.625vw\] { + left: 0.625vw; + } + .sm\:col-span-2 { + grid-column: span 2 / span 2; + } + .sm\:m-0 { + margin: 0px; + } + .sm\:my-\[0\.625vw\] { + margin-block: 0.625vw; + } + .sm\:my-\[2\.5vw\] { + margin-block: 2.5vw; + } + .sm\:my-\[2\.25vw\] { + margin-block: 2.25vw; + } + .sm\:mt-\[0\.625vw\] { + margin-top: 0.625vw; + } + .sm\:mt-\[0vw\] { + margin-top: 0vw; + } + .sm\:mr-0 { + margin-right: 0px; + } + .sm\:mr-\[2\.5vw\] { + margin-right: 2.5vw; + } + .sm\:mb-\[1\.5625vw\] { + margin-bottom: 1.5625vw; + } + .sm\:mb-\[2vw\] { + margin-bottom: 2vw; + } + .sm\:contents { + display: contents; + } + .sm\:flex { + display: flex; + } + .sm\:grid { + display: grid; + } + .sm\:h-0 { + height: 0px; + } + .sm\:h-\[30vw\] { + height: 30vw; + } + .sm\:h-\[35vw\] { + height: 35vw; + } + .sm\:h-\[38vw\] { + height: 38vw; + } + .sm\:h-full { + height: 100%; + } + .sm\:max-h-\[24vw\] { + max-height: 24vw; + } + .sm\:w-0 { + width: 0px; + } + .sm\:w-\[40\%\] { + width: 40%; + } + .sm\:w-\[60\%\] { + width: 60%; + } + .sm\:w-\[68\.75vw\] { + width: 68.75vw; + } + .sm\:w-full { + width: 100%; + } + .sm\:grid-cols-1 { + grid-template-columns: repeat(1, minmax(0, 1fr)); + } + .sm\:grid-cols-\[1fr_1fr_1fr\] { + grid-template-columns: 1fr 1fr 1fr; + } + .sm\:grid-cols-\[2fr_3fr\] { + grid-template-columns: 2fr 3fr; + } + .sm\:gap-\[1\.25vw\] { + gap: 1.25vw; + } + .sm\:gap-x-\[0\.625vw\] { + column-gap: 0.625vw; + } + .sm\:overflow-visible { + overflow: visible; + } + .sm\:border-\[0\.1vw\] { + border-style: var(--tw-border-style); + border-width: 0.1vw; + } + .sm\:border-\[0\.2vw\] { + border-style: var(--tw-border-style); + border-width: 0.2vw; + } + .sm\:border-\[0\.125vw\] { + border-style: var(--tw-border-style); + border-width: 0.125vw; + } + .sm\:border-solid { + --tw-border-style: solid; + border-style: solid; + } + .sm\:p-\[1vw\] { + padding: 1vw; + } + .sm\:p-\[2\.2vw\] { + padding: 2.2vw; + } + .sm\:px-\[0\.625vw\] { + padding-inline: 0.625vw; + } + .sm\:pt-0 { + padding-top: 0px; + } + .sm\:pt-\[1\.0625vw\] { + padding-top: 1.0625vw; + } + .sm\:pl-\[1\.25vw\] { + padding-left: 1.25vw; + } + .sm\:text-\[1\.125vw\] { + font-size: 1.125vw; + } + .sm\:text-\[1\.375vw\] { + font-size: 1.375vw; + } + .sm\:text-\[1vw\] { + font-size: 1vw; + } + .sm\:text-\[100\%\] { + font-size: 100%; + } + } + @media (width >= 48rem) { + .md\:grid-cols-1 { + grid-template-columns: repeat(1, minmax(0, 1fr)); + } + } +} +@property --tw-rotate-x { + syntax: "*"; + inherits: false; +} +@property --tw-rotate-y { + syntax: "*"; + inherits: false; +} +@property --tw-rotate-z { + syntax: "*"; + inherits: false; +} +@property --tw-skew-x { + syntax: "*"; + inherits: false; +} +@property --tw-skew-y { + syntax: "*"; + inherits: false; +} +@property --tw-space-x-reverse { + syntax: "*"; + inherits: false; + initial-value: 0; +} +@property --tw-border-style { + syntax: "*"; + inherits: false; + initial-value: solid; +} +@property --tw-font-weight { + syntax: "*"; + inherits: false; +} +@layer properties { + @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) { + *, ::before, ::after, ::backdrop { + --tw-rotate-x: initial; + --tw-rotate-y: initial; + --tw-rotate-z: initial; + --tw-skew-x: initial; + --tw-skew-y: initial; + --tw-space-x-reverse: 0; + --tw-border-style: solid; + --tw-font-weight: initial; + } + } +} diff --git a/website.go b/website.go new file mode 100644 index 0000000..d1cf44d --- /dev/null +++ b/website.go @@ -0,0 +1,37 @@ +package main + +import ( + "fmt" + "net/http" +) + +func main() { + fmt.Println("foo") + + mux := http.NewServeMux() + + fileServer := http.FileServer(http.Dir("./public")) + mux.Handle("GET /public/", http.StripPrefix("/public/", fileServer)) + + mux.HandleFunc("GET /{$}", func(w http.ResponseWriter, r *http.Request) { + HomePage().Render(r.Context(), w) + }) + + mux.HandleFunc("GET /about", func(w http.ResponseWriter, r *http.Request) { + AboutPage().Render(r.Context(), w) + }) + + mux.HandleFunc("GET /items", func(w http.ResponseWriter, r *http.Request) { + data := []Item{ + {Name: "Foo", Active: true}, + {Name: "Bar", Active: true}, + {Name: "Baz", Active: false}, + } + ItemsPage(data).Render(r.Context(), w) + }) + + fmt.Println("Server running at http://localhost:8080") + if err := http.ListenAndServe(":8080", mux); err != nil { + panic(err) + } +} diff --git a/website.templ b/website.templ new file mode 100644 index 0000000..a3f137a --- /dev/null +++ b/website.templ @@ -0,0 +1,81 @@ +package main + +import "fmt" + +// 1. Shared Base Layout Component +templ PageLayout(title string) { + <!DOCTYPE html> + <html lang="en"> + <head> + <meta charset="UTF-8"/> + <title>{ title }</title> + <style> + body { font-family: monospace; background: #0f172a; color: #f8fafc; padding: 2rem; line-height: 1.5; } + nav a { color: #38bdf8; margin-right: 1rem; text-decoration: none; } + nav a:hover { text-decoration: underline; } + .card { background: #1e293b; padding: 1rem; border-radius: 8px; margin-top: 1rem; border: 1px solid #334155; } + .badge-active { color: #4ade80; } + .badge-inactive { color: #f87171; } + </style> + <link rel="stylesheet" href="/public/style.css"/> + </head> + <body> + <nav> + <a href="/">/home</a> + <a href="/about">/about</a> + <a href="/items">/items</a> + </nav> + <hr style="border-color: #334155; margin: 1rem 0;"/> + { children... } + </body> + </html> +} + +// 2. Page 1: Home +templ HomePage() { + @PageLayout("Home") { + <h1>Home</h1> + <p>Go server running with Templ templates and Air hot-reloading.</p> + } +} + +// 3. Page 2: About +templ AboutPage() { + @PageLayout("About") { + <h1 class="text-3xl font-bold underline">About</h1> + <p>Single-binary web app using Go's standard library net/http.</p> + } +} + +// Data struct for dynamic rendering +type Item struct { + Name string + Active bool +} + +// 4. Page 3: Dynamic Data (Conditionals + Loops) +templ ItemsPage(items []Item) { + @PageLayout("Items") { + <h1>Items</h1> + <div class="card"> + if len(items) == 0 { + <p>No items in database.</p> + } else { + <ul> + for _, item := range items { + <li> + <span>{ item.Name }</span> + if item.Active { + <span class="badge-active"> [ACTIVE]</span> + } else { + <span class="badge-inactive"> [INACTIVE]</span> + } + </li> + } + </ul> + } + </div> + <p style="color: #94a3b8; font-size: 0.8rem; margin-top: 1rem;"> + { fmt.Sprintf("Total items processed: %d", len(items)) } + </p> + } diff --git a/website_templ.go b/website_templ.go new file mode 100644 index 0000000..9acf03c --- /dev/null +++ b/website_templ.go @@ -0,0 +1,280 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.1070 +package main + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "fmt" + +// 1. Shared Base Layout Component +func PageLayout(title string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<!doctype html><html lang=\"en\"><head><meta charset=\"UTF-8\"><title>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var2 string + templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `website.templ`, Line: 11, Col: 22} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</title><style>\n body { font-family: monospace; background: #0f172a; color: #f8fafc; padding: 2rem; line-height: 1.5; }\n nav a { color: #38bdf8; margin-right: 1rem; text-decoration: none; }\n nav a:hover { text-decoration: underline; }\n .card { background: #1e293b; padding: 1rem; border-radius: 8px; margin-top: 1rem; border: 1px solid #334155; }\n .badge-active { color: #4ade80; }\n .badge-inactive { color: #f87171; }\n </style><link rel=\"stylesheet\" href=\"/public/style.css\"></head><body><nav><a href=\"/\">/home</a> <a href=\"/about\">/about</a> <a href=\"/items\">/items</a></nav><hr style=\"border-color: #334155; margin: 1rem 0;\">") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</body></html>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +// 2. Page 1: Home +func HomePage() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "<h1>Home</h1><p>Go server running with Templ templates and Air hot-reloading.</p>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = PageLayout("Home").Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +// 3. Page 2: About +func AboutPage() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var6 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<h1 class=\"text-3xl font-bold underline\">About</h1><p>Single-binary web app using Go's standard library net/http.</p>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = PageLayout("About").Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +// Data struct for dynamic rendering +type Item struct { + Name string + Active bool +} + +// 4. Page 3: Dynamic Data (Conditionals + Loops) +func ItemsPage(items []Item) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var8 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "<h1>Items</h1><div class=\"card\">") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if len(items) == 0 { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "<p>No items in database.</p>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<ul>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, item := range items { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "<li><span>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var9 string + templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(item.Name) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `website.templ`, Line: 67, Col: 45} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "</span> ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if item.Active { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "<span class=\"badge-active\">[ACTIVE]</span>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "<span class=\"badge-inactive\">[INACTIVE]</span>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "</li>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "</ul>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "</div><p style=\"color: #94a3b8; font-size: 0.8rem; margin-top: 1rem;\">") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var10 string + templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("Total items processed: %d", len(items))) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `website.templ`, Line: 79, Col: 66} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "</p>") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = PageLayout("Items").Render(templ.WithChildren(ctx, templ_7745c5c3_Var8), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate |
