Rewrite for Kirby

This commit is contained in:
Marcel Kapfer 2024-03-17 22:34:51 +01:00
parent 07201d05de
commit f854d60108
Signed by: mmk2410
GPG key ID: CADE6F0C09F21B09
116 changed files with 4156 additions and 8875 deletions

View file

@ -1,35 +0,0 @@
;; Package configuration
(package-initialize)
(add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/") t)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(setq-default load-prefer-newer t)
(setq-default package-enable-at-startup nil)
(package-refresh-contents)
(package-install 'use-package)
(setq package-user-dir (expand-file-name "./.packages"))
(add-to-list 'load-path package-user-dir)
(require 'use-package)
(setq use-package-always-ensure t)
;; Install and configure necessary packages
(use-package org
:pin gnu
:config
(setq org-todo-keywords '((sequence
"TODO(t!)" "NEXT(n!)" "STARTED(a!)" "WAIT(w@/!)" "SOMEDAY(s)"
"|" "DONE(d!)" "CANCELLED(c@/!)"))))
(use-package ox-hugo
:after org)
;; Export blog posts
(defun mmk2410/export (file)
(save-excursion
(find-file file)
(org-hugo-export-wim-to-md t)))
(mapcar (lambda (file) (mmk2410/export file))
(directory-files (expand-file-name "./content-org/") t "\\.org$"))

25
.devcontainer/Dockerfile Normal file
View file

@ -0,0 +1,25 @@
FROM php:8.2-apache
# Add composer
COPY --from=composer /usr/bin/composer /usr/bin/composer
# Add PHP extension installer helper
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
# Install system dependencies
RUN apt-get update &&\
apt-get install -y git unzip &&\
apt-get clean && rm -rf /var/lib/apt/lists/*
# Install GD PHP Extension
RUN install-php-extensions gd intl zip
# Enable support for .htacces files
COPY vhost.conf /etc/apache2/sites-available/000-default.conf
# Enable mode_rewrite and mod_headers
RUN a2enmod rewrite headers
# Set UID of web server user to the same as the user on the host maching
# This enables the webserver to create and write files, e.g. sessions.
RUN usermod -u 1000 www-data

View file

@ -0,0 +1,14 @@
version: "3.11"
services:
app:
build: .
ports:
- 8080:80
volumes:
- ../:/var/www/html
mail:
image: axllent/mailpit
ports:
- 8081:8025

11
.devcontainer/vhost.conf Normal file
View file

@ -0,0 +1,11 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory /var/www/html>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

21
.editorconfig Normal file
View file

@ -0,0 +1,21 @@
[*.{css,scss,less,js,json,ts,sass,html,hbs,mustache,phtml,html.twig,md,yml}]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
indent_size = 4
trim_trailing_whitespace = false
[site/templates/**.php]
indent_size = 2
[site/snippets/**.php]
indent_size = 2
[package.json,.{babelrc,editorconfig,eslintrc,lintstagedrc,stylelintrc}]
indent_style = space
indent_size = 2

74
.gitignore vendored
View file

@ -1,4 +1,70 @@
public/
content/
resources/
/.hugo_build.lock
# System files
# ------------
Icon
.DS_Store
# Temporary files
# ---------------
/media/*
!/media/index.html
# Lock files
# ---------------
.lock
# Editors
# (sensitive workspace files)
# ---------------------------
*.sublime-workspace
/.vscode
/.idea
# -------------SECURITY-------------
# NEVER publish these files via Git!
# -------------SECURITY-------------
# Cache Files
# ---------------
/site/cache/*
!/site/cache/index.html
# Accounts
# ---------------
/site/accounts/*
!/site/accounts/index.html
# Sessions
# ---------------
/site/sessions/*
!/site/sessions/index.html
# License
# ---------------
/site/config/.license
# Content
# ---------------
/content
# NodeJS
# ---------------
/node_modules
# Composer
# ---------------
/vendor
# Kirby
# ---------------
/kirby

View file

@ -1,24 +0,0 @@
variables:
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- apk add --no-cache openssh tzdata
- cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_KNOWN_HOSTS" | tr -d '\r' >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
build:
image: silex/emacs:27.2-alpine-ci
stage: build
script:
- emacs -Q --script .build/ox-hugo-build.el
- apk add --no-cache hugo rsync
- hugo
- rsync --archive --verbose --chown=gitlab-ci:www-data --delete --progress -e"ssh -p "$SSH_PORT"" public/ "$SSH_USER"@mmk2410.org:/var/www/mmk2410.org/
artifacts:
paths:
- public

3
.gitmodules vendored
View file

@ -1,3 +0,0 @@
[submodule "nextDESIGN"]
path = themes/nextDESIGN
url = ../nextDESIGN

67
.htaccess Normal file
View file

@ -0,0 +1,67 @@
# Kirby .htaccess
# revision 2023-07-22
# rewrite rules
<IfModule mod_rewrite.c>
# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
RewriteEngine on
# make sure to set the RewriteBase correctly
# if you are running the site in a subfolder;
# otherwise links or the entire site will break.
#
# If your homepage is http://yourdomain.com/mysite,
# set the RewriteBase to:
#
# RewriteBase /mysite
# In some environments it's necessary to
# set the RewriteBase to:
#
# RewriteBase /
# block files and folders beginning with a dot, such as .git
# except for the .well-known folder, which is used for Let's Encrypt and security.txt
RewriteRule (^|/)\.(?!well-known\/) index.php [L]
# block all files in the content folder from being accessed directly
RewriteRule ^content/(.*) index.php [L]
# block all files in the site folder from being accessed directly
RewriteRule ^site/(.*) index.php [L]
# block direct access to Kirby and the Panel sources
RewriteRule ^kirby/(.*) index.php [L]
# make site links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]
</IfModule>
# pass the Authorization header to PHP
SetEnvIf Authorization "(.+)" HTTP_AUTHORIZATION=$1
# compress text file responses
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
# set security headers in all responses
<IfModule mod_headers.c>
# serve files as plain text if the actual content type is not known
# (hardens against attacks from malicious file uploads)
Header set Content-Type "text/plain" "expr=-z %{CONTENT_TYPE}"
Header set X-Content-Type-Options "nosniff"
</IfModule>

View file

@ -1,5 +1,16 @@
# mmk2410.org
This is the source code of my website. It uses [Hugo](https://gohugo.io/) with [ox-hugo](https://ox-hugo.scripter.co/).
Kirby implementation of the website running at mmk2410.org
Visit it at [mmk2410.org](https://mmk2410.org)!
The site uses nextDESGIN 9 as a theme.
The content is not part of this Git repository, at least not at the beginnng.
## Asset Building
Running the site requires buidling and compiling assets. This is done using [esbuild](https://esbuild.github.io/).
```bash
npm install
npm run build
```

View file

@ -1,6 +0,0 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

9
assets/build/main.css Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View file

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

View file

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

View file

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 112 KiB

View file

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View file

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View file

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

80
assets/src/fonts.css Normal file
View file

@ -0,0 +1,80 @@
/**************
* Raleway
**************/
/* raleway-regular - latin */
@font-face {
font-family: 'Raleway';
font-style: normal;
font-weight: 400;
src: local('Raleway'),
local('Raleway-Regular'),
url('../fonts/raleway-v14-latin-regular.woff2') format('woff2');
}
/* raleway-italic - latin */
@font-face {
font-family: 'Raleway';
font-style: italic;
font-weight: 400;
src: local('Raleway Italic'),
local('Raleway-Italic'),
url('../fonts/raleway-v14-latin-italic.woff2') format('woff2');
}
/* raleway-700 - latin */
@font-face {
font-family: 'Raleway';
font-style: normal;
font-weight: 700;
src: local('Raleway Bold'),
local('Raleway-Bold'),
url('../fonts/raleway-v14-latin-700.woff2') format('woff2');
}
/* raleway-700italic - latin */
@font-face {
font-family: 'Raleway';
font-style: italic;
font-weight: 700;
src: local('Raleway Bold Italic'),
local('Raleway-BoldItalic'),
url('../fonts/raleway-v14-latin-700italic.woff2') format('woff2');
}
/**************
* JetBrains Mono
**************/
/* JetBrains Mono Regular */
@font-face {
font-family: 'JetBrains Mono';
font-style: normal;
font-weight: 400;
src: local('JetBrains Mono'),
url('../fonts/JetBrainsMono-Regular.woff2') format('woff2');
}
/* JetBrains Mono Regular Italic */
@font-face {
font-family: 'JetBrains Mono';
font-style: italic;
font-weight: 400;
src: local('JetBrains Mono Italic'),
url('../fonts/JetBrainsMono-RegularItalic.woff2') format('woff2');
}
/* JetBrains Mono Bold */
@font-face {
font-family: 'JetBrains Mono';
font-style: normal;
font-weight: 700;
src: local('JetBrains Mono Bold'),
url('../fonts/JetBrainsMono-Bold.woff2') format('woff2');
}
/* JetBrains Mono Bold Italic italic */
@font-face {
font-family: 'JetBrains Mono';
font-style: italic;
font-weight: 700;
src: local('JetBrains Mono Bold Italic'),
url('../fonts/JetBrainsMono-BoldItalic.woff2') format('woff2');
}

View file

@ -0,0 +1,177 @@
/*!
Theme: Monokai
Author: Wimer Hazenberg (http://www.monokai.nl)
License: ~ MIT (or more permissive) [via base16-schemes-source]
Maintainer: @highlightjs/core-team
Version: 2021.09.0
*/
/*
WARNING: DO NOT EDIT THIS FILE DIRECTLY.
This theme file was auto-generated from the Base16 scheme monokai
by the Highlight.js Base16 template builder.
- https://github.com/highlightjs/base16-highlightjs
*/
/*
base00 #272822 Default Background
base01 #383830 Lighter Background (Used for status bars, line number and folding marks)
base02 #49483e Selection Background
base03 #75715e Comments, Invisibles, Line Highlighting
base04 #a59f85 Dark Foreground (Used for status bars)
base05 #f8f8f2 Default Foreground, Caret, Delimiters, Operators
base06 #f5f4f1 Light Foreground (Not often used)
base07 #f9f8f5 Light Background (Not often used)
base08 #f92672 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted
base09 #fd971f Integers, Boolean, Constants, XML Attributes, Markup Link Url
base0A #f4bf75 Classes, Markup Bold, Search Text Background
base0B #a6e22e Strings, Inherited Class, Markup Code, Diff Inserted
base0C #a1efe4 Support, Regular Expressions, Escape Characters, Markup Quotes
base0D #66d9ef Functions, Methods, Attribute IDs, Headings
base0E #ae81ff Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #cc6633 Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/
pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}
code.hljs {
padding: 3px 5px;
}
.hljs {
color: #f8f8f2;
background: #272822;
}
.hljs::selection,
.hljs ::selection {
background-color: #49483e;
color: #f8f8f2;
}
/* purposely do not highlight these things */
.hljs-formula,
.hljs-params,
.hljs-property
{}
/* base03 - #75715e - Comments, Invisibles, Line Highlighting */
.hljs-comment {
color: #75715e;
}
/* base04 - #a59f85 - Dark Foreground (Used for status bars) */
.hljs-tag {
color: #a59f85;
}
/* base05 - #f8f8f2 - Default Foreground, Caret, Delimiters, Operators */
.hljs-subst,
.hljs-punctuation,
.hljs-operator {
color: #f8f8f2;
}
.hljs-operator {
opacity: 0.7;
}
/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */
.hljs-bullet,
.hljs-variable,
.hljs-template-variable,
.hljs-selector-tag,
.hljs-name,
.hljs-deletion {
color: #f92672;
}
/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */
.hljs-symbol,
.hljs-number,
.hljs-link,
.hljs-attr,
.hljs-variable.constant_,
.hljs-literal {
color: #fd971f;
}
/* base0A - Classes, Markup Bold, Search Text Background */
.hljs-title,
.hljs-class .hljs-title,
.hljs-title.class_
{
color: #f4bf75;
}
.hljs-strong {
font-weight:bold;
color: #f4bf75;
}
/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */
.hljs-code,
.hljs-addition,
.hljs-title.class_.inherited__,
.hljs-string {
color: #a6e22e;
}
/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */
.hljs-built_in,
.hljs-doctag, /* guessing */
.hljs-quote,
.hljs-keyword.hljs-atrule,
.hljs-regexp {
color: #a1efe4;
}
/* base0D - Functions, Methods, Attribute IDs, Headings */
.hljs-function .hljs-title,
.hljs-attribute,
.ruby .hljs-property,
.hljs-title.function_,
.hljs-section {
color: #66d9ef;
}
/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */
.hljs-type,
/* .hljs-selector-id, */
/* .hljs-selector-class, */
/* .hljs-selector-attr, */
/* .hljs-selector-pseudo, */
.hljs-template-tag,
.diff .hljs-meta,
.hljs-keyword {
color: #ae81ff;
}
.hljs-emphasis {
color: #ae81ff;
font-style: italic;
}
/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?> */
.hljs-meta,
/*
prevent top level .keyword and .string scopes
from leaking into meta by accident
*/
.hljs-meta .hljs-keyword,
.hljs-meta .hljs-string
{
color: #cc6633;
}
.hljs-meta .hljs-keyword,
/* for v10 compatible themes */
.hljs-meta-keyword {
font-weight: bold;
}

433
assets/src/main.css Normal file
View file

@ -0,0 +1,433 @@
@import "normalize.css";
@import "fonts.css";
@import "highlight-monokai.css";
/* nextDESIGN v9
*
* nextDESIGN is a personal web design for mmk2410.org.
* The current version (v9) is focused in simplicity and minimalism.
*
* 2020-2022 © Marcel Kapfer <opensource@mmk2410.org>
* Licensed under the MIT License
*/
/***************
* Variables
***************/
:root {
--c-bg: #fafafa;
--c-bg-inv: #333;
--c-bg-main: #fff;
--c-bg-main-inv: #222;
--c-primary: #4d3c9b;
--c-bg-category: #4d3c9b;
--c-primary-inv: #ad9bff;
--c-bg-category-inv: #755bf0;
--c-bg-tag: #8171c8;
--c-bg-tag-inv: #a49ccc;
--c-font: #333;
--c-font-inv: #fafafa;
--c-btn-font: var(--c-font);
--c-btn-bg: var(--c-bg-category);
--c-btn-shadow: #aaa;
--c-btn-shadow-inv: #000;
--s-content: 800px;
--s-nav-title: 36px;
--s-border: 2px;
--s-border-radius: 2px;
--s-comment-margin-top: 60px;
--s-font-size: 18px;
--p-box-shadow: 1px 1px 5px #888;
}
html {
font-size: var(--s-font-size);
}
body {
background-color: var(--c-bg);
color: var(--c-font);
font-family: "Raleway", sans-serif;
line-height: 1.5;
@media (prefers-color-scheme: dark) {
background-color: var(--c-bg-inv);
color: var(--c-font-inv);
}
}
body > header {
align-items: center;
color: var(--c-font);
display: flex;
justify-content: space-between;
padding: 20px 40px;
#title {
color: var(--c-font);
font-size: var(--s-nav-title);
font-weight: 700;
text-decoration: underline;
text-decoration-color: var(--c-primary);
text-decoration-thickness: 5px;
}
& a {
color: var(--c-primary);
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
& nav {
display: inline;
& a {
text-transform: capitalize;
padding: 5px 6px;
display: inline-block;
&:hover {
text-decoration: none;
&:after {
width: 100%;
background: var(--c-primary);
}
}
&:after {
content: "";
display: block;
margin: auto;
height: 2px;
width: 0;
background: 0 0;
transition: width .25s ease, background-color .25s ease;
}
}
& ul {
margin: 0;
padding: 0;
float: right;
& li {
display: inline;
&:last-child {
padding-right: 0;
}
}
}
}
.show-menu {
display: none;
margin-top: 10px;
padding: 10px;
text-align: center;
width: 100%;
color: var(--c-primary);
font-weight: bold;
text-transform: uppercase;
@media (prefers-color-scheme: dark) {
color: var(--c-primary-inv);
}
}
& input[type=checkbox] {
display: none
}
@media screen and (max-width: 1100px) {
border-radius: initial;
flex-direction: column;
background: var(--c-bg-main);
padding-bottom: 0;
& nav {
display: none;
text-align: center;
width: 100%;
& ul {
float: unset;
& li {
display: block;
padding: 0;
& a {
display: block;
padding: 10px 0;
}
}
}
}
.show-menu {
display: block;
}
& input[type=checkbox]:checked ~ nav {
display: block;
}
}
@media (prefers-color-scheme: dark) {
background: var(--c-bg-inv);
& a {
color: var(--c-primary-inv);
}
#title {
color: var(--c-font-inv);
text-decoration-color: var(--c-primary-inv);
}
& nav {
& a {
&:hover {
&:after {
background: var(--c-primary-inv);
}
}
}
}
}
}
main {
background-color: var(--c-bg-main);
border: solid var(--s-border) var(--c-primary);
border-radius: 25px;
box-shadow: var(--p-box-shadow);
margin: 50px auto 100px;
max-width: var(--s-content);
padding: 20px 60px 80px;
@media (prefers-color-scheme: dark) {
background-color: var(--c-bg-main-inv);
box-shadow: none;
}
& article {
margin: 40px 0;
}
& h1, & h2 {
font-size: 3rem;
margin: 20px 0 0;
padding: 0;
text-decoration: underline;
text-decoration-color: var(--c-primary);
text-decoration-thickness: 4px;
@media (prefers-color-scheme: dark) {
text-decoration-color: var(--c-primary-inv);
}
}
& h2 {
font-size: 2rem;
margin: 40px 0 0;
text-decoration-thickness: 3px;
& a {
color: var(--c-font);
text-decoration-color: var(--c-primary);
@media (prefers-color-scheme: dark) {
color: var(--c-font-inv);
text-decoration-color: var(--c-primary-inv);
}
&:hover {
text-decoration: none;
}
}
}
& h3 {
font-size: 1.3rem;
}
& h4 {
font-size: 1.1rem;
}
& .gallery {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
}
& figure {
margin: 0;
& img {
width: 100%;
border-radius: 20px;
}
}
& p {
text-align: justify;
}
& a {
color: var(--c-primary);
@media (prefers-color-scheme: dark) {
color: var(--c-primary-inv);
}
&:hover {
text-decoration: underline;
}
}
& code {
font-family: "JetBrains Mono", monospace;
}
.btn {
border: 1px solid var(--c-primary);
padding: 8px 12px;
border-radius: 20px;
line-height: 3;
white-space: nowrap;
transition: all 0.15s;
margin-right: 5px;
text-decoration: none;
&:hover {
box-shadow: var(--c-btn-shadow) 1px 2px 6px;
text-decoration: none;
@media (prefers-color-scheme: dark) {
box-shadow: var(--c-btn-shadow-inv) 1px 2px 6px;
}
}
@media (prefers-color-scheme: dark) {
border-color: var(--c-primary-inv);
}
}
pre {
overflow-y: auto;
}
pre.hljs {
border-radius: 20px;
overflow-y: auto;
padding: 20px;
}
.pagination {
text-align: center;
}
.page-item {
display: inline;
padding-right: 10px;
&:last-child {
padding-right: 0;
}
}
.comment {
margin-top: var(--s-comment-margin-top);
text-align: center;
& a {
font-size: 1.1rem;
}
& p {
font-size: 0.95rem;
text-align: center;
}
}
#tags > a, #categories > a {
font-size: 0.9rem;
color: #fff;
padding: 4px 8px;
border-radius: 20px;
white-space: nowrap;
transition: all 0.15s;
text-decoration: none;
&:hover {
box-shadow: var(--c-btn-shadow) 1px 1px 4px;
text-decoration: none;
@media (prefers-color-scheme: dark) {
box-shadow: var(--c-btn-shadow-inv) 1px 1px 4px;
}
}
}
#tags > a {
color: var(--c-bg-tag);
border: 1px solid var(--c-bg-tag);
@media (prefers-color-scheme: dark) {
color: var(--c-bg-tag-inv);
border-color: var(--c-bg-tag-inv);
}
}
#categories > a {
color: var(--c-primary);
border: 1px solid var(--c-primary);
margin-right: 3px;
@media (prefers-color-scheme: dark) {
color: var(--c-primary-inv);
border: 1px solid var(--c-primary-inv);
}
}
@media screen and (max-width: 1100px) {
border: none;
box-shadow: none;
margin: 0 auto;
padding: 0 20px 80px;
.tagories {
text-align: left;
}
#tags a, #categories a {
line-height: 35px;
}
}
}
footer {
background-color: var(--c-font);
color: var(--c-font-inv);
padding: 40px;
text-align: center;
& a {
color: var(--c-font-inv);
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
}

349
assets/src/normalize.css vendored Normal file
View file

@ -0,0 +1,349 @@
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
:is(a) {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input { /* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select { /* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}

41
composer.json Normal file
View file

@ -0,0 +1,41 @@
{
"name": "getkirby/plainkit",
"description": "Kirby Plainkit",
"type": "project",
"keywords": [
"kirby",
"cms",
"starterkit"
],
"authors": [
{
"name": "Bastian Allgeier",
"email": "bastian@getkirby.com",
"homepage": "https://getkirby.com"
}
],
"homepage": "https://getkirby.com",
"support": {
"email": "support@getkirby.com",
"issues": "https://github.com/getkirby/starterkit/issues",
"forum": "https://forum.getkirby.com",
"source": "https://github.com/getkirby/starterkit"
},
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"getkirby/cms": "^4.0",
"johannschopplich/kirby-highlighter": "^3.1"
},
"config": {
"allow-plugins": {
"getkirby/composer-installer": true
},
"optimize-autoloader": true
},
"scripts": {
"start": [
"Composer\\Config::disableProcessTimeout",
"@php -S localhost:8000 kirby/router.php"
]
}
}

1347
composer.lock generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,106 +0,0 @@
###############
# General Config
#
baseURL = "https://mmk2410.org/"
languageCode = "en-us"
languageName = "English"
defaultContentLanguge = "en"
title = "Marcel Kapfer"
theme = "nextDESIGN"
# Enable the possibility to use .GitInfo
enableGitInfo = true
###############
# RSS
#
# Only put the last ten entrys in the RSS feed
rssLimit = 10
###############
# Author
#
[author]
name = "Marcel Kapfer"
###############
# Permalinks
#
[permalinks]
blog = "/:year/:month/:day/:title/"
quotes = "/:year/:month/:day/:title/"
###############
# Related Content
#
[related]
includeNewer = true
###############
# Additional menu entries
#
[menu]
[[menu.main]]
identifier = "composing"
name = "Composing"
weight = 5
url = "https://marcel-kapfer.de"
[[menu.main]]
identifier = "photography"
name = "Photography"
weight = 6
url = "https://marcelkapfer.photography"
###############
# Further paramters
#
[params]
about = "I do creative things."
copyrighthtml = "2023 © Marcel Kapfer<br>Content licensed under CC-BY-SA 4.0"
imprinttext = "Impressum und Datenschutz"
giturl = "https://git.mmk2410.org/mmk2410/mmk2410.org"
[params.social]
mastodon = "https://fosstodon.org/@mmk2410"
gitlab = "https://gitlab.com/mmk2410"
forgejo = "https://git.mmk2410.org/mmk2410"
[params.comment]
mail = "comment@mmk2410.org"
###############
# Markup
#
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
###############
# Privacy
#
[privacy]
[privacy.disqus]
disable = true
[privacy.googleAnalytics]
disable = true
[privacy.instagram]
disable = true
[privacy.twitter]
disable = true
[privacy.vimeo]
disable = true
[privacy.youtube]
disable = true

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,598 +0,0 @@
#+HUGO_BASE_DIR: ../
* Home
:PROPERTIES:
:EXPORT_FILE_NAME: _index
:EXPORT_HUGO_SECTION: /
:EXPORT_HUGO_MENU: :menu main :weight 1
:END:
Hi, I'm Marcel Kapfer (at some places also known as "mmk2410"). At the moment, I invest most of my free time in creative work. That consists mainly of photography, but I also compose music, train myself in graphic design, and write text as well as code.
While this website is (mostly) focused on tech-related stuff (like software development, operating systems and similar stuff) and writing in general, I also maintain a website dedicated to [[https://marcelkapfer.photography][photography]] as well one for [[https://marcel-kapfer.de][music composition]]. The blog here, however, may contains posts about more or less everything.
Since about 2011/2012 I am mainly using Linux (sometimes exclusively, although currently not) and in 2014 I started writing software. In late 2016 I began using Emacs and Org-Mode and now more or less live inside it. After getting my bachelor's degree in computer science from the University of Ulm in 2021 I started working at a small software agency in Ulm, Germany.
Besides these pages, you can also find me at a few other places across the web.
* About me
:PROPERTIES:
:EXPORT_FILE_NAME: _index
:EXPORT_HUGO_SECTION: about
:EXPORT_HUGO_MENU: :menu main :weight 2
:END:
#+begin_export html
<div style="text-align: center; margin: 20px 0;">
<img src="/profile.png" style="width: 300px"/>
<div style="font-size: 40px">
<strong>Hi!</strong>
</div>
<div style="font-size: 25px">
My name is Marcel Kapfer and I'm a creative being.
</div>
</div>
#+end_export
** Coding
I learned Java as my first programming language back in 2014 and started a first project, the [[https://gitlab.com/mmk2410/writtenmorse-specs/-/wikis/home][writtenMorse]] project.
It provided tools to convert writtenMorse code to Latin letters and the other way around. (Btw.: The writtenMorse code itself is an “invention” of mine for better writing Morse code by using other symbols than dots and dashes).
Later in 2014 I started to learn coding for Android, since I wanted to develop a writtenMorse app for the mobile OS.
This app was published on the Google Play Store in mid December, just three weeks after my first contact with Android development.
Additionally to that I learned a bit of JavaScript in 2014 for enhanced features on my websites.
In 2015 I expanded my knowledge by learning Bash, PHP, Python and a little bit of C.
I also released a few font apps for the Cyanogenmod Theme Engine and some bash scripts to make my (and maybe also your) life easier.
Rangitaki is another project that I started in February 2015.
It was a blogging engine without any database dependencies, written in PHP, which tried to be lightweight, extremely fast to start with and easy to use.
Following this passion I joined the Ulm University in October 2015 to studying computer science to further improve my knowledge in this area.
In April 2021 I earned a Bachelor of Science degree in the field of theoretical computer science.
I started learning more and more things about free (as in freedom, not as in free beer) software in the following years.
I strongly support the idea of freedom in software and try to avoid non-free software were possible.
One part of that is my decision to move all my project from GitHub to [[https://gitlab.com/u/mmk2410/projects][GitLab]] and [[https://git.mmk2410.org/explore/repos][my own Gitea instance]].
Due to other activities in the recent years (and also the coming ones) I don't have much time (and currently also not much interested) in developing software.
I try to further maintain some relevant projects, but most of them have been archived.
At the moment, I work as a software developer at a small software agency in Ulm, Germany.
** Photography
I got my first camera back in 2007 when I was ten years old, and this was when I picked up photography as a hobby.
For some reason, taking pictures was always something that motivated me and so I brought my camera with me to many events, holidays and the like during the years.
About 2015/2016, my interest faded a bit, and I focused more on other things, completely forgetting about photography.
In late 2020 this drastically changed when someone gave me an old DLSR camera.
From day one, my passion for photography was back again, and I invested more time than ever.
A bit later, in January 2022, I started an online course to improve my skills further and bought a modern mirrorless camera.
That was also the time when I discovered the more "artsy" side of photography and started sharing my work on social networks like [[https://pixelfed.social/mmk2410][Pixelfed]], [[https://instagram.com/mmk2410][Instagram]], and [[https://vero.co/mmk2410][VERO]].
After a heavy focus on macro photography, I'm currently quite involved in street photography.
If you would like to see some pictures or learn more about that, please visit my [[https://marcelkapfer.photography][portfolio]].
** Graphic Design
I am a huge fan of eye pleasing works!
Therefore I started designing a few years ago, but I hadn't jet time to do any major public work.
As of now my experience narrows down to web design and a little bit of print design, but I currently expand my knowledge by taking online graphic design courses.
** Composing
During my school time I had a lot to do with music and learned to play the piano.
Later I started to focus more on finding my own style, which is is combination of Minimal Music and Impressionism and I also wrote down some scores.
A first piece is written and more or less professionally set and also recorded.
You can download and view both on the [[https://marcel-kapfer.de][composing page]].
Due a lack of time in the last years I didn't have time to compose anything new.
But one other piece is done and only waiting for its recording. Stay tuned!
** Writing
To write about coding, politics, happenings in my life and also philosophy questions is something I'm interested in for years.
Sadly due to many other tasks I wasn't able to write much things.
Next to the blog entries I have also published a few longer [[/manuscripts][manuscripts]].
** Real Life
Away from my desk I loosely follow some hobbies.
On one hand I like to read books of various kinds, including crime novels and science fiction / fantasy stuff but also some technical books.
On the other hand I like visiting mother nature either for cycling, hiking or photographing.
** Others
In case you are interested into what software and hardware I use, you can read my [[/uses][What I Use]] page.
* What I Use
:PROPERTIES:
:EXPORT_FILE_NAME: _index
:EXPORT_HUGO_SECTION: uses
:END:
Since I find the lists of other people about what the use quite interesting and from time to time someone asks my about what software/hardware I use I decided to also set up one.
After having a simple blog post listing software since around 2016 I now put it all together here and update it from time to time.
/Last updated: 28. February 2024/
** Hardware
*** General
- *Display:* BENQ GW2765 (27", 16:9, 1440p)
- *USB-Audio-Interface:* Focusrite Scarlett 2i2 (3rd Generation)
- *Headphones (Over Ear):* Audio-Technica ATH-M50x
- *Headphones (In Ear)*: Shure SE 215 Purple
- *Earbuds*: Sennheiser CX True Wireless
- *Microphone:* Marantz Pro MPM-1000
- *Keyboard:* Ducky One2 Mini and Cherry MX-Board 3.0
- *Mouse:* Cherry MW 3000 (wireless)
*** Main Personal Laptop: Apple MacBook Air M2 13"
- *CPU:* Apple M2, 8 Core CPU, 10 Core CPU, 16 Core Neural Engine
- *RAM:* 24GB
- *Storage:* 1TB
- *OS:* MacOS Sonoma
- *Display*: 13.6", 2560x1664
*** Spare Personal Laptop: Lenovo YOGA Slim 7 Pro X
- *CPU:* AMD Ryzen 9 6900HS Creator Edition
- *GPU:* NVIDIA GeForce RTX 3050 Laptop
- *RAM:* 32GB
- *Storage:* 1TB M.2 SSD
- *OS:* Fedora Workstation 39
- *Desktop Environment:* GNOME
- *Display*: 14.5", 3072x1920, 120Hz
*** Work Laptop: Schenker Vision 14 (E22)
- *CPU:* Intel Core i7-12700H
- *GPU:* NVIDIA GeForce RTX 3050 Ti Laptop
- *RAM:* 32GB
- *Storage:* 1GB NVMe-SSD
- *OS:* Tuxedo OS 2
- *Desktop Environment:* KDE Plasma
- *Display*: 14", 2880x1800, 90Hz
*** Cameras
- *Fujifilm X-S10*: a mirrorless camera with a few lenses for everything
- *Ricoh GRIIIx*: a point-and-shoot style camera with a fixed 40mm equivalent lens as a every day camera and for street photography
*** Other hardware
- *Home server:* BananaPi M2 Ultra
- *Smartphone:* Apple iPhone 13
- *Tablet*: Samsung Galaxy Tab S4
- *Smart-/Sportswatch:* Garmin vívoactive 3 (though nowadays I often wear a non-smart watch)
- *Mobile Audio Player:* SanDisk Clip Sport
- *Printer/Scanner*: Lexmark MC2425 (Duplex-Colour-Laser)
- *Photo-Printer:* Canon Selphy CP 1500
- *E-piano:* Kawai CA-50
- *Amplifier*: Grundig V35
- *Turntable:* Perpetuum Ebner 2020 L
** Software
*** Desktop
- *Browser:* [[https://www.mozilla.org/firefox/][Firefox]] with following extensions:
- [[https://addons.mozilla.org/en-US/firefox/addon/privacy-badger17/][Privacy Badger]]
- [[https://addons.mozilla.org/en-US/firefox/addon/want-my-rss/][Want My RSS]]
- [[https://addons.mozilla.org/en-US/firefox/addon/facebook-container/][Facebook Container]]
- [[https://addons.mozilla.org/en-US/firefox/addon/keepassxc-browser/][KeePassXC-Browser]]
- [[https://addons.mozilla.org/en-US/firefox/addon/link-cleaner/][Link Cleaner]]
- *Calendar:* Nextcloud web calendar app
- *E-Mail client:* [[https://www.djcbsoftware.nl/code/mu/mu4e.html][mu4e]], [[https://www.thunderbird.net/][Thunderbird]] ( using mailbox.org as a mail service provider)
- *Contacts:* Nextcloud web contacts app
- *Password Manager*: [[https://keepassxc.org/][KeePassXC]]
- *Task Management:* [[https://orgmode.org/][org-mode]]
- *Read it later service*: Pocket
- *Text editor/IDE:* [[https://www.gnu.org/software/emacs/][Emacs]] and sometimes PhpStorm at work
- *Notable Emacs extensions*:
- [[https://magit.vc/][Magit]] (the Git client)
- [[https://orgmode.org/][org-mode]] (notes, todo-lists, planning, ...)
- [[https://www.orgroam.com/][org-roam]] (personal knowledge management)
- [[https://www.djcbsoftware.nl/code/mu/mu4e.html][mu4e]] (Mail client)
- [[https://joaotavora.github.io/eglot/][eglot]] (Language Server Protocol integration)
- [[https://www.gnu.org/software/erc/][ERC]] (Emacs IRC cient)
- [[https://github.com/skeeto/elfeed][Elfeed]] with [[https://github.com/fasheng/elfeed-protocol][Elfeed Protocol]] (Emacs RSS Reader)
- [[https://www.gnu.org/software/auctex/][AucTeX]] (LaTeX editing environment)
- [[https://github.com/minad/consult][Consult]], [[https://github.com/minad/vertico][Vertico]], [[https://github.com/oantolin/embark][Embark]], [[https://github.com/minad/marginalia][Marginalia]], [[https://github.com/oantolin/orderless][Orderless]] (completion system)
- [[https://editorconfig.org/][editorconfig]] (defined and shared code styles)
- [[https://github.com/akermu/emacs-libvterm][vterm]] (Emacs libvterm integration)
- *Photo management and development:* [[https://www.digikam.org/][Digikam]], Adobe Lightroom Classic, [[https://www.darktable.org/][Darktable]]
- *Photo editing:* Affinity Photo, [[https://www.gimp.org/][GIMP]]
- *Vector graphics:* Affinity Designer, [[https://inkscape.org][Inkscape]]
- *Desktop publishing*: Affinity Publisher, [[https://www.scribus.net/][Scribus]] and [[https://www.latex-project.org/][LaTeX]] (perhaps in the future also [[https://wiki.contextgarden.net/Main_Page][ConTeXt]])
- *Word Processing, Spreadsheets, Presentations:* LibreOffice (if not possible within Emacs & org-mode)
- *Shopping List:* Shared Nextcloud notes entry
- *Video editing:* [[https://kdenlive.org/en/][kdenlive]]
- *Digital audio workstation (DAW):* Audacity
- *Scorewriter:* [[https://musescore.org/][musescore]]
- *Music listening:* Spotify, Emacs
- *Accounting software*: [[https://hledger.org/][hledger]]
*** Android
My Samsung Galaxy Tab S4 does not have a mobile network modem and I currently don't own a Android smartphone. Therefore, the list of apps may be not as complete as expected.
- *Browser:* [[https://www.mozilla.org/firefox/][Firefox]]
- *Calendar:* [[https://acalendar.tapirapps.de/en/support/home][aCalendar+]] (synced with my Nextcloud)
- *Email:* [[https://k9mail.app/][K-9 Mail]] (using mailbox.org as a mail service provider)
- *Contacts:* Samsung Contacts App (synced with my Nextcloud)
- *Task Management:* [[http://www.orgzly.com/][Orgzly]]
- *Read it later service*: Pocket
- *Shopping List:* Shared Nextcloud notes entry
- *Music listening:* Spotify
- *Social Networks:* [[https://tusky.app/][Tusky]] (Mastodon), Instagram, [[https://pixelfed.org/][Pixelfed]], Vero, Flickr
- *Security:* [[https://github.com/PhilippC/keepass2android][Keepass2Android]]
- *Software centres:* Google Play Store and [[https://f-droid.org/][F-Droid]]
- *Other notable apps:* [[https://osmand.net/][OsmAnd]]
*** iOS
- *Browser*: [[https://www.mozilla.org/firefox/][Firefox]]
- *Calendar:* Apple Calendar (synced with my Nextcloud)
- *Email:* Apple Mail (using mailbox.org as a mail service provider)
- *Contacts:* Apple Contacts App (synced with my Nextcloud)
- *Task Management:* [[https://beorgapp.com/][beorg]]
- *Read it later service*: Pocket
- *Shopping List:* Shared Nextcloud notes entry
- *Messaging:* [[https://www.signal.org/][Signal]], Telegram, WhatsApp, Discord
- *Social Networks:* [[https://apps.apple.com/us/app/metatext/id1523996615?l=en][Metatext]] (Mastodon), Instagram, [[https://pixelfed.org/][Pixelfed]], Vero, Flickr
- *Notes:* [[https://1writerapp.com/][1Writer]]
- *Security:* [[https://apps.apple.com/us/app/freeotp-authenticator/id872559395][FreeOTP]], [[https://strongboxsafe.com/][Strongbox]] (KeePass-compatible password store)
- *RSS Reader:* [[https://reederapp.com/][Reeder]]
- *Other notable apps:* [[https://osmand.net/][OsmAnd]] (Maps)
** Self-hosted
Some services are publicly available and hosted on a Hetzner VPS others are running on my home server (see above in the hardware section).
- *Wiki:* [[https://moinmo.in/][MoinMoin]] (for [[https://uulmhack.dev][uulmhack]])
- *RSS:* [[https://freshrss.github.io/FreshRSS/en/][FreshRSS]] with [[https://github.com/RSS-Bridge/rss-bridge/wiki][RSS-bridge]]
- *Cloud:* Nextcloud
- *Git web interface:* [[https://forgejo.org/][Forgejo]]
- *IRC Bouncer:* [[https://wiki.znc.in/ZNC][ZNC]]
- *Web analytics*: [[https://www.goatcounter.com/][GoatCounter]]
- *Recipe management*: [[https://tandoor.dev/][Tandoor]]
- *Online file browser*: [[https://filebrowser.org/][File Browser]]
- *Photo gallery*: [[https://bpatrik.github.io/pigallery2/][PiGallery 2]]
** Other Services
- *Mail Provider:* Mailbox.org
* Blog
:PROPERTIES:
:EXPORT_FILE_NAME: _index
:EXPORT_HUGO_SECTION: blog
:EXPORT_HUGO_MENU: :menu main :weight 3
:END:
There are always some ideas floating around in my head of things that I want to write.
Some fade away, and others I capture in my GTD system.
And on some rare occasions, I invest the time to move my thoughts from my brain into a nice blog post.
If you're asking about what I write: I really can't tell.
Most things you can find here at the moment are about Linux, coding, and similar stuff.
But I won't promise that this won't change.
We'll see.
* Projects
:PROPERTIES:
:EXPORT_FILE_NAME: _index
:EXPORT_HUGO_SECTION: projects
:EXPORT_HUGO_MENU: :menu main :weight 4
:END:
** Software Projects
Since I started to program in 2014 I started a few small software projects.
Sadly over the last years I had nearly no time to maintain any of them (except features and bugfixes I needed).
However, I try to further maintain and develop them.
You can find all of them at [[https://gitlab.com/mmk2410][GitLab]].
*** Debian packages and Ubuntu PPAs
My unofficial Debian packages and the corresponding Ubuntu PPA for Jetbrains IntelliJ IDEA are probably the most “famous” thing I have created.
At least I get bug reports and merge requests when I do not update the packages fast enough.
Besides them I also created a few other packages for Debian.
To clarify: I am not a official Debian Developer or Maintainer and am also not formally trained on building Debian packages.
Therefore the quality of the packages is certainly not that good.
There are---more or less---quite hacky.
**** IntelliJ IDEA Community & Ultimate
The community edition and the ultimate edition as well can be received from the Launchpad repository [[https://launchpad.net/~mmk2410/+archive/ubuntu/intellij-idea][ppa:mmk2410/intellij-idea]] which you can add on Ubuntu with
#+begin_src shell
sudo apt-add-repository ppa:mmk2410/intellij-idea # Add the repository
sudo apt-get update # Update the package lists
sudo apt-get install intellij-idea-community # Install IntelliJ IDEA Community
sudo apt-get install intellij-idea-ultimate # and/or install IntelliJ IDEA Ultimate
#+end_src
The source code and the =.deb= packages are available at their repositories on GitLab:
- [[https://gitlab.com/mmk2410/intellij-idea-community/][IntelliJ IDEA Community repository]]
- [[https://gitlab.com/mmk2410/intellij-idea-ultimate/][Intellij IDEA Ultimate repository]]
**** Typefaces
Because I needed them, I packaged three typefaces for Debian.
The packages should also work for Ubuntu but I don't provide an PPA for them.
I currently can not ensure active maintenance of any of these packages.
- *Iosevka*: [[https:://gitlab.com/mmk2410/fonts-iosevka][GitLab]] [[https://git.mmk2410.org/deb/fonts-iosevka][Gitea]]
- *Hermit*: [[https://gitlab.com/mmk2410/fonts-hermit][GitLab]] [[https://git.mmk2410.org/deb/fonts-iosevka][Gitea]]
- *Overpass*: [[https://git.mmk2410.org/deb/fonts-overpass][Gitea]]
*** Scorelib (inactive)
Scorelib is a smaller project I started in 2015 for managing my collection music scores (the sheetpapers) with a database.
Scorelib is a CLI program written in Python and using SQlite as a database.
I assume that it only runs on Linux, but I never tested it on other platforms.
Scorelib is, as of now, quite small with only the basic features implemented (like I wrote on the beginning, I had no time to code much the last years).
It is available at [[https://gitlab.com/mmk2410/scorelib][GitLab]].
Note: Although the title says that the project is inactive I do not consider archiving it.
Theoretically I still have a need for such a software but practically time is missing to work on it.
It is also possible that I will start working on it again but then possibly also with a completely different tech stack/goal.
*** Other
Smaller scripts that aren't worth their own Git repository can be
found at the [[https://gitlab.com/mmk2410/scirpts][scripts repo]].
** Other Projects
*** Quotes Collection
A [[/quotes][collection of quotes]] (mostly without comment) that I largely gathered during a project 365 in 2015. The pages are only available in German.
** Archived Projects
*** Software Projects
**** CyanogenMod Fonts (archived)
In early 2015 I created three font packages for the CyanogenMod
Theme Chooser (Comfortaa, Fira Sans and Raleway) which were all
quite a success at Google Play. But since end of 2015 I no longer
own an device for which a CyanogenMode / LineageOS build is
available and so I sadly cannot further develop or maintain those
packages. I /you/ are interested in helping with these projects,
feel free to contact me at me(at)mmk2410(dot)org!
**** Rangitaki (archived)
The biggest project I've started is the Rangitaki blogging engine.
A blogging engine (with a few CMS features) written in PHP and
without database dependencies. I used it prior to this WordPress
installation and still use it on [[https://marcel-kapfer.de][marcel-kapfer.de]].
Read more about it at [[https://gitlab.com/mmk2410/rangitaki/wikis/home][GitLab]].
**** writtenMorse (archived)
writtenMorse was the first project I've started back in 2014. Its
goal is it to provide a Morse code system for writing and reading
(with signs like =#= for a letter space and =+= for a word space)
-- especially at computer system, as well as software to work with
it. The project started with a simple Java program which grow fast
to a full-features software for converting writtenMorse and also
Morse code. The project also created an Android app an a
responsive web app.
More information can still be found at the corresponding [[https://gitlab.com/mmk2410/writtenmorse-specs/wikis/home][wiki
page]].
**** Other archived projects
Beneath those projects there were also a few other ones worth
mentioning like [[https://gitlab.com/mmk2410/filespread][Filespread]], an web app for sending a file to a
group of people via mail, and [[https://gitlab.com/mmk2410/titama][TiTaMa]], a simple time table manager
web app written in PHP (a rewrite in Dart was started and the
backend is complete since mid-2016 but the frontend was never
started). There is also the usual bunch of dead experiments like
an Rangitaki SSH Sync library, written in C with libssh. As of now
all these are no longer developed and archived.
* Manuscripts
:PROPERTIES:
:EXPORT_FILE_NAME: _index
:EXPORT_HUGO_SECTION: manuscripts
:EXPORT_HUGO_MENU: :menu main :weight 7
:END:
Here you can find some articles, concepts, manuscripts and similar
documents. Most of them are written in German.
** Philosophy
- [[/2019/04/handlungsfreiheit-privatautonomie-mensch-autonome-systeme.pdf][Handlungsfreiheit und Privatautonomie des Menschen bei autonomen Systemen]] (Deutsch, 12. Februar 2019)
- [[/2018/07/arbeit.pdf][Suizid aus den Augen Viktor E. Frankls]] (Deutsch, 30. März 2018)
- [[/2018/03/mathematik-antike.pdf][Mathematik in der Antike]] (Deutsch, 12. März 2018)
** Computer Science
- [[/2018/08/overview-of-finding-the-most-probable-explanation-in-bayesian-networks.pdf][Overview of finding the most probable explanation in Bayesian networks]] (English, 09. July 2018)
- [[/2018/03/vergleich-bdsg-dsgvo.pdf][Das Bundesdatenschutzgesetz im Vergleich mit der Datenschutz-Grundverordnung]] (Deutsch, 24. Januar 2018)
** Misc
- [[/2018/03/konzept-gespraech-konfliktbewaeltigung.pdf][Konzept für Gespräche zur Konfliktbewältigung]] (Deutsch, 27. März 2018)
* Quotes
:PROPERTIES:
:EXPORT_FILE_NAME: _index
:EXPORT_HUGO_SECTION: quotes
:END:
/These pages are only in German./
Auf diesen Seiten sammeln sich zahlreiche (zumeist unkommentierte)
Zitate. Der Großteil (zur Zeit sogar noch alle) stammen von einem
Projekt 365 (wem das nicht bekannt ist, ein Projekt 365 ist ein
Projekt, bei welchem man sich täglich eine Aufgabe vornimmt), zu
welchem ich 2015 ermuntert wurde. Ich habe mich damals dazu
entschieden, ein Jahr lange jeden Tag ein Zitat (unkommentiert) zu
posten. Diese Sammlung findet sich hier.
Das hießt aber nicht, dass nie etwas Neues hinzukommt. Es ist gut
möglich, dass ich hier in Zukunft von Zeit zu Zeit ein Zitat poste
und eventuell dieses auch sogar etwas kommentiere. Mal schauen... :D
Falls das mal der Fall sein sollte und sich jemand bewusst nur für
die Posts im Rahmen des damaligen Projekt 365 interessiert, kann er
explizit diese unter der [[/categories/project365-2015][dazugehörigen Kategorieseite]] lesen.
* Contact
:PROPERTIES:
:EXPORT_FILE_NAME: _index
:EXPORT_HUGO_SECTION: contact
:EXPORT_HUGO_MENU: :menu main :weight 99
:END:
If you want to contact me you can choose among the following options (though I prefer email):
- Email: me(at)mmk2410(dot)org (PGP key ID: =CADE 6F0C 09F2 1B09=)
- Direct Message on Mastodon (account see below)
You can also follow me on some social networks where I am more or less active:
- Mastodon/Fosstodon: [[https://fosstodon.org/@mmk2410][@mmk2410@fosstodon.org]]
- Pixelfed: [[https://pixelfed.social/mmk2410][@mmk2410@pixelfed.social]]
- Instagram: [[https://instagram.com/mmk2410][@mmk2410]]
- VERO: [[https://vero.co/mmk2410][@mmk2410]]
- Flickr: [[https://www.flickr.com/photos/marcelkapfer/][marcels.pictures]]
* Impressum und Datenschutz
:PROPERTIES:
:EXPORT_FILE_NAME: _index
:EXPORT_HUGO_SECTION: imprint
:END:
Marcel Kapfer<br>
Buchenlandweg 99<br>
89075 Ulm
E-Mail: me(at)mmk2410(dot)org
Verantwortlich für den Inhalt (gem. § 55 Abs. 2 RStV):<br>
Marcel Kapfer<br>
Buchenlandweg 99<br>
89075 Ulm
** Disclaimer rechtliche Hinweise
*** § 1 Warnhinweis zu Inhalten
Die kostenlosen und frei zugänglichen Inhalte dieser Webseite wurden
mit größtmöglicher Sorgfalt erstellt. Der Anbieter dieser Webseite
übernimmt jedoch keine Gewähr für die Richtigkeit und Aktualität der
bereitgestellten kostenlosen und frei zugänglichen journalistischen
Ratgeber und Nachrichten. Namentlich gekennzeichnete Beiträge geben
die Meinung des jeweiligen Autors und nicht immer die Meinung des
Anbieters wieder. Allein durch den Aufruf der kostenlosen und frei
zugänglichen Inhalte kommt keinerlei Vertragsverhältnis zwischen dem
Nutzer und dem Anbieter zustande, insoweit fehlt es am
Rechtsbindungswillen des Anbieters.
*** § 2 Externe Links
Diese Website enthält Verknüpfungen zu Websites Dritter (“externe
Links”). Diese Websites unterliegen der Haftung der jeweiligen
Betreiber. Der Anbieter hat bei der erstmaligen Verknüpfung der
externen Links die fremden Inhalte daraufhin überprüft, ob etwaige
Rechtsverstöße bestehen. Zu dem Zeitpunkt waren keine Rechtsverstöße
ersichtlich. Der Anbieter hat keinerlei Einfluss auf die aktuelle
und zukünftige Gestaltung und auf die Inhalte der verknüpften
Seiten. Das Setzen von externen Links bedeutet nicht, dass sich der
Anbieter die hinter dem Verweis oder Link liegenden Inhalte zu Eigen
macht. Eine ständige Kontrolle der externen Links ist für den
Anbieter ohne konkrete Hinweise auf Rechtsverstöße nicht zumutbar.
Bei Kenntnis von Rechtsverstößen werden jedoch derartige externe
Links unverzüglich gelöscht.
*** § 3 Urheber- und Leistungsschutzrechte
Eigene Inhalte werden unter Creative Commons Attribution Share-Alike
4.0 veröffentlicht, davon ausgenommen sind als Zitat gekennzeichnete
Stellen oder Beiträge in denen ausdrücklich auf eine andere Lizenz
hingewiesen wird.
Die Darstellung dieser Website in fremden Frames ist nur mit
schriftlicher Erlaubnis zulässig.
*** § 4 Besondere Nutzungsbedingungen
Soweit besondere Bedingungen für einzelne Nutzungen dieser Website
von den vorgenannten Paragraphen abweichen, wird an entsprechender
Stelle ausdrücklich darauf hingewiesen. In diesem Falle gelten im
jeweiligen Einzelfall die besonderen Nutzungsbedingungen.
Quelle: Impressum-Generator.
** Datenschutz
Nachfolgend möchten wir Sie über unsere Datenschutzerklärung
informieren. Sie finden hier Informationen über die Erhebung und
Verwendung persönlicher Daten bei der Nutzung unserer Webseite. Wir
beachten dabei das für Deutschland geltende Datenschutzrecht. Sie
können diese Erklärung jederzeit auf unserer Webseite abrufen.
Wir weisen ausdrücklich darauf hin, dass die Datenübertragung im
Internet (z.B. bei der Kommunikation per E-Mail) Sicherheitslücken
aufweisen und nicht lückenlos vor dem Zugriff durch Dritte geschützt
werden kann.
Die Verwendung der Kontaktdaten unseres Impressums zur gewerblichen
Werbung ist ausdrücklich nicht erwünscht, es sei denn wir hatten
zuvor unsere schriftliche Einwilligung erteilt oder es besteht
bereits eine Geschäftsbeziehung. Der Anbieter und alle auf dieser
Website genannten Personen widersprechen hiermit jeder kommerziellen
Verwendung und Weitergabe ihrer Daten.
*** Personenbezogene Daten
Sie können unsere Webseite ohne Angabe personenbezogener Daten
besuchen. Soweit auf unseren Seiten personenbezogene Daten (wie
Name, Anschrift oder E-Mail Adresse) erhoben werden, erfolgt dies,
soweit möglich, auf freiwilliger Basis. Diese Daten werden ohne Ihre
ausdrückliche Zustimmung nicht an Dritte weitergegeben. Sofern
zwischen Ihnen und uns ein Vertragsverhältnis begründet, inhaltlich
ausgestaltet oder geändert werden soll oder Sie an uns eine Anfrage
stellen, erheben und verwenden wir personenbezogene Daten von Ihnen,
soweit dies zu diesen Zwecken erforderlich ist (Bestandsdaten). Wir
erheben, verarbeiten und nutzen personenbezogene Daten soweit dies
erforderlich ist, um Ihnen die Inanspruchnahme des Webangebots zu
ermöglichen (Nutzungsdaten). Sämtliche personenbezogenen Daten
werden nur solange gespeichert wie dies für den genannten Zweck
(Bearbeitung Ihrer Anfrage oder Abwicklung eines Vertrags)
erforderlich ist. Hierbei werden steuer- und handelsrechtliche
Aufbewahrungsfristen berücksichtigt. Auf Anordnung der zuständigen
Stellen dürfen wir im Einzelfall Auskunft über diese Daten
(Bestandsdaten) erteilen, soweit dies für Zwecke der
Strafverfolgung, zur Gefahrenabwehr, zur Erfüllung der gesetzlichen
Aufgaben der Verfassungsschutzbehörden oder des Militärischen
Abschirmdienstes oder zur Durchsetzung der Rechte am geistigen
Eigentum erforderlich ist.
*** Auskunftsrecht
Sie haben das jederzeitige Recht, sich unentgeltlich und
unverzüglich über die zu Ihrer Person erhobenen Daten zu erkundigen.
Sie haben das jederzeitige Recht, Ihre Zustimmung zur Verwendung
Ihrer angegeben persönlichen Daten mit Wirkung für die Zukunft zu
widerrufen. Zur Auskunftserteilung wenden Sie sich bitte an den
Anbieter unter den Kontaktdaten im Impressum.
Quelle: [[https://www.juraforum.de][www.juraforum.de]]

5
index.php Normal file
View file

@ -0,0 +1,5 @@
<?php
require 'kirby/bootstrap.php';
echo (new Kirby)->render();

0
media/index.html Normal file
View file

420
package-lock.json generated Normal file
View file

@ -0,0 +1,420 @@
{
"name": "mmk2410.org",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "mmk2410.org",
"license": "MIT",
"devDependencies": {
"esbuild": "^0.20.1"
}
},
"node_modules/@esbuild/aix-ppc64": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.1.tgz",
"integrity": "sha512-m55cpeupQ2DbuRGQMMZDzbv9J9PgVelPjlcmM5kxHnrBdBx6REaEd7LamYV7Dm8N7rCyR/XwU6rVP8ploKtIkA==",
"cpu": [
"ppc64"
],
"dev": true,
"optional": true,
"os": [
"aix"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/android-arm": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.1.tgz",
"integrity": "sha512-4j0+G27/2ZXGWR5okcJi7pQYhmkVgb4D7UKwxcqrjhvp5TKWx3cUjgB1CGj1mfdmJBQ9VnUGgUhign+FPF2Zgw==",
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/android-arm64": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.1.tgz",
"integrity": "sha512-hCnXNF0HM6AjowP+Zou0ZJMWWa1VkD77BXe959zERgGJBBxB+sV+J9f/rcjeg2c5bsukD/n17RKWXGFCO5dD5A==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/android-x64": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.1.tgz",
"integrity": "sha512-MSfZMBoAsnhpS+2yMFYIQUPs8Z19ajwfuaSZx+tSl09xrHZCjbeXXMsUF/0oq7ojxYEpsSo4c0SfjxOYXRbpaA==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/darwin-arm64": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.1.tgz",
"integrity": "sha512-Ylk6rzgMD8klUklGPzS414UQLa5NPXZD5tf8JmQU8GQrj6BrFA/Ic9tb2zRe1kOZyCbGl+e8VMbDRazCEBqPvA==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/darwin-x64": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.1.tgz",
"integrity": "sha512-pFIfj7U2w5sMp52wTY1XVOdoxw+GDwy9FsK3OFz4BpMAjvZVs0dT1VXs8aQm22nhwoIWUmIRaE+4xow8xfIDZA==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/freebsd-arm64": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.1.tgz",
"integrity": "sha512-UyW1WZvHDuM4xDz0jWun4qtQFauNdXjXOtIy7SYdf7pbxSWWVlqhnR/T2TpX6LX5NI62spt0a3ldIIEkPM6RHw==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/freebsd-x64": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.1.tgz",
"integrity": "sha512-itPwCw5C+Jh/c624vcDd9kRCCZVpzpQn8dtwoYIt2TJF3S9xJLiRohnnNrKwREvcZYx0n8sCSbvGH349XkcQeg==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-arm": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.1.tgz",
"integrity": "sha512-LojC28v3+IhIbfQ+Vu4Ut5n3wKcgTu6POKIHN9Wpt0HnfgUGlBuyDDQR4jWZUZFyYLiz4RBBBmfU6sNfn6RhLw==",
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-arm64": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.1.tgz",
"integrity": "sha512-cX8WdlF6Cnvw/DO9/X7XLH2J6CkBnz7Twjpk56cshk9sjYVcuh4sXQBy5bmTwzBjNVZze2yaV1vtcJS04LbN8w==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-ia32": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.1.tgz",
"integrity": "sha512-4H/sQCy1mnnGkUt/xszaLlYJVTz3W9ep52xEefGtd6yXDQbz/5fZE5dFLUgsPdbUOQANcVUa5iO6g3nyy5BJiw==",
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-loong64": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.1.tgz",
"integrity": "sha512-c0jgtB+sRHCciVXlyjDcWb2FUuzlGVRwGXgI+3WqKOIuoo8AmZAddzeOHeYLtD+dmtHw3B4Xo9wAUdjlfW5yYA==",
"cpu": [
"loong64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-mips64el": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.1.tgz",
"integrity": "sha512-TgFyCfIxSujyuqdZKDZ3yTwWiGv+KnlOeXXitCQ+trDODJ+ZtGOzLkSWngynP0HZnTsDyBbPy7GWVXWaEl6lhA==",
"cpu": [
"mips64el"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-ppc64": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.1.tgz",
"integrity": "sha512-b+yuD1IUeL+Y93PmFZDZFIElwbmFfIKLKlYI8M6tRyzE6u7oEP7onGk0vZRh8wfVGC2dZoy0EqX1V8qok4qHaw==",
"cpu": [
"ppc64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-riscv64": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.1.tgz",
"integrity": "sha512-wpDlpE0oRKZwX+GfomcALcouqjjV8MIX8DyTrxfyCfXxoKQSDm45CZr9fanJ4F6ckD4yDEPT98SrjvLwIqUCgg==",
"cpu": [
"riscv64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-s390x": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.1.tgz",
"integrity": "sha512-5BepC2Au80EohQ2dBpyTquqGCES7++p7G+7lXe1bAIvMdXm4YYcEfZtQrP4gaoZ96Wv1Ute61CEHFU7h4FMueQ==",
"cpu": [
"s390x"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-x64": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.1.tgz",
"integrity": "sha512-5gRPk7pKuaIB+tmH+yKd2aQTRpqlf1E4f/mC+tawIm/CGJemZcHZpp2ic8oD83nKgUPMEd0fNanrnFljiruuyA==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/netbsd-x64": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.1.tgz",
"integrity": "sha512-4fL68JdrLV2nVW2AaWZBv3XEm3Ae3NZn/7qy2KGAt3dexAgSVT+Hc97JKSZnqezgMlv9x6KV0ZkZY7UO5cNLCg==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"netbsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/openbsd-x64": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.1.tgz",
"integrity": "sha512-GhRuXlvRE+twf2ES+8REbeCb/zeikNqwD3+6S5y5/x+DYbAQUNl0HNBs4RQJqrechS4v4MruEr8ZtAin/hK5iw==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"openbsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/sunos-x64": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.1.tgz",
"integrity": "sha512-ZnWEyCM0G1Ex6JtsygvC3KUUrlDXqOihw8RicRuQAzw+c4f1D66YlPNNV3rkjVW90zXVsHwZYWbJh3v+oQFM9Q==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"sunos"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/win32-arm64": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.1.tgz",
"integrity": "sha512-QZ6gXue0vVQY2Oon9WyLFCdSuYbXSoxaZrPuJ4c20j6ICedfsDilNPYfHLlMH7vGfU5DQR0czHLmJvH4Nzis/A==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/win32-ia32": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.1.tgz",
"integrity": "sha512-HzcJa1NcSWTAU0MJIxOho8JftNp9YALui3o+Ny7hCh0v5f90nprly1U3Sj1Ldj/CvKKdvvFsCRvDkpsEMp4DNw==",
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/win32-x64": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.1.tgz",
"integrity": "sha512-0MBh53o6XtI6ctDnRMeQ+xoCN8kD2qI1rY1KgF/xdWQwoFeKou7puvDfV8/Wv4Ctx2rRpET/gGdz3YlNtNACSA==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.1.tgz",
"integrity": "sha512-OJwEgrpWm/PCMsLVWXKqvcjme3bHNpOgN7Tb6cQnR5n0TPbQx1/Xrn7rqM+wn17bYeT6MGB5sn1Bh5YiGi70nA==",
"dev": true,
"hasInstallScript": true,
"bin": {
"esbuild": "bin/esbuild"
},
"engines": {
"node": ">=12"
},
"optionalDependencies": {
"@esbuild/aix-ppc64": "0.20.1",
"@esbuild/android-arm": "0.20.1",
"@esbuild/android-arm64": "0.20.1",
"@esbuild/android-x64": "0.20.1",
"@esbuild/darwin-arm64": "0.20.1",
"@esbuild/darwin-x64": "0.20.1",
"@esbuild/freebsd-arm64": "0.20.1",
"@esbuild/freebsd-x64": "0.20.1",
"@esbuild/linux-arm": "0.20.1",
"@esbuild/linux-arm64": "0.20.1",
"@esbuild/linux-ia32": "0.20.1",
"@esbuild/linux-loong64": "0.20.1",
"@esbuild/linux-mips64el": "0.20.1",
"@esbuild/linux-ppc64": "0.20.1",
"@esbuild/linux-riscv64": "0.20.1",
"@esbuild/linux-s390x": "0.20.1",
"@esbuild/linux-x64": "0.20.1",
"@esbuild/netbsd-x64": "0.20.1",
"@esbuild/openbsd-x64": "0.20.1",
"@esbuild/sunos-x64": "0.20.1",
"@esbuild/win32-arm64": "0.20.1",
"@esbuild/win32-ia32": "0.20.1",
"@esbuild/win32-x64": "0.20.1"
}
}
}
}

16
package.json Normal file
View file

@ -0,0 +1,16 @@
{
"name": "mmk2410.org",
"description": "Website running at mmk2410.org",
"scripts": {
"build": "esbuild assets/src/main.css --bundle --minify --loader:.woff2=dataurl --outdir=assets/build/"
},
"repository": {
"type": "git",
"url": "https://git.mmk2410.org/mmk2410/mmk2410.org"
},
"author": "Marcel Kapfer",
"license": "MIT",
"devDependencies": {
"esbuild": "^0.20.1"
}
}

View file

@ -1,20 +0,0 @@
#!/bin/bash
# Clean aka remove public/ if it exists
if [[ -d ./public/ ]]; then
rm -rf ./public/
fi
# Build the site using hugo
hugo
# Deploy using rsync
rsync \
--archive \
--verbose \
--compress \
--chown=marcel:www-data \
--delete \
--progress \
public/ \
tolkien:/var/www/mmk2410.org/

0
site/accounts/index.html Normal file
View file

View file

@ -0,0 +1,37 @@
title: Blog Article
num: '{{ page.date.toDate("YmdHi") }}'
create:
fields:
- date
columns:
main:
width: 2/3
sections:
fields:
type: fields
fields:
text:
type: textarea
size: huge
sidebar:
width: 1/3
sections:
meta:
type: fields
fields:
date:
type: date
label: Published on
time: true
required: true
categories:
type: tags
labe: Categories
tags:
type: tags
labe: Tags
files:
type: files

View file

@ -0,0 +1,21 @@
title: Blog Page
sections:
fields:
type: fields
fields:
text:
type: textarea
size: small
drafts:
extends: sections/articles
label: Drafts
status: draft
unlisted:
extends: sections/articles
label: In Review
status: unlisted
listed:
extends: sections/articles
label: Published
status: listed

View file

@ -0,0 +1,21 @@
title: Default Page
columns:
main:
width: 2/3
sections:
fields:
type: fields
fields:
text:
type: textarea
size: huge
sidebar:
width: 1/3
sections:
pages:
type: pages
template: default
files:
type: files

View file

@ -0,0 +1,46 @@
title: Home Page
columns:
main:
width: 2/3
sections:
fields:
type: fields
fields:
subtitle:
type: text
text:
type: textarea
size: medium
internal_menu:
type: structure
label: Internal Links
fields:
title:
type: text
label: Title
link:
type: link
label: Link
options:
- page
external_menu:
type: structure
label: External Links
fields:
title:
type: text
label: Title
link:
type: link
label: Link
options:
- url
sidebar:
width: 1/3
sections:
pages:
type: pages
template: default
files:
type: files

View file

@ -0,0 +1,29 @@
title: Blog Article
num: '{{ page.date.toDate("YmdHi") }}'
create:
fields:
- date
columns:
main:
width: 2/3
sections:
fields:
type: fields
fields:
text:
type: textarea
size: medium
sidebar:
width: 1/3
sections:
meta:
type: fields
fields:
date:
type: date
label: Published on
time: true
required: true

View file

@ -0,0 +1,21 @@
title: Quotes Page
sections:
fields:
type: fields
fields:
text:
type: textarea
size: small
quotes:
type: pages
search: true
image: false
template: quote
sortBy: date desc
empty: No quotes yet
layout: table
columns:
date:
label: Published on
width: 1/6

View file

@ -0,0 +1,17 @@
type: pages
search: true
image: false
template: article
sortBy: date desc
empty: No articles yet
layout: table
columns:
date:
label: Published on
width: 1/6
categories:
label: Categories
width: 1/6
tags:
label: Tags
width: 1/6

56
site/blueprints/site.yml Normal file
View file

@ -0,0 +1,56 @@
title: Site
columns:
main:
width: 2/3
sections:
pages:
type: pages
fields:
type: fields
fields:
menu:
type: structure
fields:
title:
type: text
label: Title
link:
type: link
label: Link
options:
- page
- url
sidebar:
width: 1/3
sections:
articles_draft:
extends: sections/articles
label: Draft Articles
status: draft
parent: site.find("blog")
layout: list
limit: 5
articles_review:
extends: sections/articles
label: In Review Articles
status: unlisted
parent: site.find("blog")
layout: list
limit: 5
articles_published:
extends: sections/articles
label: Published Articles
status: listed
parent: site.find("blog")
layout: list
limit: 5
metadata:
type: fields
fields:
author:
type: text
description:
type: text
keywords:
type: tags

0
site/cache/index.html vendored Normal file
View file

37
site/config/config.php Normal file
View file

@ -0,0 +1,37 @@
<?php
return [
'analytics' => [
'goatcounter' => 'stats.mmk2410.org'
],
'routes' => [
[
'pattern' => 'feed',
'action' => fn () => go('/blog.rss')
],
[
'pattern' => 'index.xml',
'action' => fn () => go('/blog.rss')
],
[
'pattern' => '(:num)/(:num)/(:num)/(:any)',
'action' => function ($year, $month, $day, $slug) {
$page = page('blog/' . $slug);
if (!$page) return site()->errorPage();
return site()->visit($page);
}
],
[
'pattern' => 'blog/category/(:any)',
'action' => function($category) {
return page('blog')->render(['category' => $category]);
}
],
[
'pattern' => 'blog/tag/(:any)',
'action' => function($tag) {
return page('blog')->render(['tag' => $tag]);
}
]
]
];

17
site/controllers/blog.php Normal file
View file

@ -0,0 +1,17 @@
<?php
return function ($page, $tag, $category) {
$articles = $page->children()->listed();
if ($tag) {
$articles = $articles->filterBy('tags', $tag, ',');
}
if ($category) {
$articles = $articles->filterBy('categories', $category, ',');
}
return [
'articles' => $articles->flip()->paginate(20)
];
};

View file

@ -0,0 +1,7 @@
<?php
return function ($page) {
return [
'quotes' => $page->children()->listed()->flip()->paginate(20)
];
};

30
site/models/article.php Normal file
View file

@ -0,0 +1,30 @@
<?php
class ArticlePage extends Page
{
public function url($options = null): string
{
$date = $this->date()->toDate('Y/m/d');
return '/' . $date .'/' . $this->slug();
}
public function readingTime() {
$doc = new DOMDocument();
$doc->loadHtml(
"<html><head><meta charset=\"UTF-8\"><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head><body>"
. $this->text()->kirbytext()
."</body></html>"
);
$pElems = $doc->getElementsByTagName('p');
$text = '';
foreach ($pElems as $pElem) {
$text .= $pElem->nodeValue . ' ';
}
$wordCount = count(explode(' ', $text));
$readingTime = (int)ceil($wordCount / 150);
return $wordCount . ' words, ~' . $readingTime . 'min reading time';
}
}

View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020-PRESENT Johann Schopplich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,135 @@
# Kirby Highlighter
Server-side code highlighting available as [custom block](https://getkirby.com/docs/reference/panel/fields/blocks) and for [KirbyText](https://getkirby.com/docs/guide/content/text-formatting#kirbytext).
Built upon [highlight.php](http://www.highlightjs.org) which itself is a port of [highlight.js](http://www.highlightjs.org).
## Key Features
- 🏗 Works with Kirby's [`code` block](https://getkirby.com/docs/reference/panel/blocks/code)
- 🏳️‍🌈 Supports 189 languages
- 💫 94 styles available
- ⛳️ Automatic language detection for KirbyText
## Requirements
- Kirby 3.8+
## Installation
### Composer
```
composer require johannschopplich/kirby-highlighter
```
### Download
Download and copy this repository to `/site/plugins/kirby-highlighter`.
## Usage
### With Kirby Blocks Field
This plugin overwrites Kirby's internal [`code` block](https://getkirby.com/docs/reference/panel/blocks/code). Thus, you won't have to change a thing.
Use the `code` block just like before, the output will be highlighted automatically:
```yaml
fields:
example:
label: Paste code here
type: blocks
fieldsets:
- code
```
### Within KirbyText
Create a code block in your KirbyText field and optionally set the code language:
<pre lang="no-highlight"><code>```css
.currentColor {
color: currentColor;
}
```
</code></pre>
Or use the new `code`-KirbyTag from this plugin with a base64 encoded code string:
```
(code: LmN1cnJlbnRDb2xvciB7CiAgY29sb3I6IGN1cnJlbnRDb2xvcjsKfQ== lang: css)
```
Which outputs:
```html
<pre class="hljs"><code><span class="hljs-selector-class">.currentColor</span> {
<span class="hljs-attribute">color</span>: currentColor;
}</code></pre>
```
The syntax highlighting functionality can be changed. You can choose between two highlighting modes:
1. Explicit mode (default)
2. Automatic language detection mode (opt-in)
#### Explicit Mode
In explicit mode, you have to define which language the code block is. Otherwise highlighting will be skipped.
#### Automatic Language Detection
Alternatively you can use the automatic detection mode, which highlights your code with the language the library thinks is best. It is highly recommended you explicitly choose the language or limit the number of languages to automatically detect from. This reduces the number of inaccuracies and skips this extremely inefficient selection process.
To enable automatic language detection, set:
- `johannschopplich.highlighter.autodetect` to `true`
- `johannschopplich.highlighter.languages` to an array of names from which languages should be chosen
## Options
| Option |  Default | Description |
| --------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `johannschopplich.highlighter.class` | `hljs` | Style class for Highlight to be added to the `pre` element. |
| `johannschopplich.highlighter.autodetect` | `false` | Indicates if the library should define which language thinks is best. Only applies when no language was set on the KirbyText code block. |
| `johannschopplich.highlighter.languages` | `[]` | Array of language names to be auto-detected. If empty, every language will be auto-detectable. |
| `johannschopplich.highlighter.line-numbering` | `false` | Indicates if the library should split up the highlighted code on each new line and wrap it in a `<span>` element. |
| `johannschopplich.highlighter.line-numbering-class` | `hljs-code-line` | CSS class applied to highlighted code lines, respectively `<span>` elements. |
## Styling in the Frontend
Since this plugin handles highlighting code only and thus just wraps span's around code, you have to link styles in your frontend yourself. I recommend choosing one of the available themes directly from the highlight.js project: [highlight.js/src/styles/](https://github.com/highlightjs/highlight.js/tree/master/src/styles)
The CSS files over at the repository are maintained and new ones arrive from time to time, therefore it would be redundant to include a copy in this repository.
One of my favorite themes is [Night Owl by Sarah Drasner](https://github.com/highlightjs/highlight.js/blob/master/src/styles/night-owl.css).
For example you could download the CSS file and save it in your Kirby project under `assets/css/hljs-night-owl.css`. Now you just have to include it in your template `<?= css('assets/css/hljs-night-owl.css') ?>`. Alternatively, use a CSS bundler of your choice.
### Line Numbering
If you choose to activate the line numbering option, you will need to include additional CSS style to display line numbering.
A basic example using [pseudo-elements](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements):
```css
pre.hljs .hljs-code-line {
counter-increment: line;
}
pre.hljs .hljs-code-line::before {
content: counter(line);
display: inline-block;
margin-right: 1em;
opacity: 0.5;
}
```
## Credits
- Geert Bergman and contributors for the awesome [highlight.php](https://github.com/scrivo/highlight.php) port.
- Martin Folkers for his [Kirby Highlight](https://github.com/S1SYPHOS/kirby3-highlight) plugin which built the base of this package.
## License
[MIT](./LICENSE) License © 2020-PRESENT [Johann Schopplich](https://github.com/johannschopplich)

View file

@ -0,0 +1,74 @@
<?php
namespace JohannSchopplich;
use DOMDocument;
use DOMNode;
class HTML5DOMDocument extends DOMDocument
{
/**
* Name of temporary root element for the XML parser
*/
protected string $tempRoot = 'main';
/**
* Create a new HTML5-compatible document parser
*/
public function __construct(string $version = '1.0', string $encoding = 'UTF-8')
{
// Silence libxml errors with HTML5 elements
libxml_use_internal_errors(true);
// Call parent class
parent::__construct($version, $encoding);
}
/**
* Load HTML from string, make UTF-8 compatible and add temporary root element
*/
public function loadHTML(string $source, int $options = LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD): bool
{
// `loadHTML` will treat the string as being in ISO-8859-1 unless
// told otherwise, so translate anything above the ASCII range into
// its html entity equivalent
// @see https://stackoverflow.com/questions/39148170/utf-8-with-php-domdocument-loadhtml
$convertedSource = htmlspecialchars_decode(htmlentities($source, ENT_COMPAT, 'UTF-8'), ENT_QUOTES);
// Add fake root element for XML parser because it assumes that the
// first encountered tag is the root element
// @see https://stackoverflow.com/questions/39479994/php-domdocument-savehtml-breaks-format
return parent::loadHTML("<{$this->tempRoot}>" . $convertedSource . "</{$this->tempRoot}>", $options);
}
/**
* Strip the temporarily added root element
*/
private function unwrapTempRoot(string $output): string
{
if ($this->firstChild->nodeName === $this->tempRoot) {
return substr($output, strlen($this->tempRoot) + 2, -strlen($this->tempRoot) - 4);
}
return $output;
}
/**
* Dump the internal document into a HTML string
*/
#[\ReturnTypeWillChange]
public function saveHTML(DOMNode|null $node = null, bool $entities = false): string|false
{
$html = parent::saveHTML($node);
if ($entities === false) {
$html = html_entity_decode($html);
}
if ($node === null) {
$html = $this->unwrapTempRoot($html);
}
return $html;
}
}

View file

@ -0,0 +1,49 @@
{
"name": "johannschopplich/kirby-highlighter",
"description": "Server-side syntax highlighting for Kirby CMS",
"type": "kirby-plugin",
"version": "3.1.0",
"keywords": [
"kirby",
"highlight",
"highlighter",
"hljs"
],
"license": "MIT",
"homepage": "https://github.com/johannschopplich/kirby-highlighter#readme",
"authors": [
{
"name": "Johann Schopplich",
"email": "pkg@johannschopplich.com",
"homepage": "https://johannschopplich.com"
}
],
"require": {
"getkirby/composer-installer": "^1.2",
"scrivo/highlight.php": "^9.18"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "@stable",
"getkirby/cms": "^4",
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": {
"JohannSchopplich\\": "classes/JohannSchopplich/"
}
},
"scripts": {
"fix": "php-cs-fixer fix",
"dist": "composer install --no-dev --optimize-autoloader",
"test": "phpunit"
},
"config": {
"optimize-autoloader": true,
"allow-plugins": {
"getkirby/composer-installer": true
}
},
"extra": {
"kirby-cms-path": "tests/fixtures/kirby"
}
}

View file

@ -0,0 +1,23 @@
<?php
if (!function_exists('is_base64_string_s')) {
// https://stackoverflow.com/a/51877882
function is_base64_string_s(string $str, $enc = ['UTF-8', 'ASCII'])
{
return !(($b = base64_decode($str, true)) === false) && in_array(mb_detect_encoding($b), $enc);
}
}
return [
'fromBase64' => function ($field) {
if ($field->isNotEmpty()) {
$value = trim((string)$field->value());
if (is_base64_string_s($value)) {
$field->value = base64_decode($value);
}
}
return $field;
},
];

View file

@ -0,0 +1,86 @@
<?php
use Highlight\Highlighter;
use JohannSchopplich\HTML5DOMDocument;
use Kirby\Cms\App;
return [
'kirbytext:after' => function (string|null $text) {
$kirby = App::instance();
// Parse KirbyText input as HTML document
$dom = new HTML5DOMDocument();
$dom->loadHTML($text);
// Retrieve all `pre` elements inside newly created HTML document
$preNodes = $dom->getElementsByTagName('pre');
// Bail if no `pre` elements have been found
if ($preNodes->length === 0) {
return $text;
}
// Loop through all `pre` elements
foreach ($preNodes as $preNode) {
// Ensure nothing but the `code` element exists
if ($preNode->childNodes->length !== 1) {
continue;
}
// Select direct `code` child element of `pre` block
$codeNode = $preNode->firstChild;
// Get language code if present
$language = $codeNode->getAttribute('class');
if (str_starts_with($language, 'language-')) {
$language = preg_replace('/^language-/', '', $language);
}
// Bail highlighting if language isn't set and auto detection is disabled
if (empty($language) && !$kirby->option('johannschopplich.highlighter.autodetect', false)) {
continue;
}
// Add `hljs` class to `pre` block
$preNode->setAttribute('class', $kirby->option('johannschopplich.highlighter.class', 'hljs'));
// Get raw code data to highlight
$code = $codeNode->nodeValue;
// Remove code element afterwards
$preNode->removeChild($codeNode);
// Initiate `Highlighter` and use pre-defined language code, fall
// back to language auto detection if enabled
$highlighter = new Highlighter();
// Highlight code
if (!empty($language)) {
$highlightedCode = $highlighter->highlight($language, $code);
} elseif ($kirby->option('johannschopplich.highlighter.autodetect', false)) {
$languageSubset = $kirby->option('johannschopplich.highlighter.languages', []);
if (!empty($languageSubset)) {
$highlighter->setAutodetectLanguages($languageSubset);
}
$highlightedCode = $highlighter->highlightAuto($code);
}
// Line numbering
if ($kirby->option('johannschopplich.highlighter.line-numbering', false)) {
$lines = preg_split('/\R/', $highlightedCode->value);
$lineClass = $kirby->option('johannschopplich.highlighter.line-numbering-class', 'hljs-code-line');
$highlightedCode->value = '<span class="' . $lineClass . '">' . implode("</span>\n<span class=\"$lineClass\">", $lines) . '</span>';
}
// Append highlighted wrapped in `code` block to parent `pre`
$codeNode = $dom->createDocumentFragment();
$codeNode->appendXML('<code data-language="' . $language . '">' . $highlightedCode->value . '</code>');
$preNode->appendChild($codeNode);
}
// Save all changes
$text = $dom->saveHTML(null, true);
return $text;
}
];

View file

@ -0,0 +1,27 @@
<?php
use Kirby\Cms\App;
return [
'code' => [
'attr' => [
'lang',
'language',
],
// TODO: Type as `\Kirby\Text\KirbyTag` for Kirby 4
'html' => function ($tag) {
$kirby = App::instance();
$code = $tag->value;
$language = $tag->lang ?? $tag->language;
$block = new \Kirby\Cms\Block([
'type' => 'code',
'content' => [
'language' => $language ?? 'plaintext',
'code' => is_base64_string_s($code) ? base64_decode($code) : $code,
]
]);
return $kirby->snippet('blocks/code', ['block' => $block], true);
}
]
];

View file

@ -0,0 +1,12 @@
<?php
@include_once __DIR__ . '/vendor/autoload.php';
\Kirby\Cms\App::plugin('johannschopplich/highlighter', [
'hooks' => require __DIR__ . '/extensions/hooks.php',
'fieldMethods' => require __DIR__ . '/extensions/fieldmethods.php',
'tags' => require __DIR__ . '/extensions/kirbytags.php',
'snippets' => [
'blocks/code' => __DIR__ . '/snippets/blocks/code.php'
]
]);

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="vendor/autoload.php"
colors="true"
verbose="true"
>
<testsuites>
<testsuite name="classes">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
</phpunit>

View file

@ -0,0 +1,22 @@
<?php
/** @var \Kirby\Cms\Block $block */
$highlighter = new \Highlight\Highlighter();
$language = $block->language()->value();
$code = $block->code()->fromBase64()->value();
if (empty($language) || !in_array($language, $highlighter->listRegisteredLanguages())) {
$language = 'plaintext';
}
$highlightedCode = $highlighter->highlight($language, $code)->value;
// Handle line numbering
if (option('johannschopplich.highlighter.line-numbering', false)) {
$lines = preg_split('/\R/', $highlightedCode);
$lineClass = option('johannschopplich.highlighter.line-numbering-class', 'hljs-code-line');
$highlightedCode = '<span class="' . $lineClass . '">' . implode("</span>\n<span class=\"$lineClass\">", $lines) . '</span>';
}
?>
<pre class="<?= option('johannschopplich.highlighter.class', 'hljs') ?>"><code data-language="<?= $language ?>"><?= $highlightedCode ?></code></pre>

0
site/sessions/index.html Normal file
View file

28
site/snippets/article.php Normal file
View file

@ -0,0 +1,28 @@
<article>
<h2><a href="<?= $article->url() ?>"><?= $article->title() ?></a></h2>
<p id="date"><?= $article->date()->toDate('Y-m-d') ?></p>
<p>
<div class="tagories">
<?php if ($article->categories()->isNotEmpty()): ?>
<span id="categories">
<?php foreach ($article->categories()->split() as $category): ?>
<a href="/blog/category/<?= $category ?>"><?= $category ?></a>
<?php endforeach ?>
</span>
<?php endif ?>
<?php if ($article->tags()->isNotEmpty()): ?>
<span id="tags">
<?php foreach ($article->tags()->split() as $tag): ?>
<a href="/blog/tag/<?= $tag ?>"><?= $tag ?></a>
<?php endforeach ?>
</span>
<?php endif ?>
</div>
</p>
<p>
<?= $article->text()->excerpt(300) ?>
</p>
<p><a href="<?= $article->url() ?>">Read more</a></p>
</article>

0
site/snippets/index.html Normal file
View file

54
site/snippets/layout.php Normal file
View file

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>
<?= $site->title() ?>
<?php if (!$page->isHomePage()): ?>
- <?= $page->title() ?>
<?php endif ?>
</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="<?= $site->author() ?>" />
<meta name="description" content="<?= $site->description() ?>" />
<meta name="keywords" content="<?= $site->keywords() ?>" />
<?= css('assets/build/main.css') ?>
<link rel="alternate" type="application/rss+xml" href="<?= url('feed') ?>" title="<?= $site->title() ?>" />
<link rel="apple-touch-icon-precomposed" sizes="256x256" href="/assets/img/favicon/favicon-256.png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/assets/img/favicon/favicon-144.png">
<link rel="apple-touch-icon-precomposed" sizes="128x128" href="/assets/img/favicon/favicon-128.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/assets/img/favicon/favicon-72.png">
<link rel="apple-touch-icon-precomposed" href="/assets/img/favicon/favicon.png">
<link rel="shortcut icon" href="/assets/img/favicon/favicon.png">
<script data-goatcounter="https://<?= option('analytics.goatcounter') ?>/count" async src="https://<?= option('analytics.goatcounter') ?>/count.js"></script>
</head>
<body>
<header>
<a id="title" href="/"><?= $site->title() ?></a>
<label for="show-menu" class="show-menu">Menu</label>
<input type="checkbox" id="show-menu" role="button">
<nav>
<ul>
<?php foreach ($site->menu()->toStructure() as $item): ?>
<li>
<a href="<?= $item->link()->toUrl() ?>"><?= $item->title() ?></a>
</li>
<?php endforeach ?>
</ul>
</nav>
</header>
<main>
<?= $slot ?>
</main>
<footer>
<p><?= date('Y') ?> © <?= $site->author() ?></p>
<p>
<a href="<?= page('imprint')->url() ?>">Impressum und Datenschutz</a>
</p>
</footer>
</body>
</html>

16
site/templates/about.php Normal file
View file

@ -0,0 +1,16 @@
<?php snippet('layout', slots: true) ?>
<?php slot() ?>
<h1><?= $page->title() ?></h1>
<div style="text-align: center; margin: 20px 0;">
<img src="<?= $page->image('profile.png')->url() ?>" style="width: 300px" />
<div style="font-size: 40px">
<strong><?= $page->intro_title() ?></strong>
</div>
<div style="font-size: 25px">
<?= $page->intro_text() ?>
</div>
</div>
<?= $page->text()->kirbytext() ?>
<?php endslot() ?>

View file

@ -0,0 +1,33 @@
<?php snippet('layout', slots: true) ?>
<?php slot() ?>
<h1><?= $page->title() ?></h1>
<p id="date"><?= $page->date()->toDate('Y-m-d') ?></p>
<p id="readingtime"><?= $page->readingTime() ?></p>
<p>
<div class="tagories">
<?php if ($page->categories()->isNotEmpty()): ?>
<span id="categories">
<?php foreach ($page->categories()->split() as $category): ?>
<a href="/blog/category/<?= $category ?>"><?= $category ?></a>
<?php endforeach ?>
</span>
<?php endif ?>
<?php if ($page->tags()->isNotEmpty()): ?>
<span id="tags">
<?php foreach ($page->tags()->split() as $tag): ?>
<a href="/blog/tag/<?= $tag ?>"><?= $tag ?></a>
<?php endforeach ?>
</span>
<?php endif ?>
</div>
</p>
<?= $page->text()->kirbytext() ?>
<div class="comment">
<p>I would like to hear what you think about this post. Feel free to write me a mail!</p>
<a class="btn" href="mailto:comment@mmk2410.org?subject=Reply to: <?= $page->title()?>">Reply by mail</a>
</div>
<?php endslot() ?>

27
site/templates/blog.php Normal file
View file

@ -0,0 +1,27 @@
<?php snippet('layout', slots: true) ?>
<?php slot() ?>
<h1><?= $page->title() ?></h1>
<?= $page->text()->kirbytext() ?>
<?php foreach($articles as $article): ?>
<?php snippet('article', ['article' => $article]) ?>
<?php endforeach ?>
<?php if ($articles->pagination()->hasPages()): ?>
<nav class="pagination">
<?php if ($articles->pagination()->hasNextPage()): ?>
<a class="page-item next" href="<?= $articles->pagination()->nextPageURL() ?>">
older posts
</a>
<?php endif ?>
<?php if ($articles->pagination()->hasPrevPage()): ?>
<a class="page-item prev" href="<?= $articles->pagination()->prevPageURL() ?>">
newer posts
</a>
<?php endif ?>
</nav>
<?php endif ?>
<?php endslot() ?>

View file

@ -0,0 +1,31 @@
<?php
$feed = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"></rss>');
$feed->channel->title = $site->title()->toString();
$feed->channel->description = $site->description()->toString();
$feed->channel->link = url();
$feed->channel->language = 'en-us';
$feed->channel->lastBuildDate = date(DATE_RSS);
$feed->channel->generator = 'Kirby';
$atomLink = $feed->channel->addChild('atom:link', null, 'atom');
$atomLink->addAttribute('href', url('/feed'));
$atomLink->addAttribute('rel', 'self');
$atomLink->addAttribute('type', 'application/rss+xml');
$articles = $page->children()->template('article')->sortBy('date', 'desc')->limit(10);
foreach ($articles as $article) {
$xmlArticle = $feed->channel->addChild('item');
$xmlArticle->title = $article->title()->toString();
$xmlArticle->link = url($article->url());
$xmlArticle->description = Escape::xml($article->text()->kirbytext());
$xmlArticle->pubDate = $article->date()->toDate(DATE_RSS);
$xmlArticle->guid = url($article->url());
}
$kirby->response()->type('application/rss+xml');
echo $feed->asXML();

View file

@ -0,0 +1,6 @@
<?php snippet('layout', slots: true) ?>
<?php slot() ?>
<h1><?= $page->title() ?></h1>
<?= $page->text()->kirbytext() ?>
<?php endslot() ?>

29
site/templates/home.php Normal file
View file

@ -0,0 +1,29 @@
<?php snippet('layout', slots: true) ?>
<?php slot() ?>
<header>
<h1><?= $site->title() ?></h1>
<h3><?= $page->subtitle() ?></h3>
</header>
<?= $page->text()->kirbytext() ?>
<h4>Read more from me</h4>
<?php foreach ($page->internal_menu()->toStructure() as $item): ?>
<a class="btn" href="<?= $item->link()->toUrl() ?>"><?= $item->title() ?></a>
<?php endforeach ?>
<h4>Find me on other places</h4>
<?php foreach ($page->external_menu()->toStructure() as $item): ?>
<a class="btn" href="<?= $item->link()->toUrl() ?>"><?= $item->title() ?></a>
<?php endforeach ?>
<h2>Latest Posts</h2>
<?php foreach(page('blog')->children()->listed()->flip()->limit(3) as $article): ?>
<?php snippet('article', ['article' => $article]) ?>
<?php endforeach ?>
<a class="btn" href="<?= page('blog')->url() ?>">Read more posts</a>
<?php endslot() ?>

34
site/templates/quotes.php Normal file
View file

@ -0,0 +1,34 @@
<?php snippet('layout', slots: true) ?>
<?php slot() ?>
<h1><?= $page->title() ?></h1>
<?= $page->text()->kirbytext() ?>
<?php foreach($quotes as $quote): ?>
<article>
<h2><a href="<?= $quote->url() ?>"><?= $quote->title() ?></a></h2>
<p id="date"><?= $quote->date()->toDate('Y-m-d') ?></p>
<p>
<?= $quote->text()->kirbytext() ?>
</p>
</article>
<?php endforeach ?>
<?php if ($quotes->pagination()->hasPages()): ?>
<nav class="pagination">
<?php if ($quotes->pagination()->hasNextPage()): ?>
<a class="page-item next" href="<?= $quotes->pagination()->nextPageURL() ?>">
ältere Einträge
</a>
<?php endif ?>
<?php if ($quotes->pagination()->hasPrevPage()): ?>
<a class="page-item prev" href="<?= $quotes->pagination()->prevPageURL() ?>">
neuere Einträge
</a>
<?php endif ?>
</nav>
<?php endif ?>
<?php endslot() ?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more