From: early Date: Sun, 28 Jul 2024 05:47:42 +0000 (-0600) Subject: Update readme, move examples to cmd/run-mast-examples X-Git-Url: https://git.earlybird.gay/?a=commitdiff_plain;h=9bef28bfe9c6e01222351acc7adf2c2f478672f7;p=today Update readme, move examples to cmd/run-mast-examples --- diff --git a/README.md b/README.md index 037b63f..085c5fb 100644 --- a/README.md +++ b/README.md @@ -1 +1,36 @@ -# Make a Site Today (Mast) Web Engine \ No newline at end of file +# Make a Site Today (Mast) Web Engine + +The Mast engine builds on Go's templating with reusable parts in the style of +the Web Components standard. It aims to be usable for anything from static HTML +websites to complex applications with a mix of server and client-side behavior. + +## Install + +```sh +go get git.earlybird.gay/mast-engine@latest +``` + +## Usage + +Currently, the `examples` folder contains a site going through concepts by +example. You can walk through these examples yourself by installing them as +an executable: + +```sh +go install git.earlybird.gay/mast-engine/cmd/run-mast-examples@latest +run-mast-examples +``` + +## License + +> This section is not legally binding, please read the license text for +> specifics! + +The Mast Web Engine is licensed under the LGPL (GNU Lesser General Public +License). This license affects how you can run, modify, and distribute +mast-engine. In short: + +- If you modify mast-engine, you have to publish your modifications under the + GPL or LGPL. +- If you use mast-engine without modifying it, you're in the clear. +- Building a website using mast-engine does not count as modifying mast-engine. diff --git a/about/main.go b/about/main.go deleted file mode 100644 index 8f712b7..0000000 --- a/about/main.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2024 early (LGPL) -package main - -import ( - "html/template" - "net/http" - - "git.earlybird.gay/mast-engine/page" - "git.earlybird.gay/mast-engine/part" - "git.earlybird.gay/mast-engine/render" -) - -func mkList(args ...string) template.HTML { - out := template.HTML("") - return out -} - -var testPage = page.New("test-page", "example-page.html", - page.Includes(testPart), - page.OnLoad(func(data render.Data) error { - data.Set("message", "hello from test-page!") - return nil - }), - page.Pretty(" "), -) -var testPart = part.New("test-part", "example-part.html", - part.Funcs(template.FuncMap{ - "mkList": mkList, - }), - part.OnLoad(func(data render.Data) error { - data.Set("message", "hello from test-part!") - return nil - }), -) - -func main() { - http.ListenAndServe("0.0.0.0:3000", testPage) -} diff --git a/cmd/run-mast-examples/ex01-pages/example.go b/cmd/run-mast-examples/ex01-pages/example.go new file mode 100644 index 0000000..1978a2e --- /dev/null +++ b/cmd/run-mast-examples/ex01-pages/example.go @@ -0,0 +1,9 @@ +// Copyright (C) 2024 early (LGPL) +package ex01 + +import ( + "git.earlybird.gay/mast-engine/cmd/run-mast-examples/parts" + "git.earlybird.gay/mast-engine/page" +) + +var Page = page.New("ex01", "page.html", page.Includes(parts.ExampleNav)) diff --git a/cmd/run-mast-examples/ex01-pages/page.html b/cmd/run-mast-examples/ex01-pages/page.html new file mode 100644 index 0000000..17ef3b1 --- /dev/null +++ b/cmd/run-mast-examples/ex01-pages/page.html @@ -0,0 +1,15 @@ + + +
+ Example 1 +
+ +

Basic Page

+

This is a static page. Hooray.

+ + + + Parts + + + \ No newline at end of file diff --git a/cmd/run-mast-examples/ex02-parts/example.go b/cmd/run-mast-examples/ex02-parts/example.go new file mode 100644 index 0000000..8226eff --- /dev/null +++ b/cmd/run-mast-examples/ex02-parts/example.go @@ -0,0 +1,13 @@ +// Copyright (C) 2024 early (LGPL) +package ex02 + +import ( + "git.earlybird.gay/mast-engine/cmd/run-mast-examples/parts" + "git.earlybird.gay/mast-engine/page" + "git.earlybird.gay/mast-engine/part" +) + +var section = part.New("my-section", "section.html") + +// Use *.Includes to include a part as a dependency. +var Page = page.New("ex02", "page.html", page.Includes(section, parts.ExampleNav)) diff --git a/cmd/run-mast-examples/ex02-parts/page.html b/cmd/run-mast-examples/ex02-parts/page.html new file mode 100644 index 0000000..830c64d --- /dev/null +++ b/cmd/run-mast-examples/ex02-parts/page.html @@ -0,0 +1,23 @@ + + +
+ Example 2 +
+ +

Page with Parts

+

This page uses "parts" to create sections on the page. Parts are + HTML blocks that you can re-use. +

+ + +

Section

+

This is inner HTML for a my-section "part". It replaces the slot tag + in the part. +

+
+ + + Pages + Slots + + \ No newline at end of file diff --git a/cmd/run-mast-examples/ex02-parts/section.html b/cmd/run-mast-examples/ex02-parts/section.html new file mode 100644 index 0000000..a4fb103 --- /dev/null +++ b/cmd/run-mast-examples/ex02-parts/section.html @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/cmd/run-mast-examples/ex03-slots/example.go b/cmd/run-mast-examples/ex03-slots/example.go new file mode 100644 index 0000000..687cdea --- /dev/null +++ b/cmd/run-mast-examples/ex03-slots/example.go @@ -0,0 +1,13 @@ +// Copyright (C) 2024 early (LGPL) +package ex03 + +import ( + "git.earlybird.gay/mast-engine/cmd/run-mast-examples/parts" + "git.earlybird.gay/mast-engine/page" + "git.earlybird.gay/mast-engine/part" +) + +var section = part.New("my-section", "section.html") + +// Use *.Includes to include a part as a dependency. +var Page = page.New("ex03", "page.html", page.Includes(section, parts.ExampleNav)) diff --git a/cmd/run-mast-examples/ex03-slots/page.html b/cmd/run-mast-examples/ex03-slots/page.html new file mode 100644 index 0000000..2ea74a3 --- /dev/null +++ b/cmd/run-mast-examples/ex03-slots/page.html @@ -0,0 +1,33 @@ + + +
+ Example 3 +
+ +

Page with Parts

+

This page uses "parts" to create sections on the page. Parts are + HTML blocks that you can re-use. +

+ + + +

Section with Named Slots

+

Use the slot tag to fill in named slots.

+

You can do this with multiple HTML elements!

+
+ + + +

Section with a Subsection

+

You can also include parts inside parts.

+ +

Subsection

+

This my-section is a subsection!

+
+
+ + + Parts + Go Templates + + \ No newline at end of file diff --git a/cmd/run-mast-examples/ex03-slots/section.html b/cmd/run-mast-examples/ex03-slots/section.html new file mode 100644 index 0000000..75f31ac --- /dev/null +++ b/cmd/run-mast-examples/ex03-slots/section.html @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/cmd/run-mast-examples/ex04-templates/example.go b/cmd/run-mast-examples/ex04-templates/example.go new file mode 100644 index 0000000..ca12658 --- /dev/null +++ b/cmd/run-mast-examples/ex04-templates/example.go @@ -0,0 +1,29 @@ +// Copyright (C) 2024 early (LGPL) +package ex04 + +import ( + "text/template" + + "git.earlybird.gay/mast-engine/cmd/run-mast-examples/parts" + "git.earlybird.gay/mast-engine/page" + "git.earlybird.gay/mast-engine/render" +) + +var Page = page.New("ex04", "page.html", + page.OnLoad(func(data render.Data) error { + data.Set("message", "Hello, Hastur!") + return nil + }), + page.Funcs(template.FuncMap{ + "reverse": func(s string) string { + out := make([]byte, len(s)) + for i := range (len(s) + 1) / 2 { + j := len(s) - i - 1 + out[i] = s[j] + out[j] = s[i] + } + return string(out) + }, + }), + page.Includes(parts.ExampleNav), +) diff --git a/cmd/run-mast-examples/ex04-templates/page.html b/cmd/run-mast-examples/ex04-templates/page.html new file mode 100644 index 0000000..fb62122 --- /dev/null +++ b/cmd/run-mast-examples/ex04-templates/page.html @@ -0,0 +1,39 @@ + + +
+ Example 4 +
+ +

Template Data

+

Let's step back to talk about template data. Go provides templates + using "handlebars" notation to create server-side behavior on your + pages. For example, on this page, {{ `{{ .message }}` }} is + "{{ .message }}". +

+

You can also add functions, if the ones provided do not do everything + you need. On this page, {{ `{{ reverse "hello" }}`}} is + "{{ reverse "hello" }}". +

+
var index = page.New("index", "index.html",
+    page.OnLoad(func(data render.Data) error {
+        data.Set("message", "Hello, Hastur!")
+        return nil
+    }),
+    page.Funcs(template.FuncMap{
+        "reverse": func(s string) string {
+            out := make([]byte, len(s))
+            for i := range (len(s) + 1) / 2 {
+                j := len(s) - i - 1
+                out[i] = s[j]
+                out[j] = s[i]
+            }
+            return string(out)
+        },
+    }),
+)
+ + + Slots + + + \ No newline at end of file diff --git a/cmd/run-mast-examples/ex06-data/example.go b/cmd/run-mast-examples/ex06-data/example.go new file mode 100644 index 0000000..d85da0f --- /dev/null +++ b/cmd/run-mast-examples/ex06-data/example.go @@ -0,0 +1,42 @@ +// Copyright (C) 2024 early (LGPL) +package ex06 + +import ( + "errors" + "strings" + + "git.earlybird.gay/mast-engine/cmd/run-mast-examples/parts" + "git.earlybird.gay/mast-engine/page" + "git.earlybird.gay/mast-engine/part" + "git.earlybird.gay/mast-engine/render" +) + +type exampleStruct struct { + Data string +} + +var Page = page.New("ex01", "page.html", + page.OnLoad(func(data render.Data) error { + // This sets .some.really.nested.Data to "hello!". + // Bit of a silly example, but it shows the point. + data.Set("some", map[string]any{ + "really": map[string]any{ + "nested": exampleStruct{ + Data: "hello, nested data!", + }, + }, + }) + return nil + }), + page.Includes(parts.ExampleNav, messagePrinter), +) +var messagePrinter = part.New("message-printer", "message-printer.html", + part.OnLoad(func(data render.Data) error { + message, ok := data.Get("message").(string) + if !ok { + return errors.New("no message set") + } + data.Set("transformedMessage", strings.ToUpper(message)) + return nil + }), +) diff --git a/cmd/run-mast-examples/ex06-data/message-printer.html b/cmd/run-mast-examples/ex06-data/message-printer.html new file mode 100644 index 0000000..7ee3d8b --- /dev/null +++ b/cmd/run-mast-examples/ex06-data/message-printer.html @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/cmd/run-mast-examples/ex06-data/page.html b/cmd/run-mast-examples/ex06-data/page.html new file mode 100644 index 0000000..cf6c2b6 --- /dev/null +++ b/cmd/run-mast-examples/ex06-data/page.html @@ -0,0 +1,25 @@ + + +
+ Example 6 +
+ +

Passing Data to Parts

+

Sometimes, you may want to provide more data to a part than just the + HTML to include. To do this, write attributes on the part that start + with a colon ":". +

+

You can even do this with template fields by starting with a ".". + Unfortunately, full template pipelines aren't supported this way + right now. You can only pass a string or a value contained in the + parent data. +

+ + + + + + Parts + + + \ No newline at end of file diff --git a/cmd/run-mast-examples/index.html b/cmd/run-mast-examples/index.html new file mode 100644 index 0000000..bd9e8af --- /dev/null +++ b/cmd/run-mast-examples/index.html @@ -0,0 +1,19 @@ + + +
+ Hastur Engine Examples +
+ +

Hastur Engine Examples

+

This is a set of examples for usage of the Hastur Web Engine!

+

Links

+
    +
  1. Pages
  2. +
  3. Parts
  4. +
  5. Slots
  6. +
  7. Go Templates
  8. +
  9. N/A
  10. +
  11. Passing Data to Parts
  12. +
+ + \ No newline at end of file diff --git a/cmd/run-mast-examples/main.go b/cmd/run-mast-examples/main.go new file mode 100644 index 0000000..ee62a19 --- /dev/null +++ b/cmd/run-mast-examples/main.go @@ -0,0 +1,27 @@ +// Copyright (C) 2024 early (LGPL) +package main + +import ( + "net/http" + + "git.earlybird.gay/mast-engine/cmd/run-mast-examples/ex01-pages" + "git.earlybird.gay/mast-engine/cmd/run-mast-examples/ex02-parts" + "git.earlybird.gay/mast-engine/cmd/run-mast-examples/ex03-slots" + "git.earlybird.gay/mast-engine/cmd/run-mast-examples/ex04-templates" + "git.earlybird.gay/mast-engine/cmd/run-mast-examples/ex06-data" + "git.earlybird.gay/mast-engine/page" +) + +var index = page.New("index", "index.html") + +func main() { + mux := new(http.ServeMux) + mux.Handle("GET /{$}", index) + mux.Handle("GET /ex01", ex01.Page) + mux.Handle("GET /ex02", ex02.Page) + mux.Handle("GET /ex03", ex03.Page) + mux.Handle("GET /ex04", ex04.Page) + mux.Handle("GET /ex06", ex06.Page) + + http.ListenAndServe("0.0.0.0:3000", mux) +} diff --git a/cmd/run-mast-examples/parts/example-nav.html b/cmd/run-mast-examples/parts/example-nav.html new file mode 100644 index 0000000..d230c9a --- /dev/null +++ b/cmd/run-mast-examples/parts/example-nav.html @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/cmd/run-mast-examples/parts/parts.go b/cmd/run-mast-examples/parts/parts.go new file mode 100644 index 0000000..2a7fc4e --- /dev/null +++ b/cmd/run-mast-examples/parts/parts.go @@ -0,0 +1,6 @@ +// Copyright (C) 2024 early (LGPL) +package parts + +import "git.earlybird.gay/mast-engine/part" + +var ExampleNav = part.New("example-nav", "example-nav.html") diff --git a/examples/ex01-pages/example.go b/examples/ex01-pages/example.go deleted file mode 100644 index e6dcd89..0000000 --- a/examples/ex01-pages/example.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (C) 2024 early (LGPL) -package ex01 - -import ( - "git.earlybird.gay/mast-engine/examples/parts" - "git.earlybird.gay/mast-engine/page" -) - -var Page = page.New("ex01", "page.html", page.Includes(parts.ExampleNav)) diff --git a/examples/ex01-pages/page.html b/examples/ex01-pages/page.html deleted file mode 100644 index 17ef3b1..0000000 --- a/examples/ex01-pages/page.html +++ /dev/null @@ -1,15 +0,0 @@ - - -
- Example 1 -
- -

Basic Page

-

This is a static page. Hooray.

- - - - Parts - - - \ No newline at end of file diff --git a/examples/ex02-parts/example.go b/examples/ex02-parts/example.go deleted file mode 100644 index 6ce8aed..0000000 --- a/examples/ex02-parts/example.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (C) 2024 early (LGPL) -package ex02 - -import ( - "git.earlybird.gay/mast-engine/examples/parts" - "git.earlybird.gay/mast-engine/page" - "git.earlybird.gay/mast-engine/part" -) - -var section = part.New("my-section", "section.html") - -// Use *.Includes to include a part as a dependency. -var Page = page.New("ex02", "page.html", page.Includes(section, parts.ExampleNav)) diff --git a/examples/ex02-parts/page.html b/examples/ex02-parts/page.html deleted file mode 100644 index 830c64d..0000000 --- a/examples/ex02-parts/page.html +++ /dev/null @@ -1,23 +0,0 @@ - - -
- Example 2 -
- -

Page with Parts

-

This page uses "parts" to create sections on the page. Parts are - HTML blocks that you can re-use. -

- - -

Section

-

This is inner HTML for a my-section "part". It replaces the slot tag - in the part. -

-
- - - Pages - Slots - - \ No newline at end of file diff --git a/examples/ex02-parts/section.html b/examples/ex02-parts/section.html deleted file mode 100644 index a4fb103..0000000 --- a/examples/ex02-parts/section.html +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/examples/ex03-slots/example.go b/examples/ex03-slots/example.go deleted file mode 100644 index 0f8f065..0000000 --- a/examples/ex03-slots/example.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (C) 2024 early (LGPL) -package ex03 - -import ( - "git.earlybird.gay/mast-engine/examples/parts" - "git.earlybird.gay/mast-engine/page" - "git.earlybird.gay/mast-engine/part" -) - -var section = part.New("my-section", "section.html") - -// Use *.Includes to include a part as a dependency. -var Page = page.New("ex03", "page.html", page.Includes(section, parts.ExampleNav)) diff --git a/examples/ex03-slots/page.html b/examples/ex03-slots/page.html deleted file mode 100644 index 2ea74a3..0000000 --- a/examples/ex03-slots/page.html +++ /dev/null @@ -1,33 +0,0 @@ - - -
- Example 3 -
- -

Page with Parts

-

This page uses "parts" to create sections on the page. Parts are - HTML blocks that you can re-use. -

- - - -

Section with Named Slots

-

Use the slot tag to fill in named slots.

-

You can do this with multiple HTML elements!

-
- - - -

Section with a Subsection

-

You can also include parts inside parts.

- -

Subsection

-

This my-section is a subsection!

-
-
- - - Parts - Go Templates - - \ No newline at end of file diff --git a/examples/ex03-slots/section.html b/examples/ex03-slots/section.html deleted file mode 100644 index 75f31ac..0000000 --- a/examples/ex03-slots/section.html +++ /dev/null @@ -1,13 +0,0 @@ - \ No newline at end of file diff --git a/examples/ex04-templates/example.go b/examples/ex04-templates/example.go deleted file mode 100644 index 9a20ed2..0000000 --- a/examples/ex04-templates/example.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2024 early (LGPL) -package ex04 - -import ( - "text/template" - - "git.earlybird.gay/mast-engine/examples/parts" - "git.earlybird.gay/mast-engine/page" - "git.earlybird.gay/mast-engine/render" -) - -var Page = page.New("ex04", "page.html", - page.OnLoad(func(data render.Data) error { - data.Set("message", "Hello, Hastur!") - return nil - }), - page.Funcs(template.FuncMap{ - "reverse": func(s string) string { - out := make([]byte, len(s)) - for i := range (len(s) + 1) / 2 { - j := len(s) - i - 1 - out[i] = s[j] - out[j] = s[i] - } - return string(out) - }, - }), - page.Includes(parts.ExampleNav), -) diff --git a/examples/ex04-templates/page.html b/examples/ex04-templates/page.html deleted file mode 100644 index fb62122..0000000 --- a/examples/ex04-templates/page.html +++ /dev/null @@ -1,39 +0,0 @@ - - -
- Example 4 -
- -

Template Data

-

Let's step back to talk about template data. Go provides templates - using "handlebars" notation to create server-side behavior on your - pages. For example, on this page, {{ `{{ .message }}` }} is - "{{ .message }}". -

-

You can also add functions, if the ones provided do not do everything - you need. On this page, {{ `{{ reverse "hello" }}`}} is - "{{ reverse "hello" }}". -

-
var index = page.New("index", "index.html",
-    page.OnLoad(func(data render.Data) error {
-        data.Set("message", "Hello, Hastur!")
-        return nil
-    }),
-    page.Funcs(template.FuncMap{
-        "reverse": func(s string) string {
-            out := make([]byte, len(s))
-            for i := range (len(s) + 1) / 2 {
-                j := len(s) - i - 1
-                out[i] = s[j]
-                out[j] = s[i]
-            }
-            return string(out)
-        },
-    }),
-)
- - - Slots - - - \ No newline at end of file diff --git a/examples/ex06-data/example.go b/examples/ex06-data/example.go deleted file mode 100644 index 688d14a..0000000 --- a/examples/ex06-data/example.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2024 early (LGPL) -package ex06 - -import ( - "errors" - "strings" - - "git.earlybird.gay/mast-engine/examples/parts" - "git.earlybird.gay/mast-engine/page" - "git.earlybird.gay/mast-engine/part" - "git.earlybird.gay/mast-engine/render" -) - -type exampleStruct struct { - Data string -} - -var Page = page.New("ex01", "page.html", - page.OnLoad(func(data render.Data) error { - // This sets .some.really.nested.Data to "hello!". - // Bit of a silly example, but it shows the point. - data.Set("some", map[string]any{ - "really": map[string]any{ - "nested": exampleStruct{ - Data: "hello, nested data!", - }, - }, - }) - return nil - }), - page.Includes(parts.ExampleNav, messagePrinter), -) -var messagePrinter = part.New("message-printer", "message-printer.html", - part.OnLoad(func(data render.Data) error { - message, ok := data.Get("message").(string) - if !ok { - return errors.New("no message set") - } - data.Set("transformedMessage", strings.ToUpper(message)) - return nil - }), -) diff --git a/examples/ex06-data/message-printer.html b/examples/ex06-data/message-printer.html deleted file mode 100644 index 7ee3d8b..0000000 --- a/examples/ex06-data/message-printer.html +++ /dev/null @@ -1,4 +0,0 @@ - \ No newline at end of file diff --git a/examples/ex06-data/page.html b/examples/ex06-data/page.html deleted file mode 100644 index cf6c2b6..0000000 --- a/examples/ex06-data/page.html +++ /dev/null @@ -1,25 +0,0 @@ - - -
- Example 6 -
- -

Passing Data to Parts

-

Sometimes, you may want to provide more data to a part than just the - HTML to include. To do this, write attributes on the part that start - with a colon ":". -

-

You can even do this with template fields by starting with a ".". - Unfortunately, full template pipelines aren't supported this way - right now. You can only pass a string or a value contained in the - parent data. -

- - - - - - Parts - - - \ No newline at end of file diff --git a/examples/go.mod b/examples/go.mod deleted file mode 100644 index 49086b2..0000000 --- a/examples/go.mod +++ /dev/null @@ -1,9 +0,0 @@ -module git.earlybird.gay/mast-engine/examples - -go 1.22.4 - -require git.earlybird.gay/mast-engine v0.0.0 - -require golang.org/x/net v0.27.0 // indirect - -replace git.earlybird.gay/mast-engine => .. diff --git a/examples/go.sum b/examples/go.sum deleted file mode 100644 index 7566714..0000000 --- a/examples/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= diff --git a/examples/index.html b/examples/index.html deleted file mode 100644 index bd9e8af..0000000 --- a/examples/index.html +++ /dev/null @@ -1,19 +0,0 @@ - - -
- Hastur Engine Examples -
- -

Hastur Engine Examples

-

This is a set of examples for usage of the Hastur Web Engine!

-

Links

-
    -
  1. Pages
  2. -
  3. Parts
  4. -
  5. Slots
  6. -
  7. Go Templates
  8. -
  9. N/A
  10. -
  11. Passing Data to Parts
  12. -
- - \ No newline at end of file diff --git a/examples/main.go b/examples/main.go deleted file mode 100644 index 90ab549..0000000 --- a/examples/main.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2024 early (LGPL) -package main - -import ( - "net/http" - - "git.earlybird.gay/mast-engine/examples/ex01-pages" - "git.earlybird.gay/mast-engine/examples/ex02-parts" - "git.earlybird.gay/mast-engine/examples/ex03-slots" - "git.earlybird.gay/mast-engine/examples/ex04-templates" - "git.earlybird.gay/mast-engine/examples/ex06-data" - "git.earlybird.gay/mast-engine/page" -) - -var index = page.New("index", "index.html") - -func main() { - mux := new(http.ServeMux) - mux.Handle("GET /{$}", index) - mux.Handle("GET /ex01", ex01.Page) - mux.Handle("GET /ex02", ex02.Page) - mux.Handle("GET /ex03", ex03.Page) - mux.Handle("GET /ex04", ex04.Page) - mux.Handle("GET /ex06", ex06.Page) - - http.ListenAndServe("0.0.0.0:3000", mux) -} diff --git a/examples/parts/example-nav.html b/examples/parts/example-nav.html deleted file mode 100644 index d230c9a..0000000 --- a/examples/parts/example-nav.html +++ /dev/null @@ -1,24 +0,0 @@ - \ No newline at end of file diff --git a/examples/parts/parts.go b/examples/parts/parts.go deleted file mode 100644 index 2a7fc4e..0000000 --- a/examples/parts/parts.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (C) 2024 early (LGPL) -package parts - -import "git.earlybird.gay/mast-engine/part" - -var ExampleNav = part.New("example-nav", "example-nav.html")