No longer using app.SetStyle

This commit is contained in:
Eduard Urbach 2017-11-28 21:48:12 +01:00
parent c1bd0f3a8c
commit 0b6b161a37
5 changed files with 12 additions and 9 deletions

View File

@ -6,6 +6,7 @@ import (
"github.com/aerogo/aero" "github.com/aerogo/aero"
"github.com/aerogo/sitemap" "github.com/aerogo/sitemap"
"github.com/animenotifier/arn" "github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components/css"
"github.com/animenotifier/notify.moe/components/js" "github.com/animenotifier/notify.moe/components/js"
) )
@ -18,6 +19,9 @@ func configureAssets(app *aero.Application) {
serviceWorkerBytes, err := ioutil.ReadFile("sw/service-worker.js") serviceWorkerBytes, err := ioutil.ReadFile("sw/service-worker.js")
serviceWorker := string(serviceWorkerBytes) serviceWorker := string(serviceWorkerBytes)
// CSS bundle
cssBundle := css.Bundle()
if err != nil { if err != nil {
panic("Couldn't load service worker") panic("Couldn't load service worker")
} }
@ -26,8 +30,8 @@ func configureAssets(app *aero.Application) {
return ctx.JavaScript(scriptBundle) return ctx.JavaScript(scriptBundle)
}) })
app.Get("/scripts.js", func(ctx *aero.Context) string { app.Get("/styles", func(ctx *aero.Context) string {
return ctx.JavaScript(scriptBundle) return ctx.CSS(cssBundle)
}) })
app.Get("/service-worker", func(ctx *aero.Context) string { app.Get("/service-worker", func(ctx *aero.Context) string {

View File

@ -30,7 +30,8 @@
"main": "main" "main": "main"
}, },
"push": [ "push": [
"/scripts" "/scripts",
"/styles"
], ],
"manifest": { "manifest": {
"short_name": "notify.moe", "short_name": "notify.moe",

View File

@ -1,6 +1,8 @@
component Layout(app *aero.Application, ctx *aero.Context, user *arn.User, openGraph *arn.OpenGraph, meta, tags []string, organization string, content string) component Layout(app *aero.Application, ctx *aero.Context, user *arn.User, openGraph *arn.OpenGraph, meta, tags []string, organization string, content string)
html(lang="en") html(lang="en")
head head
link(rel="stylesheet", href="/styles")
if openGraph != nil if openGraph != nil
title= openGraph.Tags["og:title"] title= openGraph.Tags["og:title"]
else else

View File

@ -7,7 +7,6 @@ import (
"github.com/aerogo/session-store-nano" "github.com/aerogo/session-store-nano"
"github.com/animenotifier/arn" "github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/auth" "github.com/animenotifier/notify.moe/auth"
"github.com/animenotifier/notify.moe/components/css"
"github.com/animenotifier/notify.moe/middleware" "github.com/animenotifier/notify.moe/middleware"
"github.com/animenotifier/notify.moe/pages" "github.com/animenotifier/notify.moe/pages"
) )
@ -24,9 +23,6 @@ func configure(app *aero.Application) *aero.Application {
app.Sessions.Duration = 3600 * 24 * 30 * 6 app.Sessions.Duration = 3600 * 24 * 30 * 6
app.Sessions.Store = nanostore.New(arn.DB.Collection("Session")) app.Sessions.Store = nanostore.New(arn.DB.Collection("Session"))
// CSS
app.SetStyle(css.Bundle())
// Security // Security
configureHTTPS(app) configureHTTPS(app)

View File

@ -26,10 +26,10 @@ mixin vertical-wrap-center
align-items center align-items center
mixin noise-light mixin noise-light
background-image url("/images/elements/noise-light.png") background-image url("//media.notify.moe/images/elements/noise-light.png")
mixin noise-strong mixin noise-strong
background-image url("/images/elements/noise-strong.png") background-image url("//media.notify.moe/images/elements/noise-strong.png")
mixin ui-element mixin ui-element
border 1px solid ui-border-color border 1px solid ui-border-color