From 4364d99f94ed3f25c13989c2d7ccd020adbafd36 Mon Sep 17 00:00:00 2001 From: arctic_hen7 Date: Sat, 30 Oct 2021 20:01:36 +1100 Subject: [PATCH] =?UTF-8?q?feat(website):=20=E2=9C=A8=20re-added=20size=20?= =?UTF-8?q?optimizations=20plugin=20to=20website?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/website.yml | 2 +- bonnie.toml | 3 ++- website/Cargo.toml | 4 ++-- website/src/lib.rs | 8 ++++---- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 6fb3e35d71..bd7019c2e6 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -19,7 +19,7 @@ jobs: with: fetch-depth: 0 - run: cargo install bonnie wasm-pack - - run: cargo install perseus-cli --version 0.3.0-beta.14 + - run: cargo install perseus-cli --version 0.3.0-beta.15 - run: npm install working-directory: website - name: Build website diff --git a/bonnie.toml b/bonnie.toml index 0e99b9a7a8..82caec8ec6 100644 --- a/bonnie.toml +++ b/bonnie.toml @@ -35,7 +35,6 @@ site.subcommands.serve.desc = "serves the site's exported content" site.subcommands.tinker.cmd = [ "cd website", "perseus tinker" - ] site.subcommands.tinker.desc = "runs tinkers on the website" site.subcommands.build-tailwind.cmd = [ @@ -51,6 +50,7 @@ site.subcommands.build-tailwind.subcommands.prod.desc = "builds a tailwind style site.subcommands.deploy.cmd = [ "bonnie site build-tailwind prod", "cd website", + "PERSEUS_BASE_PATH=http://localhost:8080/perseus perseus tinker", # Point this live version of the CLI at the given example "PERSEUS_BASE_PATH=http://localhost:8080/perseus perseus deploy -e" @@ -59,6 +59,7 @@ site.subcommands.deploy.desc = "builds the website for production and finalizes site.subcommands.deploy-prod.cmd = [ "bonnie site build-tailwind prod", "cd website", + "PERSEUS_BASE_PATH=http://localhost:8080/perseus perseus tinker", # Point this live version of the CLI at the given example "PERSEUS_BASE_PATH=https://arctic-hen7.github.io/perseus perseus deploy -e" ] diff --git a/website/Cargo.toml b/website/Cargo.toml index 6ad2b9193d..f80a9afa25 100644 --- a/website/Cargo.toml +++ b/website/Cargo.toml @@ -13,7 +13,7 @@ readme = "./README.md" [dependencies] # We use the current version of Perseus, not the local one -perseus = { version = "0.3.0-beta.14", features = [ "translator-fluent" ] } +perseus = { version = "0.3.0-beta.15", features = [ "translator-fluent" ] } sycamore = "0.6" sycamore-router = "0.6" serde = "1" @@ -24,4 +24,4 @@ pulldown-cmark = "0.8" lazy_static = "1" web-sys = { version = "0.3", features = [ "Event", "EventTarget" ] } wasm-bindgen = "0.2" -# perseus-size-opt = "0.1" +perseus-size-opt = "0.1" diff --git a/website/src/lib.rs b/website/src/lib.rs index 450e09998d..38edf56149 100644 --- a/website/src/lib.rs +++ b/website/src/lib.rs @@ -2,8 +2,8 @@ mod components; mod error_pages; mod templates; -use perseus::define_app; -// use perseus_size_opt::{perseus_size_opt, SizeOpts}; +use perseus::{define_app, Plugins}; +use perseus_size_opt::{perseus_size_opt, SizeOpts}; define_app! { templates: [ @@ -15,6 +15,6 @@ define_app! { locales: { default: "en-US", other: [] - } - // plugins: Plugins::new().plugin(perseus_size_opt(), SizeOpts::default()) + }, + plugins: Plugins::new().plugin(perseus_size_opt, SizeOpts::default()) }