Compare commits
50 Commits
04648315a8
...
master
Author | SHA1 | Date | |
---|---|---|---|
2f45cbb11a | |||
a6a0f815f3 | |||
e430c3d24b | |||
fc2d5a7e3e | |||
286fda6018 | |||
26d5aef4f1 | |||
7489719607 | |||
c1a902017d | |||
c92bce611c | |||
73f6868684 | |||
8eba934270 | |||
c4e95ac10e | |||
dc16b5988a | |||
e79dbfeb91 | |||
66b7951ee2 | |||
a0a866fab5 | |||
15b1a6791c | |||
ba5552c5d0 | |||
83cbbcf5ce | |||
c80437a6b4 | |||
67c83bf85a | |||
a32d24a086 | |||
1afa6886ed | |||
c6cb5baa54 | |||
dceea8511f | |||
0e0fcec728 | |||
437d9d3743 | |||
07527f8e33 | |||
85d40b1570 | |||
2cf3906c4b | |||
f5fe72a2a1 | |||
1704ae6a5c | |||
1bb05ad1fc | |||
e1b873a2c2 | |||
e489a39328 | |||
8621a25c08 | |||
a13d4dd824 | |||
d76595456f | |||
b7433a1021 | |||
ac32959add | |||
6568c8e96d | |||
7a89c17953 | |||
86bbcfd935 | |||
707ee001f6 | |||
593e575589 | |||
4a558e5414 | |||
c193f1d5c9 | |||
bd816e74fb | |||
ff7d5f8e60 | |||
d235149057 |
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,6 +1,2 @@
|
||||
# ignore generated site
|
||||
output/
|
||||
|
||||
# Ignore compiled files
|
||||
blog/templates/index.html/header.html
|
||||
blog/templates/index.html/footer.html
|
||||
|
27
Makefile
27
Makefile
@ -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
24
README.md
Normal 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_.
|
@ -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";
|
||||
?>
|
@ -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
138
phpsg.sh
Executable 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
Reference in New Issue
Block a user