Initial commit

This commit is contained in:
Oliver Davies 2024-08-21 12:00:00 +01:00
commit ccd13c62a2
18 changed files with 3795 additions and 0 deletions

17
.editorconfig Normal file
View file

@ -0,0 +1,17 @@
# This file is used by editors and IDEs to unify coding standards
# @see http://EditorConfig.org
# @standards PHP: http://www.php-fig.org/psr/psr-2/
root = true
# Default configuration (applies to all file types)
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_size = 4
indent_style = space
# Markdown customizations
[*.md]
trim_trailing_whitespace = false

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

27
.githooks/prepare-commit-msg Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs.
# Load the issue ID from an `.issue-id` file within the project and replace the
# `ISSUE_ID` placeholder within a Git commit message.
#
# For example, running `echo "OD-123" > .issue-id` will add `Refs: OD-123` to
# the commit message.
#
# This also works with multiple issue IDs in the same string, e.g.
# "OD-123 OD-456", or IDs on multiple lines.
set -o errexit
set -o nounset
set -o pipefail
PROJECT_DIR=$(git rev-parse --show-toplevel)
ISSUE_FILE="$PROJECT_DIR/.issue-id"
if [ -f "${ISSUE_FILE}" ]; then
ISSUE_IDS=$(cat "${ISSUE_FILE}" | tr '\n' ',' | tr ' ' ',' | sed 's/,$//' | sed 's/,/, /g')
if [ -n "${ISSUE_IDS}" ]; then
sed -i.bak "s/# Refs:/Refs: $ISSUE_IDS/" "$1"
fi
fi

12
.gitignore vendored Normal file
View file

@ -0,0 +1,12 @@
# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs.
/.phpunit.cache
/.phpunit.result.cache
/output_*/
/vendor/
# Front-end assets.
node_modules
source/build
/.direnv/

5
.yamlfmt.yaml Normal file
View file

@ -0,0 +1,5 @@
---
formatter:
type: basic
include_document_start: true
retain_line_breaks_single: true

View file

@ -0,0 +1,6 @@
---
sculpin_content_types:
notes:
permalink: :basename/
posts:
enabled: false

View file

@ -0,0 +1,5 @@
---
name: zet.oliverdavies.uk
locale: en
github:
url: https://github.com/opdavies/zet.oliverdavies.uk

View file

@ -0,0 +1,3 @@
---
imports:
- sculpin_site.yml

9
build-configs.yaml Normal file
View file

@ -0,0 +1,9 @@
---
name: zet.oliverdavies.uk
template: sculpin-site
parameters:
nix:
devshell:
packages:
- php81
- php81Packages.composer

25
composer.json Normal file
View file

@ -0,0 +1,25 @@
{
"name": "opdavies/zet.oliverdavies.uk",
"description": "A skeleton Sculpin site.",
"license": "proprietory",
"authors": [
{
"name": "Oliver Davies",
"homepage": "https://www.oliverdavies.uk"
}
],
"require": {
"sculpin/sculpin": "^3.0"
},
"cripts": {},
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
}
},
"config": {
"allow-plugins": {
"sculpin/sculpin-theme-composer-plugin": true
}
}
}

3527
composer.lock generated Normal file

File diff suppressed because it is too large Load diff

27
flake.lock Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1723991338,
"narHash": "sha256-Grh5PF0+gootJfOJFenTTxDTYPidA3V28dqJ/WV7iis=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8a3354191c0d7144db9756a74755672387b702ba",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

19
flake.nix Normal file
View file

@ -0,0 +1,19 @@
# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs.
{
description = "A Nix Flake for sculpin-skeleton";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) mkShell;
in {
devShells.${system}.default =
mkShell { buildInputs = with pkgs; [ php81 php81Packages.composer ]; };
formatter.${system} = pkgs.nixfmt;
};
}

48
run Executable file
View file

@ -0,0 +1,48 @@
#!/usr/bin/env bash
# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs.
set -o errexit
set -o nounset
set -o pipefail
PATH="${PATH}:./vendor/bin"
# Generate the site.
function generate {
local args=()
if [[ "${APP_ENV:-}" == "production" ]]; then
args=(--env="prod")
else
args=(--server --watch)
fi
sculpin generate "${args[@]}" "${@}"
}
function help {
printf "%s <task> [args]\n\nTasks:\n" "${0}"
compgen -A function | grep -v "^_" | cat -n
printf "\nExtended help:\n Each task has comments for general usage\n"
}
function setup {
composer install
}
# Start the project.
function start {
sculpin generate --server --watch "${@}"
}
# Include any local tasks.
# https://stackoverflow.com/a/6659698
[[ -e "${BASH_SOURCE%/*}/run.local" ]] && source "${BASH_SOURCE%/*}/run.local"
TIMEFORMAT="Task completed in %3lR"
time "${@:-help}"
# vim: ft=bash

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="{{ site.locale|default('en') }}">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ site.name|default('Sculpin Skeleton') }}</title>
</head>
<body>
{% block body %}
<h1>{% block page_title %}{{ page.title }}{% endblock %}</h1>
{% block content_wrapper %}
{% block content %}{% endblock %}
{% endblock %}
<hr />
<footer>
<p>This website is open source. <a href="{{ site.github.url }}/edit/main/source/{{ page.relative_pathname }}">Improve this page</a>.</p>
</footer>
{% endblock %}
</body>
</html>

View file

@ -0,0 +1,23 @@
{% extends "base" %}
{% block body %}
<nav>
<a href="/">Home</a>
</nav>
{{ parent() }}
{% endblock %}
{% block content_wrapper %}
{% block content %}{% endblock %}
{% if page.tags is not empty %}
<h2>Tags</h2>
<ul>
{% for tag in page.tags|sort %}
<li>{{ tag }}</li>
{% endfor %}
</ul>
{% endif %}
{% endblock %}

View file

@ -0,0 +1 @@
{% extends "base" %}

16
source/index.html.twig Normal file
View file

@ -0,0 +1,16 @@
---
layout: page
title: Zettelkasten for Oliver Davies (opdavies)
use: [notes]
---
<ul>
{% for note in data.notes %}
<li>
<a href="{{ note.url }}">
{{ note.date|date('c') }}:
{{ note.title }}
</a>
</li>
{% endfor %}
</ul>