diff --git a/.gitignore b/.gitignore index 59c3bf9..a2ad7c2 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,14 @@ yarn-debug.log* yarn-error.log* pnpm-debug.log* +# yarn +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions # environment variables .env diff --git a/.vscode/settings.json b/.vscode/settings.json index 895aee5..562f586 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -29,9 +29,6 @@ "typescript.updateImportsOnFileMove.enabled": "always", "javascript.updateImportsOnFileMove.enabled": "always", "prettier.documentSelectors": ["**/*.astro"], - "[astro]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, "eslint.validate": [ "javascript", "javascriptreact", diff --git a/.yarnrc.yml b/.yarnrc.yml new file mode 100644 index 0000000..3186f3f --- /dev/null +++ b/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/README.md b/README.md index d8e28a4..4a54b21 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ This repository contains the source code required to build the [HawAPI](https:// ## Topics - [Prerequisites](#prerequisites) -- [Dependencies](#dependencies) - [Setup](#usage) - [Scripts](#scripts) - [Contributing](#contributing) @@ -14,17 +13,9 @@ This repository contains the source code required to build the [HawAPI](https:// ## Prerequisites - Text editor or IDE (VsCode, Subline, Noteped++) -- Npm/Yarn +- Yarn - [Astro](https://astro.build/) for [website](https://github.com/HawAPI/website) generation -## Dependencies - -- [@astrojs/sitemap](https://www.npmjs.com/package/@astrojs/sitemap) -- [astro](https://www.npmjs.com/package/astro) -- [astro-compress](https://www.npmjs.com/package/astro-compress) -- [eslint](https://www.npmjs.com/package/eslint) -- [prettier](https://www.npmjs.com/package/prettier) - ## Setup Step by step of how to run the application. diff --git a/astro.config.mjs b/astro.config.mjs index 7240e59..d06311f 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -2,6 +2,11 @@ import sitemap from '@astrojs/sitemap'; import { defineConfig } from 'astro/config'; import compress from 'astro-compress'; +import rename from 'astro-rename'; + +import HashRenamer from './src/lib/hash-renamer'; + +const renamer = new HashRenamer(); // https://astro.build/config export default defineConfig({ @@ -19,7 +24,13 @@ export default defineConfig({ // Astro sitemap. // // Ref: https://docs.astro.build/en/guides/integrations-guide/sitemap/ - integrations: [sitemap(), compress()], + integrations: [ + sitemap(), + rename({ + rename: { except: ['title'], strategy: (key) => renamer.rename(key) }, + }), + compress(), + ], // Listen on all addresses, including LAN and public addresses. // // Ref: https://docs.astro.build/en/reference/configuration-reference/#serverhost diff --git a/package.json b/package.json index 2e2f7dd..5cbfd45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { - "name": "@hawapi/root", - "version": "1.2.0", + "name": "@hawapi/website", + "packageManager": "yarn@4.0.1", + "version": "1.3.0", "private": true, "scripts": { "dev": "astro dev", @@ -8,17 +9,18 @@ "clean": "rm -rf ./build" }, "devDependencies": { - "@astrojs/sitemap": "^3.0.0", - "@typescript-eslint/eslint-plugin": "^6.7.2", - "@typescript-eslint/parser": "^6.7.2", - "astro": "^3.1.1", - "astro-compress": "^2.0.12", + "@astrojs/sitemap": "^3.0.3", + "@typescript-eslint/eslint-plugin": "^6.9.1", + "@typescript-eslint/parser": "^6.9.1", + "astro": "^3.4.2", + "astro-compress": "^2.2.0", "astro-icon": "^0.8.1", - "eslint": "^8.49.0", + "astro-rename": "^1.1.1", + "eslint": "^8.52.0", "eslint-config-prettier": "^9.0.0", - "eslint-plugin-astro": "^0.29.0", + "eslint-plugin-astro": "^0.29.1", "prettier": "^3.0.3", - "prettier-plugin-astro": "^0.12.0", + "prettier-plugin-astro": "^0.12.1", "svgo": "2.8.0" } } diff --git a/public/styles/swagger-ui.css b/public/styles/swagger-ui.css index e51895a..5b9ec79 100644 --- a/public/styles/swagger-ui.css +++ b/public/styles/swagger-ui.css @@ -7162,7 +7162,7 @@ small, .swagger-ui .opblock-tag-section { display: flex; flex-direction: column; - border: 1px solid var(--secondary-border-color); + border: 1px solid var(--border-color); padding: 1rem; border-radius: 5px; } @@ -7947,7 +7947,7 @@ small, } .swagger-ui .btn.execute { background-color: var(--primary-border-color); - border: 1px solid var(--secondary-border-color); + border: 1px solid var(--border-color); color: #fff; } .swagger-ui .btn-group { @@ -8129,7 +8129,7 @@ small, .swagger-ui textarea { background: transparent; color: #fff; - border: 1px solid var(--secondary-border-color); + border: 1px solid var(--border-color); border-radius: 4px; margin: 5px 0; min-width: 100px; @@ -8250,7 +8250,7 @@ small, 50% no-repeat; } .swagger-ui .dialog-ux { - border: 1px solid var(--secondary-border-color); + border: 1px solid var(--border-color); color: var(--secondary-text-color); border-radius: 5px; bottom: 0; @@ -8270,7 +8270,7 @@ small, } .swagger-ui .dialog-ux .modal-ux { background-color: var(--primary-color); - border: 1px solid var(--secondary-border-color); + border: 1px solid var(--border-color); color: var(--secondary-text-color); border-radius: 5px; box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.2); @@ -8303,7 +8303,7 @@ small, margin: 15px 0 0; } .swagger-ui .dialog-ux .modal-ux-header { - border-bottom: 1px solid var(--secondary-border-color); + border-bottom: 1px solid var(--border-color); align-items: center; display: flex; padding: 12px 0; @@ -8565,7 +8565,7 @@ small, width: 100%; background-color: transparent; color: #fff; - border: 1px solid var(--secondary-border-color); + border: 1px solid var(--border-color); pointer-events: none; } .swagger-ui .servers h4.message { diff --git a/src/components/core/BackgroundEffect.astro b/src/components/core/BackgroundEffect.astro index 9579bdc..b4fc852 100644 --- a/src/components/core/BackgroundEffect.astro +++ b/src/components/core/BackgroundEffect.astro @@ -1,4 +1,5 @@ --- + --- @@ -7,13 +8,20 @@ .background-effect { width: 0px; height: 0px; - border-left: 32rem solid transparent; - border-right: 32rem solid transparent; - border-top: 70rem solid red; + border-left: 26.6vw solid transparent; + border-right: 26.6vw solid transparent; + border-top: 60vh solid red; filter: blur(120px); top: 0; opacity: 0.15; position: absolute; pointer-events: none; } + + @media (max-width: 768px) { + .background-effect { + border-left: 50vw solid transparent; + border-right: 50vw solid transparent; + } + } diff --git a/src/components/core/Button.astro b/src/components/core/Button.astro deleted file mode 100644 index e0a18b8..0000000 --- a/src/components/core/Button.astro +++ /dev/null @@ -1,34 +0,0 @@ ---- -interface Props { - name: string; - id?: string; - classes?: Array; -} - -const { name, id, classes } = Astro.props as Props; ---- - - - - diff --git a/src/components/core/Description.astro b/src/components/core/Description.astro new file mode 100644 index 0000000..9adf2ad --- /dev/null +++ b/src/components/core/Description.astro @@ -0,0 +1,19 @@ +--- +interface Props { + value?: string; + margin?: string; +} + +const { value, margin = '1rem' } = Astro.props; +--- + +

+ {value ?? } +

+ + diff --git a/src/components/core/Link.astro b/src/components/core/Link.astro new file mode 100644 index 0000000..fa48318 --- /dev/null +++ b/src/components/core/Link.astro @@ -0,0 +1,30 @@ +--- +interface Props { + name?: string; + title: string; + href: string; + isLocal?: boolean; + active?: boolean; + id?: string; + classes?: string[]; +} + +const { name, title, href, isLocal, id, classes } = Astro.props as Props; +--- + + + {name ?? } + + + diff --git a/src/components/core/LinkBox.astro b/src/components/core/LinkBox.astro new file mode 100644 index 0000000..56a647b --- /dev/null +++ b/src/components/core/LinkBox.astro @@ -0,0 +1,50 @@ +--- +interface Props { + name: string; + title: string; + href: string; + isLocal?: boolean; + active?: boolean; + id?: string; +} + +const { name, title, href, isLocal, active, id } = Astro.props as Props; +--- + + + {name} + + + diff --git a/src/components/core/Nav.astro b/src/components/core/Nav.astro index 9505d25..ea1d6fd 100644 --- a/src/components/core/Nav.astro +++ b/src/components/core/Nav.astro @@ -1,35 +1,57 @@ --- +import Link from './Link.astro'; --- -