improvement: tailwind cli to build stylesheet

This commit is contained in:
joncrangle
2023-11-13 21:44:11 -05:00
parent 6bff28e18d
commit 78454f8713
7 changed files with 74 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
package main
import (
_ "embed"
"embed"
"fmt"
"log"
"os"
@@ -17,6 +17,7 @@ import (
//go:embed favicon.ico
var faviconData string
var cssData embed.FS
func main() {
parser := argparse.NewParser("ladder", "Every Wall needs a Ladder")
@@ -75,6 +76,14 @@ func main() {
}
app.Get("/", handlers.Form)
app.Get("/styles.css", func(c *fiber.Ctx) error {
cssData, err := cssData.ReadFile("styles.css")
if err != nil {
return c.Status(fiber.StatusInternalServerError).SendString("Internal Server Error")
}
c.Set("Content-Type", "text/css")
return c.Send(cssData)
})
app.Get("ruleset", handlers.Ruleset)
app.Get("raw/*", handlers.Raw)