diff --git a/packages/nuxt/.gitignore b/packages/nuxt/.gitignore index e8f682b..a6f0acb 100644 --- a/packages/nuxt/.gitignore +++ b/packages/nuxt/.gitignore @@ -88,3 +88,6 @@ sw.* # Vim swap files *.swp + +/built/ +/static/media/ diff --git a/packages/nuxt/assets/README.md b/packages/nuxt/assets/README.md deleted file mode 100644 index 34766f9..0000000 --- a/packages/nuxt/assets/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# ASSETS - -**This directory is not required, you can delete it if you don't want to use it.** - -This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. - -More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked). diff --git a/packages/nuxt/assets/global.ts b/packages/nuxt/assets/global.ts new file mode 100644 index 0000000..6a5fcb2 --- /dev/null +++ b/packages/nuxt/assets/global.ts @@ -0,0 +1,3 @@ +import type { ITheme } from '~/server/theme' + +export const THEME: ITheme = JSON.parse(process.env.THEME!) diff --git a/packages/nuxt/layouts/README.md b/packages/nuxt/layouts/README.md deleted file mode 100644 index cad1ad5..0000000 --- a/packages/nuxt/layouts/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# LAYOUTS - -**This directory is not required, you can delete it if you don't want to use it.** - -This directory contains your Application Layouts. - -More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts). diff --git a/packages/nuxt/layouts/default.vue b/packages/nuxt/layouts/default.vue index 2170b7d..92b04e0 100644 --- a/packages/nuxt/layouts/default.vue +++ b/packages/nuxt/layouts/default.vue @@ -1,55 +1,64 @@ - diff --git a/packages/nuxt/nuxt.config.ts b/packages/nuxt/nuxt.config.ts index 3e268cf..1f6971e 100644 --- a/packages/nuxt/nuxt.config.ts +++ b/packages/nuxt/nuxt.config.ts @@ -18,7 +18,15 @@ const config = async (): Promise => { content: theme.description || '', }, ], - link: [{ rel: 'icon', type: 'image/x-icon', href: '/media/favicon.ico' }], + link: [ + { rel: 'icon', type: 'image/x-icon', href: '/media/favicon.ico' }, + { + rel: 'stylesheet', + href: theme.awsm + ? `https://unpkg.com/awsm.css/dist/awsm_theme_${theme.awsm}.min.css` + : 'https://unpkg.com/awsm.css/dist/awsm.min.css', + }, + ], }, // Global CSS (https://go.nuxtjs.dev/config-css) @@ -47,6 +55,9 @@ const config = async (): Promise => { // Build Configuration (https://go.nuxtjs.dev/config-build) build: {}, + env: { + THEME: JSON.stringify(theme), + }, } } diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index a41dbf2..0c157f9 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -9,14 +9,15 @@ "generate": "nuxt-ts generate", "lint:js": "eslint --ext .ts,.js,.vue --ignore-path .gitignore .", "lint": "yarn lint:js", - "ts": "ts-node -O '{\"module\":\"commonjs\"}'" + "ts": "ts-node -O '{\"module\":\"commonjs\"}'", + "ts:prepare": "yarn ts scripts/prepare.ts" }, "dependencies": { - "@types/express": "^4.17.9", - "@types/js-yaml": "^3.12.5", "@nuxt/typescript-runtime": "^2.0.0", "@nuxtjs/axios": "^5.12.2", "@patarapolw/scope-css": "^1.3.0", + "@types/express": "^4.17.9", + "@types/js-yaml": "^3.12.5", "better-sqlite3": "^7.1.1", "cheerio": "^1.0.0-rc.3", "core-js": "^3.6.5", @@ -45,6 +46,7 @@ "eslint-plugin-prettier": "^3.1.4", "import-sort-parser-typescript": "^6.0.0", "nodejieba": "^2.5.1", + "nuxt-property-decorator": "^2.8.8", "prettier": "^2.1.2", "ts-node": "^9.1.1", "typescript": "4.0.5" @@ -62,4 +64,4 @@ "pnpm": "please-use-yarn" }, "engineStrict": true -} \ No newline at end of file +} diff --git a/packages/nuxt/pages/README.md b/packages/nuxt/pages/README.md deleted file mode 100644 index 1d5d48b..0000000 --- a/packages/nuxt/pages/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# PAGES - -This directory contains your Application Views and Routes. -The framework reads all the `*.vue` files inside this directory and creates the router of your application. - -More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing). diff --git a/packages/nuxt/pages/index.vue b/packages/nuxt/pages/index.vue index c64e17a..1b1127a 100644 --- a/packages/nuxt/pages/index.vue +++ b/packages/nuxt/pages/index.vue @@ -1,8 +1,6 @@