-
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.
Merge pull request #66 from ca057/11ty
11ty
- Loading branch information
Showing
48 changed files
with
2,645 additions
and
9,571 deletions.
There are no files selected for viewing
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,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", | ||
}, | ||
}; | ||
} |
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,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" |
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,6 +1,5 @@ | ||
node_modules/ | ||
dist/ | ||
data/webpack.json | ||
.env | ||
.DS_Store | ||
.vscode |
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,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"] | ||
} | ||
} |
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 @@ | ||
- add robots.txt |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.