Skip to content

Commit

Permalink
Scaffold eleventy site
Browse files Browse the repository at this point in the history
  • Loading branch information
mraerino committed Jun 8, 2024
0 parents commit bb23124
Show file tree
Hide file tree
Showing 9 changed files with 2,351 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const CleanCSS = require("clean-css");
const yaml = require("js-yaml");

/**
* @template T
* @typedef {{
* [P in keyof T]?:
* T[P] extends (infer U)[] ? RecursivePartial<U>[] :
* T[P] extends object | undefined ? RecursivePartial<T[P]> :
* T[P];
* }} RecursivePartial<T>
*/

/**
* @typedef {import('@11ty/eleventy/src/UserConfig')} EleventyConfig
* @typedef {ReturnType<import('@11ty/eleventy/src/defaultConfig')>} EleventyReturnValue
* @type {(eleventyConfig: EleventyConfig) => RecursivePartial<EleventyReturnValue>}
*/
module.exports = function (config) {
config.addFilter("cssmin", function (code) {
return new CleanCSS({}).minify(code).styles;
});

config.addDataExtension("yaml", (contents) => yaml.load(contents));

config.addGlobalData("layout", "base.njk");

return {
dir: {
input: "pages",
includes: "../layouts",
data: "../data",
output: "dist",
},
};
};
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/

/dist/
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Website des Chaosdorf

## Lokal starten

Um deine Änderungen an der Seite lokal anzusehen, mache folgendes:

- [Installiere NodeJS](https://nodejs.org/en/download/)
- Installiere das Projekt: `npm install`
- Starte Eleventy: `npm start`
8 changes: 8 additions & 0 deletions data/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
site_name: Chaosdorf (CCC Düsseldorf)
title: Chaosdorf
description: Hier fehlt ein Text.
contact:
email: [email protected]
mastodon: https://chaos.social/@chaosdorf
github: https://github.com/chaosdorf
youtube: https://www.youtube.com/channel/UCdiSBf0peR7DQghwHmgFvgQ
33 changes: 33 additions & 0 deletions layouts/base.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="{{ eleventy.generator }}">

{% set title %}{{ title | default(meta.title) }}{% endset %}
{% set description %}{{ description | default(meta.description) }}{% endset %}
<title>{{ title }}</title>
<meta name="description" content="{{ description }}">
<meta property="og:locale" content="de">
<meta property="og:site_name" content="{{ meta.site_name }}">
<meta property="og:title" content="{{ title }}">
<meta property="og:url" content="{{ page.url }}">
<meta property="og:type" content="website">
<meta property="og:description" content="{{ description }}">

<link rel="me" href="mailto:{{ meta.contact.mail }}" />
<link rel="me" href="{{ meta.contact.mastodon }}" />

{% set css %}
{% include "./style.css" %}
{% endset %}
<style>
{{ css | cssmin | safe }}
</style>
</head>
<body>
{{ content | safe }}
</body>
</html>
12 changes: 12 additions & 0 deletions layouts/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
body {
font-family: sans-serif;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 98vh;
background-color: white;
background-image: radial-gradient(rgb(189, 189, 189) 1px, white 1px);
background-size: 20px 20px;
font-weight: 100;
}
Loading

0 comments on commit bb23124

Please sign in to comment.