diff --git a/audon-fe/index.html b/audon-fe/index.html
index 40fbc44..4abde0f 100644
--- a/audon-fe/index.html
+++ b/audon-fe/index.html
@@ -1,13 +1,47 @@
+{% define "tmpl" %}
-
+
+
Audon
+
+
+
+
+
+ {% if .Room %}
+
+ {% if .Room.Description %}
+
+ {% else %}
+
+ {% end %}
+ {% else %}
+
+
+ {% end %}
+
+
+
+
+ {% if .Room %}
+
+ {% if .Room.Description %}
+
+ {% else %}
+
+ {% end %}
+ {% else %}
+
+
+ {% end %}
+{% end %}
\ No newline at end of file
diff --git a/audon-fe/public/static/opengraph.c05d412c.png b/audon-fe/public/static/opengraph.c05d412c.png
new file mode 100644
index 0000000..244047a
Binary files /dev/null and b/audon-fe/public/static/opengraph.c05d412c.png differ
diff --git a/audon-fe/src/App.vue b/audon-fe/src/App.vue
index f6f5e12..3bda4f8 100644
--- a/audon-fe/src/App.vue
+++ b/audon-fe/src/App.vue
@@ -23,7 +23,10 @@ export default {
-
+
+
+
+
@@ -36,9 +39,6 @@ export default {
-
-
-
#mascot {
- position: absolute;
+ position: fixed;
bottom: 0;
left: 0;
}
diff --git a/audon-fe/src/assets/img/audon-wordmark-white-text-isolated.svg b/audon-fe/src/assets/img/audon-wordmark-white-text-isolated.svg
new file mode 100644
index 0000000..82b0b9f
--- /dev/null
+++ b/audon-fe/src/assets/img/audon-wordmark-white-text-isolated.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/audon-fe/src/assets/style.css b/audon-fe/src/assets/style.css
index 541b6a6..cc836a0 100644
--- a/audon-fe/src/assets/style.css
+++ b/audon-fe/src/assets/style.css
@@ -28,6 +28,7 @@ html,
body,
#app {
height: 100%;
+ width: 100%;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans CJK JP", "Original Yu Gothic", "Yu Gothic", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Sans Emoji";
}
@@ -35,3 +36,7 @@ a.plain {
text-decoration: inherit;
color: inherit;
}
+
+.v-card {
+ background-color: rgba(33, 33, 33, 0.95);
+}
diff --git a/audon-fe/src/views/RoomView.vue b/audon-fe/src/views/RoomView.vue
index 0a5e2ea..fd9f48e 100644
--- a/audon-fe/src/views/RoomView.vue
+++ b/audon-fe/src/views/RoomView.vue
@@ -893,7 +893,4 @@ export default {
\ No newline at end of file
diff --git a/room.go b/room.go
index 9395686..69f40d5 100644
--- a/room.go
+++ b/room.go
@@ -152,6 +152,22 @@ func updateRoomHandler(c echo.Context) (err error) {
return c.JSON(http.StatusOK, room)
}
+// handler for GET to /r/:id
+func renderRoomHandler(c echo.Context) error {
+ roomID := c.Param("id")
+ if err := mainValidator.Var(&roomID, "required,printascii"); err != nil {
+ return wrapValidationError(err)
+ }
+
+ room, err := findRoomByID(c.Request().Context(), roomID)
+ if err != nil {
+ return echo.NotFoundHandler(c)
+ }
+
+ return c.Render(http.StatusOK, "tmpl", &TemplateData{Config: &mainConfig.AppConfigBase, Room: room})
+}
+
+// for preview, this bypasses authentication
func previewRoomHandler(c echo.Context) (err error) {
roomID := c.Param("id")
if err := mainValidator.Var(&roomID, "required,printascii"); err != nil {
diff --git a/server.go b/server.go
index 1b467b2..05fc92b 100644
--- a/server.go
+++ b/server.go
@@ -32,6 +32,11 @@ type (
templates *template.Template
}
+ TemplateData struct {
+ Config *AppConfigBase
+ Room *Room
+ }
+
CustomValidator struct {
validator *validator.Validate
}
@@ -100,6 +105,9 @@ func main() {
defer e.Close()
e.Validator = &CustomValidator{validator: mainValidator}
+ e.Renderer = &Template{
+ templates: template.Must(template.New("tmpl").Delims("{%", "%}").ParseGlob("audon-fe/dist/index.html")),
+ }
// Setup session middleware (currently Audon stores all client data in cookie)
log.Println("Connecting to Redis")
@@ -151,7 +159,12 @@ func main() {
api.PUT("/room/:room/:user", updatePermissionHandler)
e.Static("/assets", "audon-fe/dist/assets")
- e.File("/*", "audon-fe/dist/index.html")
+ e.Static("/static", "audon-fe/dist/static")
+ e.GET("/r/:id", renderRoomHandler)
+ e.GET("/*", func(c echo.Context) error {
+ return c.Render(http.StatusOK, "tmpl", &TemplateData{Config: &mainConfig.AppConfigBase})
+ })
+ // e.File("/*", "audon-fe/dist/index.html")
// use anonymous func to support graceful shutdown
go func() {