Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
content/feed/pretty-atom-feed.xsl linguist-vendored
65 changes: 0 additions & 65 deletions .github/workflows/deploy.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -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
24 changes: 3 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
Empty file added .nojekyll
Empty file.
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
4 changes: 0 additions & 4 deletions .prettierignore

This file was deleted.

8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
28 changes: 1 addition & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
43 changes: 43 additions & 0 deletions _config/filters.js
Original file line number Diff line number Diff line change
@@ -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))
);
};
17 changes: 17 additions & 0 deletions _data/eleventyDataSchema.js
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
11 changes: 11 additions & 0 deletions _data/metadata.js
Original file line number Diff line number Diff line change
@@ -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/"
}
}
81 changes: 81 additions & 0 deletions _includes/layouts/base.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<!doctype html>
<html lang="{{ metadata.language }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title or metadata.title }}</title>
<meta name="description" content="{{ description or metadata.description }}">
<link rel="alternate" href="/feed/feed.xml" type="application/atom+xml" title="{{ metadata.title }}">
<link rel="icon" href="{{ '/img/r-icon.gif' | url | replace('/content/', '/') }}" type="image/gif">

{#- Uncomment this if you’d like folks to know that you used Eleventy to build your site! #}
{#- <meta name="generator" content="{{ eleventy.generator }}"> #}

{#-
Plain-text bundles are provided via the `eleventy-plugin-bundle` plugin:
1. CSS:
* Add to a per-page bundle using `{% css %}{% endcss %}`
* Retrieve bundle content using `{% getBundle "css" %}` or `{% getBundleFileUrl "css" %}`
2. Or for JavaScript:
* Add to a per-page bundle using `{% js %}{% endjs %}`
* Retrieve via `{% getBundle "js" %}` or `{% getBundleFileUrl "js" %}`
3. Learn more: https://github.com/11ty/eleventy-plugin-bundle
#}

<style>{% include "node_modules/98.css/dist/98.css" %}</style>
<style>{% include "css/index.css" %}</style>
<style>{% getBundle "css" %}</style>
<script type="module">{% include "node_modules/@zachleat/heading-anchors/heading-anchors.js" %}</script>
</head>
<body class="desktop">
<a href="#main" id="skip-link" class="visually-hidden">Skip to main content</a>

<div class="desktop-shell">
<header class="desktop-banner">
<a href="/" class="desktop-banner__logo">
<img src="{{ '/img/big-logo.gif' | url | replace('/content/', '/') }}" alt="{{ metadata.title }} logo" loading="lazy" decoding="async">
</a>
</header>

<div class="window site-window">
<div class="title-bar">
<div class="title-bar-text">{{ title or metadata.title }}</div>
<div class="title-bar-controls">
<button type="button" aria-label="Minimize"></button>
<button type="button" aria-label="Maximize" disabled></button>
<button type="button" aria-label="Close"></button>
</div>
</div>

<div class="window-body">
<main id="main" class="window-content">
<div class="sunken-panel content-panel">
<heading-anchors>
{{ content | safe }}
</heading-anchors>
</div>
</main>
</div>

<footer class="status-bar" role="contentinfo">
<p class="status-bar-field">
<em>Built with <a href="https://www.11ty.dev/">{{ eleventy.generator }}</a></em>
</p>
</footer>
</div>
</div>

{#- Taskbar navigation mimics the Windows 98 shell #}
<nav class="taskbar" aria-label="Taskbar">
<a href="/" class="taskbar__start">Start</a>
<ul class="taskbar__items">
{%- for entry in collections.all | eleventyNavigation %}
<li class="taskbar__item"><a class="taskbar__link" href="{{ entry.url }}"{% if entry.url == page.url %} aria-current="page"{% endif %}>{{ entry.title }}</a></li>
{%- endfor %}
</ul>
</nav>

<!-- This page `{{ page.url }}` was built on {% currentBuildDate %} -->
<script type="module" src="{% getBundleFileUrl "js" %}"></script>
</body>
</html>
5 changes: 5 additions & 0 deletions _includes/layouts/home.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: layouts/base.njk
---

{{ content | safe }}
Loading