From 6a2f7e3d34a51e6356c839a2c1a5eb2471427d37 Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Tue, 3 Oct 2023 19:03:44 +0200 Subject: [PATCH] replace index.php with index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The index doesn’t have to be a PHP file since there is no need to generate the list of chapters anew every time the ToC is opened. Instead, the list of chapters is generated once, ahead of time, and saved to the index.html. As an added bonus, this allows the ToC to be generated and used as a local file. --- .gitignore | 1 + 01-Unlikely_Encounter-Annie-intro.html | 2 +- 02-Wake_Up-Jack_intro.html | 2 +- 03-A_Simple_Errand-Annie_library.html | 2 +- 05-Eventful_Evening-secret_organization.html | 2 +- 06-Library_At_Night.html | 2 +- deployment-script.sh | 15 +++++++++++++++ ga-Who_Died_Today-Emily_intro.html | 2 +- index.php => html_resources/index_template.html | 11 +++-------- html_resources/layout.html | 2 +- html_resources/template.html | 2 +- ka--finding_the_train.html | 2 +- ma-Escape_From_Dome_City.html | 2 +- mb-First_Steps_Outside.html | 2 +- oa--Emily_lab_incident.html | 2 +- pa-Basic_Needs.html | 2 +- ra--Emily_first_contact.html | 2 +- va-Alone-Lena_death.html | 2 +- za--story-end-outline.html | 2 +- zb--reaching_nova_metropolis.html | 2 +- zd--Nova_Metropolis.html | 2 +- zy-Landing_Troubles.html | 2 +- zz--end.html | 2 +- 23 files changed, 39 insertions(+), 28 deletions(-) create mode 100644 .gitignore create mode 100644 deployment-script.sh rename index.php => html_resources/index_template.html (58%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e90722f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/index.html diff --git a/01-Unlikely_Encounter-Annie-intro.html b/01-Unlikely_Encounter-Annie-intro.html index 80b0d2b..777a6f8 100644 --- a/01-Unlikely_Encounter-Annie-intro.html +++ b/01-Unlikely_Encounter-Annie-intro.html @@ -1,4 +1,4 @@ - Unlikely Encounter + Unlikely Encounter

Unlikely Encounter

diff --git a/02-Wake_Up-Jack_intro.html b/02-Wake_Up-Jack_intro.html index a9ea386..4c8fa68 100644 --- a/02-Wake_Up-Jack_intro.html +++ b/02-Wake_Up-Jack_intro.html @@ -1,4 +1,4 @@ - Wake Up! + Wake Up!

Wake Up!

diff --git a/03-A_Simple_Errand-Annie_library.html b/03-A_Simple_Errand-Annie_library.html index 22e0545..0d2f7c2 100644 --- a/03-A_Simple_Errand-Annie_library.html +++ b/03-A_Simple_Errand-Annie_library.html @@ -1,4 +1,4 @@ - A Simple Errand + A Simple Errand

A Simple Errand

diff --git a/05-Eventful_Evening-secret_organization.html b/05-Eventful_Evening-secret_organization.html index 9644719..5bc05e8 100644 --- a/05-Eventful_Evening-secret_organization.html +++ b/05-Eventful_Evening-secret_organization.html @@ -1,4 +1,4 @@ - Eventful Evening + Eventful Evening

Eventful Evening

diff --git a/06-Library_At_Night.html b/06-Library_At_Night.html index 5a3e8ca..0a278e5 100644 --- a/06-Library_At_Night.html +++ b/06-Library_At_Night.html @@ -1,4 +1,4 @@ - Library At Night + Library At Night

Library At Night

diff --git a/deployment-script.sh b/deployment-script.sh new file mode 100644 index 0000000..bd78367 --- /dev/null +++ b/deployment-script.sh @@ -0,0 +1,15 @@ +cp html_resources/index_template.html index.html + +function genlinks { + for FILE in $(find . -maxdepth 1 -type f -name "*.html"); do + echo -ne "

  • \n" + grep -oe ".*" $FILE | sed -e 's/ / /;s| ||' + echo "
  • " + done +} + +sed -ne '/ /q;p' html_resources/index_template.html > index.html +# for some fucking reason, there is no way to tell wc to only print the number so we do cat abuse to get rid of the filename +LINE_NUMBER=$(("$(cat index.html | wc -l)"+2)) +genlinks >> index.html +tail -n+$LINE_NUMBER html_resources/index_template.html >> index.html diff --git a/ga-Who_Died_Today-Emily_intro.html b/ga-Who_Died_Today-Emily_intro.html index 9069004..c760d45 100644 --- a/ga-Who_Died_Today-Emily_intro.html +++ b/ga-Who_Died_Today-Emily_intro.html @@ -1,4 +1,4 @@ - Who died today? + Who died today?

    Who Died Today?

    diff --git a/index.php b/html_resources/index_template.html similarity index 58% rename from index.php rename to html_resources/index_template.html index ce954b2..3ee282e 100644 --- a/index.php +++ b/html_resources/index_template.html @@ -1,5 +1,5 @@ - <Post Apocalypse Story< -

    <Post Apocalypse Story<

    + <Post Apocalypse Story> +

    <Post Apocalypse Story>

    Yeah, there is no real title yet.

    @@ -7,11 +7,6 @@ Table of Contents:

    diff --git a/html_resources/layout.html b/html_resources/layout.html index 6f9293f..2a16c51 100644 --- a/html_resources/layout.html +++ b/html_resources/layout.html @@ -5,7 +5,7 @@ - +

    Layout Test Page

    diff --git a/html_resources/template.html b/html_resources/template.html index 0852420..21118e6 100644 --- a/html_resources/template.html +++ b/html_resources/template.html @@ -1,2 +1,2 @@ - Chapter Name + Chapter Name diff --git a/ka--finding_the_train.html b/ka--finding_the_train.html index acbecd6..91d3bec 100644 --- a/ka--finding_the_train.html +++ b/ka--finding_the_train.html @@ -1,4 +1,4 @@ - <chapter name> + <chapter name>

    <chapter name>

    diff --git a/ma-Escape_From_Dome_City.html b/ma-Escape_From_Dome_City.html index 05cb7a6..9fa3cf0 100644 --- a/ma-Escape_From_Dome_City.html +++ b/ma-Escape_From_Dome_City.html @@ -1,4 +1,4 @@ - Escape From Dome City + Escape From Dome City

    Escape From Dome City

    diff --git a/mb-First_Steps_Outside.html b/mb-First_Steps_Outside.html index 8901dda..48a4ed3 100644 --- a/mb-First_Steps_Outside.html +++ b/mb-First_Steps_Outside.html @@ -1,4 +1,4 @@ - First Steps Outside + First Steps Outside

    First Steps Outside

    diff --git a/oa--Emily_lab_incident.html b/oa--Emily_lab_incident.html index 77541c9..3074da1 100644 --- a/oa--Emily_lab_incident.html +++ b/oa--Emily_lab_incident.html @@ -1,4 +1,4 @@ - <Emily Lab Incident> + <Emily Lab Incident>

    <Emily Lab Incident>

    diff --git a/pa-Basic_Needs.html b/pa-Basic_Needs.html index 27c5511..d4a7b63 100644 --- a/pa-Basic_Needs.html +++ b/pa-Basic_Needs.html @@ -1,4 +1,4 @@ - Basic Needs + Basic Needs

    Basic Needs

    diff --git a/ra--Emily_first_contact.html b/ra--Emily_first_contact.html index aca2c17..4ce0eb7 100644 --- a/ra--Emily_first_contact.html +++ b/ra--Emily_first_contact.html @@ -1,4 +1,4 @@ - <Emily First Contact> + <Emily First Contact>

    <Emily First Contact>

    diff --git a/va-Alone-Lena_death.html b/va-Alone-Lena_death.html index 3334ec5..fc662d8 100644 --- a/va-Alone-Lena_death.html +++ b/va-Alone-Lena_death.html @@ -1,4 +1,4 @@ - Alone + Alone

    Alone

    diff --git a/za--story-end-outline.html b/za--story-end-outline.html index 71f1604..8773f51 100644 --- a/za--story-end-outline.html +++ b/za--story-end-outline.html @@ -1,4 +1,4 @@ - <Story End Outline> + <Story End Outline>

    <Story End Outline>

    This is not intended to be a chapter. It's more of an overview for diff --git a/zb--reaching_nova_metropolis.html b/zb--reaching_nova_metropolis.html index 301386c..e1cd99f 100644 --- a/zb--reaching_nova_metropolis.html +++ b/zb--reaching_nova_metropolis.html @@ -1,4 +1,4 @@ - <Reaching Nova Metropolis> + <Reaching Nova Metropolis>

    <Reaching Nova Metropolis>

    diff --git a/zd--Nova_Metropolis.html b/zd--Nova_Metropolis.html index 45d4095..96e164a 100644 --- a/zd--Nova_Metropolis.html +++ b/zd--Nova_Metropolis.html @@ -1,4 +1,4 @@ - <Nova Metropolis> + <Nova Metropolis>

    <Nova Metropolis>

    Michelle continues driving the bus for a couple hours without further diff --git a/zy-Landing_Troubles.html b/zy-Landing_Troubles.html index f69e22c..2979fdb 100644 --- a/zy-Landing_Troubles.html +++ b/zy-Landing_Troubles.html @@ -1,4 +1,4 @@ - Landing Troubles + Landing Troubles

    Landing Troubles

    The escape pod Is there a word that makes this sound diff --git a/zz--end.html b/zz--end.html index a39baba..2aaf33b 100644 --- a/zz--end.html +++ b/zz--end.html @@ -1,4 +1,4 @@ - <End> + <End>

    <End>