diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..844771f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_style = tab +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ddb744 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +content/feed/pretty-atom-feed.xsl linguist-vendored diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index f0ad682..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Deploy to GitHub Pages - -on: - # Trigger the workflow every time you push to the `main` branch - # Using a different branch name? Replace `main` with your branch’s name - push: - branches: main - - # Allows you to run this workflow manually from the Actions tab on GitHub. - workflow_dispatch: - -# Allow this job to clone the repo and create a page deployment -permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: 'pages' - cancel-in-progress: false - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: npm - - - name: Install dependencies - run: npm install --frozen-lockfile - - - name: Setup Pages - uses: actions/configure-pages@v3 - with: - static_site_generator: sveltekit - - - name: Build - run: npm run build - - - name: Upload Artifacts - uses: actions/upload-pages-artifact@v1 - with: - # this should match the `pages` option in your adapter-static options - path: 'build/' - - deploy: - needs: build - runs-on: ubuntu-latest - - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - steps: - - name: Deploy - id: deployment - uses: actions/deploy-pages@v1 diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..7aef331 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,48 @@ +# If you’d like to deploy this to GitHub pages, rename this +# file to `gh-pages.yml` and read the mini-tutorial on +# https://www.11ty.dev/docs/deployment/#deploy-an-eleventy-project-to-github-pages +name: Deploy to GitHub Pages + +on: + push: + branches: + - main + pull_request: + +jobs: + deploy: + runs-on: ubuntu-22.04 + permissions: + contents: write + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + steps: + - uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Cache npm + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }} + + - name: Cache Eleventy .cache + uses: actions/cache@v3 + with: + path: ./.cache + key: ${{ runner.os }}-eleventy-fetch-cache + + + - run: npm install + - run: npm run build-ghpages + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: github.ref == 'refs/heads/main' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./_site diff --git a/.gitignore b/.gitignore index 79518f7..4985d12 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,3 @@ -node_modules - -# Output -.output -.vercel -/.svelte-kit -/build - -# OS -.DS_Store -Thumbs.db - -# Env -.env -.env.* -!.env.example -!.env.test - -# Vite -vite.config.js.timestamp-* -vite.config.ts.timestamp-* +_site/ +node_modules/ +.cache diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/.npmrc b/.npmrc deleted file mode 100644 index b6f27f1..0000000 --- a/.npmrc +++ /dev/null @@ -1 +0,0 @@ -engine-strict=true diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..209e3ef --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20 diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index ab78a95..0000000 --- a/.prettierignore +++ /dev/null @@ -1,4 +0,0 @@ -# Package Managers -package-lock.json -pnpm-lock.yaml -yarn.lock diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 9573023..0000000 --- a/.prettierrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "useTabs": true, - "singleQuote": true, - "trailingComma": "none", - "printWidth": 100, - "plugins": ["prettier-plugin-svelte"], - "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] -} diff --git a/LICENSE b/LICENSE index dda0374..5027c0d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 Robert Klink +Copyright (c) 2017–2024 Zach Leatherman @zachleat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index df95a50..9edc23d 100644 --- a/README.md +++ b/README.md @@ -2,32 +2,6 @@ Repo for my personal website -## Developing - -Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: - -```bash -npm run dev - -# or start the server and open the app in a new browser tab -npm run dev -- --open -``` - -## Building - -To create a production version of your app: - -```bash -npm run build -``` - -You can preview the production build with `npm run preview`. - -> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. - ## TODO -* Use Svelte/Vue/whatever for webapp - * Make window reusable in framework - * Make taskbar - * Add blog, aboutme, 31x88 collection, etc +* Add blog, aboutme, 31x88 collection, etc diff --git a/_config/filters.js b/_config/filters.js new file mode 100644 index 0000000..3f247fb --- /dev/null +++ b/_config/filters.js @@ -0,0 +1,43 @@ +import { DateTime } from "luxon"; + +export default function(eleventyConfig) { + eleventyConfig.addFilter("readableDate", (dateObj, format, zone) => { + // Formatting tokens for Luxon: https://moment.github.io/luxon/#/formatting?id=table-of-tokens + return DateTime.fromJSDate(dateObj, { zone: zone || "utc" }).toFormat(format || "dd LLLL yyyy"); + }); + + eleventyConfig.addFilter("htmlDateString", (dateObj) => { + // dateObj input: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string + return DateTime.fromJSDate(dateObj, { zone: "utc" }).toFormat('yyyy-LL-dd'); + }); + + // Get the first `n` elements of a collection. + eleventyConfig.addFilter("head", (array, n) => { + if(!Array.isArray(array) || array.length === 0) { + return []; + } + if( n < 0 ) { + return array.slice(n); + } + + return array.slice(0, n); + }); + + // Return the smallest number argument + eleventyConfig.addFilter("min", (...numbers) => { + return Math.min.apply(null, numbers); + }); + + // Return the keys used in an object + eleventyConfig.addFilter("getKeys", target => { + return Object.keys(target); + }); + + eleventyConfig.addFilter("filterTagList", function filterTagList(tags) { + return (tags || []).filter(tag => ["all", "posts"].indexOf(tag) === -1); + }); + + eleventyConfig.addFilter("sortAlphabetically", strings => + (strings || []).sort((b, a) => b.localeCompare(a)) + ); +}; diff --git a/_data/eleventyDataSchema.js b/_data/eleventyDataSchema.js new file mode 100644 index 0000000..bfef5d5 --- /dev/null +++ b/_data/eleventyDataSchema.js @@ -0,0 +1,17 @@ +import { z } from "zod"; +import { fromZodError } from 'zod-validation-error'; + +// Draft content, validate `draft` front matter +export default function() { + return function(data) { + // Note that drafts may be skipped in a preprocessor (see eleventy.config.js) + // when doing a standard build (not --serve or --watch) + let result = z.object({ + draft: z.boolean().or(z.undefined()), + }).safeParse(data); + + if(result.error) { + throw fromZodError(result.error); + } + } +} diff --git a/_data/metadata.js b/_data/metadata.js new file mode 100644 index 0000000..38e306d --- /dev/null +++ b/_data/metadata.js @@ -0,0 +1,11 @@ +export default { + title: "Rombertus", + url: "https://r0mbertus.github.io/", + language: "en", + description: "Welcome 2 my website, you'll find ?? and ?!.", + author: { + name: "Robert Klink", + email: "roberthklink@gmail.com", + url: "https://r0mbertus.github.io/about-me/" + } +} diff --git a/_includes/layouts/base.njk b/_includes/layouts/base.njk new file mode 100644 index 0000000..f16a4b5 --- /dev/null +++ b/_includes/layouts/base.njk @@ -0,0 +1,81 @@ + + +
+ + +
+
+ {{ post.url }}{% endif %}
+
+
+
diff --git a/content/about.md b/content/about.md
new file mode 100644
index 0000000..b688f9c
--- /dev/null
+++ b/content/about.md
@@ -0,0 +1,12 @@
+---js
+const eleventyNavigation = {
+ key: "About",
+ order: 3
+}
+
+const title = "About"
+---
+
+
+
+This is me...
diff --git a/content/blog.njk b/content/blog.njk
new file mode 100644
index 0000000..964ee5f
--- /dev/null
+++ b/content/blog.njk
@@ -0,0 +1,11 @@
+---js
+const eleventyNavigation = {
+ key: "Blog",
+ order: 2
+};
+
+const title = "Blog"
+---
+
+{% set postslist = collections.posts %}
+{% include "postslist.njk" %}
diff --git a/content/blog/blog.11tydata.js b/content/blog/blog.11tydata.js
new file mode 100644
index 0000000..614f505
--- /dev/null
+++ b/content/blog/blog.11tydata.js
@@ -0,0 +1,6 @@
+export default {
+ tags: [
+ "posts"
+ ],
+ "layout": "layouts/post.njk",
+};
diff --git a/content/blog/firstpost.md b/content/blog/firstpost.md
new file mode 100644
index 0000000..9c2a630
--- /dev/null
+++ b/content/blog/firstpost.md
@@ -0,0 +1,8 @@
+---
+title: Welcome!
+description: Hiiii hello hello
+date: 2025-11-24
+tags: misc
+---
+
+Hello hello hi hi
diff --git a/content/content.11tydata.js b/content/content.11tydata.js
new file mode 100644
index 0000000..8b0bb8e
--- /dev/null
+++ b/content/content.11tydata.js
@@ -0,0 +1,3 @@
+export default {
+ layout: "layouts/home.njk",
+};
diff --git a/content/feed/.virtual b/content/feed/.virtual
new file mode 100644
index 0000000..0ee5e54
--- /dev/null
+++ b/content/feed/.virtual
@@ -0,0 +1 @@
+For RSS feed, Atom Feed, and JSON feed templates, see the plugin in eleventy.config.js
diff --git a/content/feed/pretty-atom-feed.xsl b/content/feed/pretty-atom-feed.xsl
new file mode 100644
index 0000000..6a1c4de
--- /dev/null
+++ b/content/feed/pretty-atom-feed.xsl
@@ -0,0 +1,89 @@
+
+
+This preview only shows titles, but the actual feed contains the full content.
+ +{{ morePosts }} more post{% if morePosts != 1 %}s{% endif %} can be found in the Blog.
+{% endif %} #} + +
+Nothing to see here yet...
+ +{# List every content page in the project #} +{# +{{ entry.url }}Under construction! Come back later
-It's me
-