From 5b62942f44a5d32c448f61bed969b260bab046df Mon Sep 17 00:00:00 2001 From: sudoer777 Date: Tue, 30 May 2023 16:57:23 -0500 Subject: [PATCH] Improve layout --- .prettierrc.cjs | 5 +++++ package.json | 3 ++- pnpm-lock.yaml | 12 ++++++++++++ src/content/global/Font.astro | 3 +++ src/content/global/Head.astro | 18 ++++++++++++++++++ src/layouts/Basic.astro | 28 ++++++++++------------------ 6 files changed, 50 insertions(+), 19 deletions(-) create mode 100644 src/content/global/Font.astro create mode 100644 src/content/global/Head.astro diff --git a/.prettierrc.cjs b/.prettierrc.cjs index c7ddb4b..94cc8ec 100644 --- a/.prettierrc.cjs +++ b/.prettierrc.cjs @@ -1,6 +1,7 @@ module.exports = { plugins: [ require.resolve('prettier-plugin-astro'), + require.resolve('prettier-plugin-sort-imports'), require.resolve('prettier-plugin-tailwindcss'), ], overrides: [ @@ -16,4 +17,8 @@ module.exports = { tabWidth: 4, semi: false, singleQuote: true, + printWidth: 80, + importOrder: ['^@core/(.*)$', '^@server/(.*)$', '^@ui/(.*)$', '^[./]'], + importOrderSeparation: true, + importOrderSortSpecifiers: true, } diff --git a/package.json b/package.json index 40541ca..808ac4a 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "eslint-plugin-tailwindcss": "^3.12.0", "prettier": "^2.8.8", "prettier-plugin-astro": "^0.9.1", - "prettier-plugin-tailwindcss": "^0.3.0" + "prettier-plugin-tailwindcss": "^0.3.0", + "prettier-plugin-sort-imports": "^1.7.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 13db1e0..aec0018 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -49,6 +49,9 @@ devDependencies: prettier-plugin-astro: specifier: ^0.9.1 version: 0.9.1 + prettier-plugin-sort-imports: + specifier: ^1.7.2 + version: 1.7.2(typescript@5.0.4) prettier-plugin-tailwindcss: specifier: ^0.3.0 version: 0.3.0(prettier-plugin-astro@0.9.1)(prettier@2.8.8) @@ -4128,6 +4131,15 @@ packages: sass-formatter: 0.7.6 synckit: 0.8.5 + /prettier-plugin-sort-imports@1.7.2(typescript@5.0.4): + resolution: {integrity: sha512-EUBmaLgQ6GcMcvusMlK/aN4QgPWDmjRjpYjc1htjp1nrbHpA+JA5/nncQJiFAao/mBX2qBninuyasd80x488mQ==} + peerDependencies: + typescript: '>4.0.0' + dependencies: + prettier: 2.8.8 + typescript: 5.0.4 + dev: true + /prettier-plugin-tailwindcss@0.3.0(prettier-plugin-astro@0.9.1)(prettier@2.8.8): resolution: {integrity: sha512-009/Xqdy7UmkcTBpwlq7jsViDqXAYSOMLDrHAdTMlVZOrKfM2o9Ci7EMWTMZ7SkKBFTG04UM9F9iM2+4i6boDA==} engines: {node: '>=12.17.0'} diff --git a/src/content/global/Font.astro b/src/content/global/Font.astro new file mode 100644 index 0000000..0abce60 --- /dev/null +++ b/src/content/global/Font.astro @@ -0,0 +1,3 @@ +
+ +
diff --git a/src/content/global/Head.astro b/src/content/global/Head.astro new file mode 100644 index 0000000..0bb2110 --- /dev/null +++ b/src/content/global/Head.astro @@ -0,0 +1,18 @@ +--- +export interface Props { + title: string + description: string +} + +const { title, description } = Astro.props +--- + + + + + + + + + {title} + diff --git a/src/layouts/Basic.astro b/src/layouts/Basic.astro index 212ac30..a731d75 100644 --- a/src/layouts/Basic.astro +++ b/src/layouts/Basic.astro @@ -1,4 +1,8 @@ --- +import Background from '../content/global/Background.astro' +import Font from '../content/global/Background.astro' +import Head from '../content/global/Head.astro' + export interface Props { title: string description: string @@ -9,24 +13,12 @@ const { title, description } = Astro.props - - - - - - - - {title} - - -
-
+ + + + -
-
+ +