Skip to content

Commit

Permalink
Merge pull request #66 from ca057/11ty
Browse files Browse the repository at this point in the history
11ty
  • Loading branch information
ca057 authored Oct 22, 2024
2 parents 26a2fac + 950dead commit 2c01618
Show file tree
Hide file tree
Showing 48 changed files with 2,645 additions and 9,571 deletions.
5 changes: 0 additions & 5 deletions .astro/settings.json

This file was deleted.

76 changes: 76 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// import { bundle, browserslistToTargets, transform } from "lightningcss";
// import browserslist from "browserslist";
import pluginWebc from "@11ty/eleventy-plugin-webc";
import { Temporal } from "temporal-polyfill";

const environment =
process.env.ELEVENTY_RUN_MODE === "serve" || process.env.ELEVENTY_RUN_MODE === "watch" ? "development" : "production";

export default function (eleventyConfig) {
eleventyConfig.addPlugin(pluginWebc, {
components: ["src/**/_components/**/*.webc"],
});

eleventyConfig.addBundle("css");
// eleventyConfig.addTemplateFormats("css");
// eleventyConfig.addExtension("css", {
// outputFileExtension: "css",
// compile: async function (inputContent, inputPath) {
// let targets = browserslistToTargets(browserslist("> 0.2% and not dead")); // TOOD:

// return async () => {
// let { code, warnings } = bundle({
// filename: inputPath,
// minify: environment === "production",
// sourceMap: true,
// targets,
// drafts: { nesting: true },
// });

// if (warnings.length > 0) {
// console.warn(warnings);
// }

// return code;
// };
// },
// });

// eleventyConfig.addFilter("cssmin", function (input) {
// const { code, warnings } = transform({
// // TODO:
// code: Buffer.from(input),
// minify: environment === "production",
// sourceMap: true,
// });

// if (warnings.length > 0) {
// console.warn(warnings);
// }

// return code.toString("utf-8");
// });
//
//
eleventyConfig.addPassthroughCopy("src/fonts");
eleventyConfig.addPassthroughCopy("src/favicon");

eleventyConfig.addGlobalData("coffees", async () => {
// TODO: load this from externally

if (environment === "development") {
const now = Temporal.PlainDate.from(Temporal.Now.plainDateISO());

return Array.from({ length: 3451 }).map((_, i) => ({
day: now.subtract({ days: i }),
}));
}
});

return {
dir: {
input: "src",
output: "dist",
},
};
}
29 changes: 29 additions & 0 deletions .github/workflows/production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Deploy"
on:
push:
branches: [main]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.9.0"
cache: "npm"
cache-dependency-path: "package-lock.json"
- run: |
npm ci
npm run build
- name: Deploy
uses: burnett01/rsync-deployments@7
with:
switches: "-avrh --delete"
path: "dist/"
remote_path: "/var/www/virtual/${{ vars.SSH_USERNAME }}/html"
remote_host: "${{ vars.SSH_HOST }}"
remote_user: "${{ vars.SSH_USERNAME }}"
remote_key: "${{ secrets.SSH_PRIVATE_KEY }}"
- run: echo "deploy"
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
node_modules/
dist/
data/webpack.json
.env
.DS_Store
.vscode
9 changes: 9 additions & 0 deletions .zed/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Folder-specific settings
//
// For a full list of overridable settings, and general information on folder-specific settings,
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
{
"file_types": {
"HTML": ["webc"]
}
}
1 change: 1 addition & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- add robots.txt
4 changes: 0 additions & 4 deletions astro.config.mjs

This file was deleted.

Loading

0 comments on commit 2c01618

Please sign in to comment.