Skip to content

Commit

Permalink
finish site layout
Browse files Browse the repository at this point in the history
  • Loading branch information
parker23b committed Sep 17, 2024
1 parent 98f19e1 commit a4da15c
Show file tree
Hide file tree
Showing 42 changed files with 7,362 additions and 1,944 deletions.
12 changes: 12 additions & 0 deletions .prettierrc.mjs
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",
},
},
],
};
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"prettier.documentSelectors": ["*.{astro, js, ts}"],
"css.customData": [".vscode/tailwind.json"]
}
55 changes: 55 additions & 0 deletions .vscode/tailwind.json
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"
}
]
}
]
}
59 changes: 53 additions & 6 deletions astro.config.mjs
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"] },
},
});
74 changes: 0 additions & 74 deletions bin/install.mjs

This file was deleted.

57 changes: 57 additions & 0 deletions integrations/pagefind.ts
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],
});
},
},
};
}
22 changes: 18 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,46 @@
"preview": "astro preview",
"astro": "astro"
},
"bin": {
"linaro-astro-template": "bin/install.mjs"
},
"dependencies": {
"@astrojs/check": "^0.6.0",
"@astrojs/mdx": "^2.2.4",
"@astrojs/sitemap": "^3.1.1",
"@astrojs/solid-js": "^4.4.1",
"@astrojs/tailwind": "^5.1.0",
"@auth/core": "^0.18.6",
"@biscuit-auth/biscuit-wasm": "^0.4.0",
"@cloudinary/url-gen": "^1.21.0",
"@fontsource/lato": "^5.0.17",
"@iconify-json/mdi": "^1.1.64",
"@solid-primitives/scheduled": "^1.4.3",
"@tailwindcss/typography": "^0.5.10",
"astro": "^4.5.9",
"astro-icon": "^1.1.0",
"astro-navbar": "^2.3.1",
"astro-pagefind": "^1.4.0",
"astro-seo": "^0.8.3",
"astro-sst": "^2.41.4",
"auth-astro": "^4.1.1",
"dayjs": "^1.11.13",
"marked": "^12.0.1",
"pagefind": "^1.1.0",
"remark": "^15.0.1",
"sharp": "^0.33.5",
"solid-icons": "^1.1.0",
"solid-js": "^1.8.22",
"sst": "^2.41.4",
"strip-markdown": "^6.0.0",
"tailwindcss": "^3.4.1",
"tw-elements": "^2.0.0",
"vanilla-cookieconsent": "^2.9.2"
},
"devDependencies": {
"ora": "^7.0.1",
"postcss": "^8.4.38",
"sass": "^1.69.5"
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.14.1",
"sass": "^1.69.5",
"tailwindcss-animated": "^1.1.2",
"typescript": "^5.6.2"
}
}
File renamed without changes
10 changes: 9 additions & 1 deletion src/assets/images/linaro-logo-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a4da15c

Please sign in to comment.