mirror of
https://github.com/Theodor-Springmann-Stiftung/lenz-web.git
synced 2026-03-21 05:45:32 +00:00
Better inital
This commit is contained in:
2
templates/.gitignore
vendored
Normal file
2
templates/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
node_modules/
|
||||
public/*.map
|
||||
1
templates/components/placeholder.tmpl
Normal file
1
templates/components/placeholder.tmpl
Normal file
@@ -0,0 +1 @@
|
||||
{{/* placeholder */}}
|
||||
22
templates/embed.go
Normal file
22
templates/embed.go
Normal file
@@ -0,0 +1,22 @@
|
||||
//go:build !dev
|
||||
|
||||
package templates
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
)
|
||||
|
||||
// FS contains all template files.
|
||||
//
|
||||
//go:embed layouts pages components
|
||||
var rawFS embed.FS
|
||||
|
||||
var FS fs.FS = rawFS
|
||||
|
||||
// PublicFS contains static assets (js, css, images, ...).
|
||||
//
|
||||
//go:embed public
|
||||
var rawPublicFS embed.FS
|
||||
|
||||
var PublicFS fs.FS = rawPublicFS
|
||||
29
templates/embed_dev.go
Normal file
29
templates/embed_dev.go
Normal file
@@ -0,0 +1,29 @@
|
||||
//go:build dev
|
||||
|
||||
package templates
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
FS fs.FS
|
||||
PublicFS fs.FS
|
||||
)
|
||||
|
||||
// INFO: We use the currrent embeds file path to create the FS.
|
||||
// This is used in builds tagged with dev only, to serve files from the FS.
|
||||
func init() {
|
||||
_, file, _, ok := runtime.Caller(0)
|
||||
if !ok {
|
||||
log.Fatal("cannot resolve templates path from runtime.Caller")
|
||||
}
|
||||
|
||||
base := filepath.Dir(file)
|
||||
FS = os.DirFS(base)
|
||||
PublicFS = os.DirFS(base)
|
||||
}
|
||||
13
templates/layouts/layout.gohtml
Normal file
13
templates/layouts/layout.gohtml
Normal file
@@ -0,0 +1,13 @@
|
||||
{{ define "layout" }}
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{ block "title" . }}Default{{ end }}</title>
|
||||
</head>
|
||||
<body>
|
||||
{{ block "body" . }}{{ end }}
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
||||
1
templates/layouts/placeholder.tmpl
Normal file
1
templates/layouts/placeholder.tmpl
Normal file
@@ -0,0 +1 @@
|
||||
{{/* placeholder */}}
|
||||
1453
templates/package-lock.json
generated
Normal file
1453
templates/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
22
templates/package.json
Normal file
22
templates/package.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "lenz-templates",
|
||||
"version": "1.0.0",
|
||||
"description": "Templates for the JMR Lenz briefausgabe",
|
||||
"license": "MIT",
|
||||
"author": "",
|
||||
"type": "commonjs",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"bundle": "npm run js_prod && npm run css_prod",
|
||||
"js_prod": "esbuild ./src/index.js --bundle --minify --outfile=./public/index.js",
|
||||
"js": "esbuild ./src/index.js --bundle --sourcemap --outfile=./public/index.js",
|
||||
"css_prod": "tailwindcss -i ./src/style.css -o ./public/style.css --minify",
|
||||
"css": "tailwindcss -i ./src/style.css -o ./public/style.css",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tailwindcss/cli": "^4.1.18",
|
||||
"esbuild": "^0.27.3",
|
||||
"tailwindcss": "^4.1.18"
|
||||
}
|
||||
}
|
||||
8
templates/pages/home.gohtml
Normal file
8
templates/pages/home.gohtml
Normal file
@@ -0,0 +1,8 @@
|
||||
{{ define "home" }}{{ template "layout" . }}{{ end }}
|
||||
|
||||
{{ define "title" }}Home{{ end }}
|
||||
|
||||
{{ define "body" }}
|
||||
<h1>Home</h1>
|
||||
<p>{{ .Message }}</p>
|
||||
{{ end }}
|
||||
1
templates/pages/placeholder.tmpl
Normal file
1
templates/pages/placeholder.tmpl
Normal file
@@ -0,0 +1 @@
|
||||
{{/* placeholder */}}
|
||||
1
templates/public/index.js
Normal file
1
templates/public/index.js
Normal file
@@ -0,0 +1 @@
|
||||
(()=>{var c=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports);var d=c(()=>{});d();})();
|
||||
13
templates/public/main.js
Normal file
13
templates/public/main.js
Normal file
@@ -0,0 +1,13 @@
|
||||
(() => {
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
|
||||
// src/main.js
|
||||
var require_main = __commonJS({
|
||||
"src/main.js"() {
|
||||
}
|
||||
});
|
||||
require_main();
|
||||
})();
|
||||
2
templates/public/style.css
Normal file
2
templates/public/style.css
Normal file
@@ -0,0 +1,2 @@
|
||||
/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
|
||||
@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,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;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,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;-webkit-text-decoration: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{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}: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)){::placeholder{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{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-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]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.static{position:static}}
|
||||
0
templates/src/index.js
Normal file
0
templates/src/index.js
Normal file
1
templates/src/style.css
Normal file
1
templates/src/style.css
Normal file
@@ -0,0 +1 @@
|
||||
@import "tailwindcss";
|
||||
Reference in New Issue
Block a user