-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
7,362 additions
and
1,944 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** @type {import("prettier").Config} */ | ||
export default { | ||
plugins: ["prettier-plugin-astro"], | ||
overrides: [ | ||
{ | ||
files: "*.astro", | ||
options: { | ||
parser: "astro", | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"prettier.documentSelectors": ["*.{astro, js, ts}"], | ||
"css.customData": [".vscode/tailwind.json"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"version": 1.1, | ||
"atDirectives": [ | ||
{ | ||
"name": "@tailwind", | ||
"description": "Use the `@tailwind` directive to insert Tailwind's `base`, `components`, `utilities` and `screens` styles into your CSS.", | ||
"references": [ | ||
{ | ||
"name": "Tailwind Documentation", | ||
"url": "https://tailwindcss.com/docs/functions-and-directives#tailwind" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "@apply", | ||
"description": "Use the `@apply` directive to inline any existing utility classes into your own custom CSS. This is useful when you find a common utility pattern in your HTML that you’d like to extract to a new component.", | ||
"references": [ | ||
{ | ||
"name": "Tailwind Documentation", | ||
"url": "https://tailwindcss.com/docs/functions-and-directives#apply" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "@responsive", | ||
"description": "You can generate responsive variants of your own classes by wrapping their definitions in the `@responsive` directive:\n```css\n@responsive {\n .alert {\n background-color: #E53E3E;\n }\n}\n```\n", | ||
"references": [ | ||
{ | ||
"name": "Tailwind Documentation", | ||
"url": "https://tailwindcss.com/docs/functions-and-directives#responsive" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "@screen", | ||
"description": "The `@screen` directive allows you to create media queries that reference your breakpoints by **name** instead of duplicating their values in your own CSS:\n```css\n@screen sm {\n /* ... */\n}\n```\n…gets transformed into this:\n```css\n@media (min-width: 640px) {\n /* ... */\n}\n```\n", | ||
"references": [ | ||
{ | ||
"name": "Tailwind Documentation", | ||
"url": "https://tailwindcss.com/docs/functions-and-directives#screen" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "@variants", | ||
"description": "Generate `hover`, `focus`, `active` and other **variants** of your own utilities by wrapping their definitions in the `@variants` directive:\n```css\n@variants hover, focus {\n .btn-brand {\n background-color: #3182CE;\n }\n}\n```\n", | ||
"references": [ | ||
{ | ||
"name": "Tailwind Documentation", | ||
"url": "https://tailwindcss.com/docs/functions-and-directives#variants" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,61 @@ | ||
import { defineConfig } from "astro/config"; | ||
import sitemap from "@astrojs/sitemap"; | ||
import tailwind from "@astrojs/tailwind"; | ||
import solidJs from "@astrojs/solid-js"; | ||
// import pagefind from "integrations/pagefind"; | ||
import { loadEnv } from "vite"; | ||
import icon from "astro-icon"; | ||
|
||
import sitemap from "@astrojs/sitemap"; | ||
const { IS_PUBLIC, PRE_BUILD, CUSTOM_DOMAIN } = loadEnv( | ||
process.env.NODE_ENV, | ||
process.cwd(), | ||
"", | ||
); | ||
const is_public = IS_PUBLIC === "true"; | ||
const is_pre_build = PRE_BUILD === "true"; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
output: "static", | ||
integrations: [icon({iconDir: "src/assets/icons"}), solidJs(), tailwind({ | ||
applyBaseStyles: false | ||
}), sitemap()] | ||
}); | ||
...(is_public | ||
? { | ||
output: "static", | ||
integrations: [ | ||
icon({ iconDir: "src/assets/icons" }), | ||
solidJs(), | ||
tailwind({ | ||
applyBaseStyles: false, | ||
}), | ||
sitemap(), | ||
// pagefind({ | ||
// is_pre_build: is_pre_build, | ||
// is_public: is_public, | ||
// }), | ||
], | ||
} | ||
: {}), | ||
site: `https://${CUSTOM_DOMAIN}`, | ||
cacheDir: "./cache", | ||
compressHTML: true, | ||
image: { | ||
remotePatterns: [ | ||
{ | ||
protocol: "https", | ||
}, | ||
], | ||
// service: { | ||
// entrypoint: "astro/assets/services/sharp", | ||
// config: { | ||
// limitInputPixels: false, | ||
// }, | ||
// }, | ||
}, | ||
// build: { | ||
// rollupOptions: { | ||
// external: ["/pagefind/pagefind.js"], | ||
// }, | ||
// redirects: true, | ||
// }, | ||
vite: { | ||
optimizeDeps: { exclude: ["auth:config"] }, | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import type { AstroIntegration } from "astro"; | ||
import { execSync } from "child_process"; | ||
import sirv from "sirv"; | ||
|
||
export default function pagefind({ | ||
is_pre_build, | ||
is_public, | ||
}: { | ||
is_pre_build: boolean; | ||
is_public: boolean; | ||
}): AstroIntegration { | ||
let outDir: string; | ||
if (is_pre_build) return { name: "pagefind", hooks: {} }; | ||
return { | ||
name: "pagefind", | ||
hooks: { | ||
"astro:config:setup": ({ config, logger }) => { | ||
outDir = is_public ? "./dist" : "./dist_prebuild/dist/client"; | ||
}, | ||
"astro:server:setup": ({ server, logger }) => { | ||
if (!outDir) { | ||
logger.warn( | ||
"astro-pagefind couldn't reliably determine the output directory. Search assets will not be served.", | ||
); | ||
return; | ||
} | ||
logger.warn(outDir); | ||
const serve = sirv(outDir, { | ||
dev: true, | ||
etag: true, | ||
}); | ||
server.middlewares.use((req, res, next) => { | ||
if (req.url?.startsWith("/pagefind/")) { | ||
serve(req, res, next); | ||
} else { | ||
next(); | ||
} | ||
}); | ||
}, | ||
"astro:build:done": ({ logger }) => { | ||
logger.warn(outDir); | ||
|
||
if (!outDir) { | ||
logger.warn( | ||
"astro-pagefind couldn't reliably determine the output directory. Search index will not be built.", | ||
); | ||
return; | ||
} | ||
|
||
const cmd = `npx pagefind --site "${outDir}"`; | ||
execSync(cmd, { | ||
stdio: [process.stdin, process.stdout, process.stderr], | ||
}); | ||
}, | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.