feat: added astro-compress

This commit is contained in:
Sergey Yarkov 2022-08-01 02:21:11 +03:00
parent 487b7e2add
commit e1d6f776f2
6 changed files with 1084 additions and 165 deletions

View File

@ -1,10 +1,11 @@
import { defineConfig } from 'astro/config';
import solid from '@astrojs/solid-js';
import compress from 'astro-compress';
// https://astro.build/config
export default defineConfig({
site: 'https://yarkov.tech',
integrations: [solid()],
integrations: [solid(), compress({ img: false })],
markdown: {
syntaxHighlight: 'prism',
},

1233
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -10,10 +10,10 @@
},
"license": "MIT",
"scripts": {
"dev": "astro dev --host",
"dev": "astro dev --host --experimental-integrations",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview --host",
"build": "astro build --experimental-integrations",
"preview": "astro preview --host --experimental-integrations",
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json}\"",
"lint": "eslint '**/*.{js,mjs,ts,tsx}'"
},
@ -23,6 +23,7 @@
"@typescript-eslint/parser": "^5.31.0",
"astro": "^1.0.0-beta.73",
"astro-icon": "^0.7.3",
"astro-compress": "^0.0.15",
"eslint": "^8.20.0",
"eslint-plugin-solid": "^0.7.1",
"prettier": "^2.7.1",

View File

@ -1 +0,0 @@
window.theme=(()=>{const e=localStorage.getItem("theme");if(e&&("dark"===e||"light"===e))return e;const t=window.matchMedia("(prefers-color-scheme: dark)").matches;return t?"dark":"light"})(),document.documentElement.setAttribute("data-theme",window.theme),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:e})=>{window.theme=e?"dark":"light",localStorage.setItem("theme",window.theme),document.documentElement.setAttribute("data-theme",window.theme)});

View File

@ -20,5 +20,7 @@ const { title = SITE_METADATA.title, description } = Astro.props as Props;
</title>
<meta name='title' content={title} />
<meta name='description' content={description || SITE_METADATA.description} />
<script is:inline src='/assets/js/detect-theme.min.js' />
<script is:inline src='/assets/js/detect-theme.js'>
</script>
<slot></slot>

View File

@ -111,7 +111,6 @@ textarea {
-webkit-appearance: none;
font-family: var(--font-family-base);
padding: 8px 15px;
border: none;
border-radius: var(--border-radius-md);
background-color: var(--background-inputs-color);
font-size: var(--font-size-sm);