Compare commits

...

50 Commits

Author SHA1 Message Date
2f45cbb11a Use amp; in all .cfg.php files. 2025-05-17 09:48:35 +02:00
a6a0f815f3 Replace & with 'and'. 2025-05-16 19:41:10 +02:00
e430c3d24b Blog: Use & 2025-05-16 19:39:11 +02:00
fc2d5a7e3e Ignore drafts in news feeds. 2025-05-09 08:53:27 +02:00
286fda6018 Update Matrix rooms. 2025-04-10 12:45:10 +02:00
26d5aef4f1 Blog: AI post: Complete section on analogy 2025-04-08 12:57:18 +02:00
7489719607 Move blog image to main directory. 2025-03-27 11:51:38 +01:00
c1a902017d Add more to AI draft. 2025-03-27 11:41:49 +01:00
c92bce611c Menu points to poetry directory. 2025-03-25 11:06:01 +01:00
73f6868684 Move poetry page into poetry directory.
Similar to how the blog works.
2025-03-25 11:03:52 +01:00
8eba934270 Use new URLs without file extensions. 2025-03-25 10:59:16 +01:00
c4e95ac10e Add robots.txt 2025-03-22 12:40:58 +01:00
dc16b5988a Blog: update AI post 2025-03-19 13:57:15 +01:00
e79dbfeb91 Blog: Add more to AI draft. 2025-03-13 13:35:54 +01:00
66b7951ee2 Blog: Add draft for AI article. 2025-03-13 09:58:30 +01:00
a0a866fab5 Compile all files.
We don't currently resolve dependencies, so it's not possible to
actually skip these files.
2025-03-12 09:38:46 +01:00
15b1a6791c Contact page: Add Matrix info. 2025-03-10 11:00:58 +01:00
ba5552c5d0 Blog: Add "Medieval Society and the Tripartite Soul" 2025-03-08 18:32:02 +01:00
83cbbcf5ce phpsg.sh: Parallelize file deletion. 2025-03-04 11:37:28 +01:00
c80437a6b4 phpsg.sh: Add more help information. 2025-03-04 10:10:16 +01:00
67c83bf85a phpsg.sh: use realpath to simplify paths. 2025-03-04 10:01:38 +01:00
a32d24a086 phpsg.sh: Remove files which are no longer found in SOURCE_DIR. 2025-03-04 10:01:31 +01:00
1afa6886ed Move poems into their own pages. 2025-03-03 13:36:49 +01:00
c6cb5baa54 Add flag for launching PHP server. 2025-03-03 13:30:51 +01:00
dceea8511f Comment empty style. 2025-03-03 13:18:12 +01:00
0e0fcec728 Blog: add post on static site generation. 2025-02-27 13:52:55 +01:00
437d9d3743 Blog: Ignore drafts when adding pages to list. 2025-02-27 13:49:16 +01:00
07527f8e33 Fix variables in pages. 2025-02-25 13:29:47 +01:00
85d40b1570 phpsg.sh: mkdir in file processing. 2025-02-20 13:46:18 +01:00
2cf3906c4b Create output directory. 2025-02-19 08:43:10 +01:00
f5fe72a2a1 phpsg.sh: Remove extra slashes to normalize path. 2025-02-19 08:42:02 +01:00
1704ae6a5c phpsg.sh: use already existing OUT_DIR variable. 2025-02-19 07:24:07 +01:00
1bb05ad1fc README: Use italics instead of bold. 2025-02-18 10:09:35 +01:00
e1b873a2c2 README: Add more information. 2025-02-18 10:09:02 +01:00
e489a39328 phpsg.sh: Use GNU Parallel for compiling site. 2025-02-18 10:05:55 +01:00
8621a25c08 phpsg.sh: Add stricter bash options. 2025-02-18 09:29:31 +01:00
a13d4dd824 Contact: Remove #debian from IRC channel list. 2025-02-18 09:24:30 +01:00
d76595456f Remove redundant echo for unknown option. 2025-02-18 09:18:03 +01:00
b7433a1021 phpsg.sh: Use while-loop for iterating over files. 2025-02-18 09:13:13 +01:00
ac32959add phpsg.sh: filter out cfg files in find command. 2025-02-18 09:06:58 +01:00
6568c8e96d gitignore: remove references to old files. 2025-02-18 09:01:19 +01:00
7a89c17953 Add options to script. 2025-02-17 15:37:59 +01:00
86bbcfd935 Add README.md 2025-02-17 15:24:29 +01:00
707ee001f6 Add script to generate website. 2025-02-17 15:19:09 +01:00
593e575589 Move static documents to src/ 2025-02-17 14:50:12 +01:00
4a558e5414 Rename pages/ -> src/ 2025-02-17 14:47:29 +01:00
c193f1d5c9 Remove Makefile 2025-02-17 14:45:56 +01:00
bd816e74fb Add RSS file. 2025-02-17 14:26:58 +01:00
ff7d5f8e60 Add atom.xml file. 2025-02-17 14:19:08 +01:00
d235149057 Fix ordering of files. 2025-02-17 14:15:59 +01:00
362 changed files with 765 additions and 173 deletions

4
.gitignore vendored
View File

@ -1,6 +1,2 @@
# ignore generated site
output/
# Ignore compiled files
blog/templates/index.html/header.html
blog/templates/index.html/footer.html

View File

@ -1,27 +0,0 @@
OUTPUT_DIR=./output
WEB_ROOT=/var/www/themusicinnoise.net/main
.PHONY: all pages blog clean install
all: pages blog
cp -r static/* $(OUTPUT_DIR)
pages:
mkdir -p $(OUTPUT_DIR)
find pages -type f -name '*.cfg' -print0 | sort -zr | xargs -0 saait -o $(OUTPUT_DIR)/
blog:
mkdir -p $(OUTPUT_DIR)/blog
cat templates/page/header.html blog/templates/index.html/header-part.html > blog/templates/index.html/header.html
sed -i -e 's/\$${title}/Blog/' blog/templates/index.html/header.html
cat blog/templates/index.html/footer-part.html templates/page/footer.html > blog/templates/index.html/footer.html
find blog/posts -type f -name '*.cfg' -print0 | sort -zr | xargs -0 saait -o $(OUTPUT_DIR)/blog/ -t blog/templates/
clean:
rm -rf $(OUTPUT_DIR)
rm -f blog/templates/index.html/header.html
rm -f blog/templates/index.html/footer.html
install: all
mkdir -p $(WEB_ROOT)
cp -r $(OUTPUT_DIR)/* $(WEB_ROOT)/

24
README.md Normal file
View File

@ -0,0 +1,24 @@
# The Music in Noise (Source Code)
This is the source code for my personal website, [The Music in
Noise](https://themusicinnoise.net/). The website is statically generated in
spite of being written in PHP and is compiled with a helpful little script I
wrote, `phpsg.sh`, which compiles all the code to a static website.
## Building
Dependencies:
- Bash
- PHP
- GNU Parallel
Build using the `phpsg.sh` script.
## Licensing
All documents generated by the website are licensed [CC-BY-ND 4.0
International](https://creativecommons.org/licenses/by-nd/4.0/deed.en). The
source code itself is All Rights Reserved unless otherwise specified (e.g. the
build script). The main reason I publish this is so people can see _how_ I make
my website and (if they are so inspired) copy the model, _not the content_.

View File

@ -1,6 +0,0 @@
<?php
$title = "Religion & Politics";
$description = "An essay on the relationship between religion & politics, and how one's religious values may be legitimate in political conversation.";
$created = "2024-02-15";
$updated = "2024-02-15";
?>

View File

@ -1,95 +0,0 @@
<?php
$title = "Poetry";
$description = "A collection of some of my poems.";
$keywords = "poetry, religion, catholicism";
require "config.php";
require "templates/header.php";
?>
<p>I'm not truly super into writing poetry, or reading it for that
matter, but every now and then I do like to read certain special poems,
and even write some poetry of my own. That being said, it's truly not
all that different from writing song lyrics. I guess my point is don't
expect much.</p>
<ul>
<li><a href="#concedeme-un-deseo" >Concédeme Un Deseo</a></li>
<li><a href="#marys-eukaristia" >Mary's Eukaristia</a></li>
<li><a href="#mi-aportacion" >Mi Aportación</a></li>
</ul>
<h2 id="concedeme-un-deseo" >Concédeme Un Deseo</h2>
<p>Cielo de la noche,<br />
belleza como la mujer celeste.<br />
Brillo de estrellas lejanas<br />
fuegos violentos y tranquilos.</p>
<p>Tu consistencia me alivia<br />
de los vientos turbulentos.<br />
Con los cambios más mínimos<br />
como para captar mi imaginación.</p>
<p>¿Cuántos misterios guardas?<br />
¿Tantos como el Libro del Amor?<br />
¿Cuántas luces tienes<br />
que brillan como el sol?</p>
<p>Tu oscuridad no la temo<br />
porque sé que no está vacía,<br />
sino repleta de anomalías<br />
que aún no llego a comprender.</p>
<p>Concédeme ser una estrella en tu cielo.<br />
Un granito en la galaxia que ilumina la noche.<br />
Concédeme estar contigo para siempre<br />
en ese reino de paz y consistencia.</p>
<h2 id="marys-eukaristia" >Mary's Eukaristia</h2>
<p>Oh Mary, oh holy Mother, who knows our Lord so well.<br />
How did it feel to keep Him in your womb, so close to your heart?<br />
Were you sad when you had birthed Him, that He had exited from your belly?<br />
(Or) did you rejoice as you could finally hold Him in your arms?<br />
Oh Mary, oh holy Mother, teach me how to receive your Son.</p>
<p>Oh Mary, oh holy Mother, who accompanied our Lord in His Passion.<br />
How did you endure the horror of seeing your Son suffer?<br />
Yet, despite the pain that it caused in your heart, you did not look away.<br />
What sorrow you must have felt, your baby boy lying dead in your arms.<br />
Oh Mary, oh holy Mother, teach me how to receive your Son.</p>
<p>Oh Mary, oh holy Mother, who had faith in the glorious resurrection of our Lord.<br />
How great was your joy when the Good News spread like a shining light!<br />
Your face illuminated with a smile that cannot be contained.<br />
How wonderful did it feel, your Son on your tongue, as He returned to your belly, from whence He came?<br />
Oh Mary, oh holy Mother, teach me how to receive your Son.</p>
<p>Amen.</p>
<h2 id="mi-aportacion" >Mi Aportación</h2>
<p>Cuando te ignoraba, Señor,<br />
no te olvidabas de mí.<br />
Cuando erraba, Señor,<br />
me intentaste corregir.<br />
Al arrepentirme, Señor,<br />
tuviste misericordia de mí.</p>
<p>Yo soy un inmerecido<br />
de tu caridad y tu amor.<br />
Que aunque yo no te de nada<br />
me das todo lo que preciso.<br />
¿Cómo puedo yo pagar<br />
mi deuda contigo?</p>
<p>Tratar a mis hermanos<br />
con caridad y amor.<br />
Mostrarles la misma misericordia<br />
que mostraste ante mi rebelión.<br />
Corregirles fraternalmente<br />
pensando en su salvación.</p>
<p>Aun no es suficiente,<br />
pero es mi aportación.</p>
<?php
require "templates/footer.php"
?>

138
phpsg.sh Executable file
View File

@ -0,0 +1,138 @@
#!/bin/bash
# Copyright (C) 2025 Nicolás Ortega Froysa <nicolas@ortegas.org> All rights reserved.
# Author: Nicolás Ortega Froysa <nicolas@ortegas.org>
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not
# claim that you wrote the original software. If you use this software
# in a product, an acknowledgment in the product documentation would be
# appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must not be
# misrepresented as being the original software.
#
# 3. This notice may not be removed or altered from any source
# distribution.
set -euo pipefail
SOURCE_DIR="src"
OUTPUT_DIR="output"
JOBS=1
SERVER_FLAG=0
function print_usage() {
echo "$0 [-o <output dir>] [-s <source dir>] [-j <num>]"
echo "$0 -S [-o <output dir>]"
}
function print_help() {
printf "PHP Site Generator\n\n"
printf "SYNOPSIS:\n"
print_usage
printf "\nOPTIONS:\n"
printf "\t-o <output dir> Output directory\n"
printf "\t-s <source dir> Source directory\n"
printf "\t-j <num> Number of jobs to run\n"
printf "\t-S Run a server on localhost:8080\n"
printf "\t-h Show help information\n"
printf "\n"
}
while getopts "o:s:j:Sh" opt
do
case "$opt" in
o)
OUTPUT_DIR="$(realpath --relative-base=./ "${OPTARG}")"
;;
s)
SOURCE_DIR="$(realpath --relative-base=./ "${OPTARG}")"
;;
j)
JOBS="${OPTARG}"
if ! [[ $JOBS =~ ^[0-9]+$ ]]
then
>&2 echo "Jobs option '$JOBS' is not an integer."
print_usage
exit 1
fi
;;
S)
SERVER_FLAG=1
;;
h)
print_help
exit
;;
*)
print_usage
exit 1
;;
esac
done
if [ $SERVER_FLAG -eq 1 ]
then
php -S localhost:8080 -t "$OUTPUT_DIR"
exit
fi
# Make these variables visible within parallel
export OUTPUT_DIR
export SOURCE_DIR
function process_file() {
local file="$1"
local DEST_FILE="${OUTPUT_DIR}/${file/#${SOURCE_DIR}\//}"
local DEST_DIR
if [[ $file = *.php ]]
then
DEST_FILE="${DEST_FILE::-4}"
DEST_DIR="$(dirname "$DEST_FILE")"
if ! [ -d "$DEST_DIR" ]
then
mkdir -p "$DEST_DIR"
fi
echo -n "Generating $DEST_FILE ... "
php "$file" > "$DEST_FILE"
echo "done"
else
DEST_DIR="$(dirname "$DEST_FILE")"
if ! [ -d "$DEST_DIR" ]
then
mkdir -p "$DEST_DIR"
fi
echo -n "Copying target $DEST_FILE ... "
cp "$file" "$DEST_FILE"
echo "done"
fi
}
function delete_file() {
local file="$1"
FILE_PATH=$(realpath --relative-base=./ "$OUTPUT_DIR/$file")
echo "Deleting file $FILE_PATH"
rm "$FILE_PATH"
}
# Make functions usable to parallel
export -f process_file
export -f delete_file
find "$SOURCE_DIR" -type f -not -name '*.cfg.php' |
parallel -j"${JOBS}" process_file
SOURCE_FILE_LIST=$(cd "$SOURCE_DIR" && find . -type f -and -not -name '*.cfg.php' | sed 's/.php$//')
OUTPUT_FILE_LIST=$(cd "$OUTPUT_DIR" && find . -type f)
echo "${SOURCE_FILE_LIST[@]}" "${OUTPUT_FILE_LIST[@]}" | tr ' ' '\n' | sort | uniq -u |
parallel -j"${JOBS}" delete_file

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