From de9bbfdb8f0d3b366e76a5cc775690f7315c740f Mon Sep 17 00:00:00 2001 From: 53hornet Date: Fri, 10 Dec 2021 23:17:42 -0500 Subject: feat: custom routing, no required php in posts --- contact/index.php | 5 +++- feed.php | 16 +++++------ hireme/index.php | 5 +++- includes/foot.php | 9 ++++++ includes/head.php | 9 +----- includes/render_index.php | 24 ++++++++++++++++ index.php | 33 ++++------------------ info/index.php | 6 +++- links/index.php | 14 ++++++++- payments/index.php | 1 - posts/2019-04-06-why-have-a-website-in-2019.php | 9 ++---- ...6-07-how-to-start-and-drive-a-hudson-hornet.php | 9 ++---- ...best-way-to-transfer-gopro-files-with-linux.php | 9 ++---- posts/2019-07-04-yabs-yet-another-bad-shop.php | 9 ++---- ...7-21-dancing-the-shag-and-the-new-lion-king.php | 9 ++---- .../2019-07-28-i-finally-found-a-drink-i-like.php | 9 ++---- posts/2019-08-11-marrying-my-best-friend.php | 8 +----- posts/2019-08-30-keep-right-except-to-pass.php | 9 ++---- ...09-28-my-preferred-method-for-data-recovery.php | 9 ++---- posts/2020-04-10-the-obligatory-covid-19-post.php | 9 ++---- posts/2020-04-10-wedding-photos-are-here.php | 9 ++---- posts/2020-07-11-why-computer-science-at-w-m.php | 9 ++---- posts/2020-07-26-now-this-is-a-minimal-install.php | 9 ++---- posts/2020-11-30-titanics-last-signals.php | 9 ++---- posts/2020-12-01-the-guides.php | 9 ++---- posts/2020-12-04-aoc-2020-day-1-in-cbm-basic.php | 9 ++---- ...rint-planning-from-a-certified-scrum-master.php | 9 ++---- ...-why-does-everyone-use-adobe-acrobat-reader.php | 9 ++---- posts/2020-12-29-antivirus-software-is-a-hack.php | 9 ++---- posts/2021-01-15-adam-s-2020-reading-list.php | 9 ++---- ...on-zfs-a-zpool-of-mirror-vdevs-the-easy-way.php | 9 ++---- ...2021-01-28-undefined-javasript-is-undefined.php | 9 ++---- ...s-a-bamf-and-proof-that-organists-are-metal.php | 9 ++---- ...ow-to-automate-certbot-renewal-with-haproxy.php | 9 ++---- ...-20-how-to-make-your-website-boring-and-why.php | 9 ++---- ...-designers-please-don-t-animate-page-titles.php | 9 ++---- ...-scripting-and-bulk-renaming-files-with-vim.php | 9 ++---- ...0-01-shroud-your-rad-for-an-ice-cold-hudson.php | 9 ++---- posts/2021-10-12-altruistic-angelshark.php | 9 ++---- ...22-forced-downloads-in-the-browser-via-http.php | 9 ++---- ...-your-own-ssh-tarpit-in-rust-with-async-std.php | 9 ++---- 41 files changed, 134 insertions(+), 266 deletions(-) create mode 100644 includes/foot.php create mode 100644 includes/render_index.php diff --git a/contact/index.php b/contact/index.php index 4e15b3d..5d1cc76 100644 --- a/contact/index.php +++ b/contact/index.php @@ -1,7 +1,7 @@ +

Contact Me

atc@53hor.net @@ -30,3 +30,6 @@ You may read more in the

If you want to hire me or have a business inquiry, here is a Google Voice number. Please understand that all calls and text messages are screened for spam by Google before I pick up.

+ diff --git a/feed.php b/feed.php index c8f51ef..f76377c 100644 --- a/feed.php +++ b/feed.php @@ -12,16 +12,14 @@ https://www.53hor.net !empty($post) && $post != '.' && $post != '..'); - foreach (array_reverse($posts) as $post) { - if (!empty($post) && $post != '.' && $post != '..') { - $post_name = explode('/', $post)[2]; - include($post); - printf('https://www.53hor.net/posts/%s%s', $post_name, $title); - } - } + foreach ($posts as &$post) { + $title = str_replace('

', '', fgets(fopen("./posts/$post", 'r'))); + $title = str_replace('

', '', $title); + $post = str_replace('.php', '', $post); + printf('https://www.53hor.net/posts/%s%s', $post, $title); } ?> diff --git a/hireme/index.php b/hireme/index.php index a7151b3..e366e32 100644 --- a/hireme/index.php +++ b/hireme/index.php @@ -1,7 +1,7 @@ +

Carpenter Tech

My name is Adam Carpenter and I am a freelance, general-purpose computer programmer. @@ -42,3 +42,6 @@ include('cv.html');

+ diff --git a/includes/foot.php b/includes/foot.php new file mode 100644 index 0000000..c128cc1 --- /dev/null +++ b/includes/foot.php @@ -0,0 +1,9 @@ + +
+ +
+ +
+ + + diff --git a/includes/head.php b/includes/head.php index ba16fb0..4b95e2f 100644 --- a/includes/head.php +++ b/includes/head.php @@ -200,13 +200,6 @@
- %s

', $title); - } - ?> diff --git a/includes/render_index.php b/includes/render_index.php new file mode 100644 index 0000000..d90627b --- /dev/null +++ b/includes/render_index.php @@ -0,0 +1,24 @@ +
+ +
+ +

+ The World Wide Web pages of Adam Carpenter (53hornet) +

+ +
diff --git a/index.php b/index.php index 9813128..2781c7a 100644 --- a/index.php +++ b/index.php @@ -1,31 +1,10 @@ -
- -
+if (($post = strtok($_SERVER['REQUEST_URI'], '/')) && !empty($post)) { + include("./posts/$post.php"); +} else { + include('./includes/render_index.php'); +} -

- The World Wide Web pages of Adam Carpenter (53hornet) -

- - +include('./includes/foot.php'); diff --git a/info/index.php b/info/index.php index 65b3f9b..a2ca53b 100644 --- a/info/index.php +++ b/info/index.php @@ -1,7 +1,7 @@ +

Info

My name is Adam Carpenter (on some sites I'm @@ -93,3 +93,7 @@ include('../includes/head.php'); [Valid RSS] + + diff --git a/links/index.php b/links/index.php index a5cf83f..3012a69 100644 --- a/links/index.php +++ b/links/index.php @@ -1,8 +1,20 @@ +

Egress Links

If you're going to leave my site to go somewhere else on the web, I recommend linking out via one of these. This is my curated collection of awesome sites, resources, and online assets.

+ +

Automotive

+ +

*nix

+ + + + diff --git a/payments/index.php b/payments/index.php index 9a7d037..cb6c58f 100644 --- a/payments/index.php +++ b/payments/index.php @@ -1,5 +1,4 @@ diff --git a/posts/2019-04-06-why-have-a-website-in-2019.php b/posts/2019-04-06-why-have-a-website-in-2019.php index b49d049..3e7d15b 100644 --- a/posts/2019-04-06-why-have-a-website-in-2019.php +++ b/posts/2019-04-06-why-have-a-website-in-2019.php @@ -1,10 +1,5 @@ - +

Why Have a Web Site in 2019?

+
Adam, why on earth do you have a website? Wait... Is this a diff --git a/posts/2019-06-07-how-to-start-and-drive-a-hudson-hornet.php b/posts/2019-06-07-how-to-start-and-drive-a-hudson-hornet.php index 53e0f40..20bfb9c 100644 --- a/posts/2019-06-07-how-to-start-and-drive-a-hudson-hornet.php +++ b/posts/2019-06-07-how-to-start-and-drive-a-hudson-hornet.php @@ -1,10 +1,5 @@ - +

How to Start and Drive a Hudson Hornet

+

My understanding is there are a lot of people out there for whom driving diff --git a/posts/2019-07-04-the-best-way-to-transfer-gopro-files-with-linux.php b/posts/2019-07-04-the-best-way-to-transfer-gopro-files-with-linux.php index 34685de..6e3d9eb 100644 --- a/posts/2019-07-04-the-best-way-to-transfer-gopro-files-with-linux.php +++ b/posts/2019-07-04-the-best-way-to-transfer-gopro-files-with-linux.php @@ -1,10 +1,5 @@ - +

Offloading GoPro Footage the Easy Way!

+

Transferring files off of most cameras to a Linux computer isn't all diff --git a/posts/2019-07-04-yabs-yet-another-bad-shop.php b/posts/2019-07-04-yabs-yet-another-bad-shop.php index 9594369..9b684b5 100644 --- a/posts/2019-07-04-yabs-yet-another-bad-shop.php +++ b/posts/2019-07-04-yabs-yet-another-bad-shop.php @@ -1,10 +1,5 @@ - +

YABS: Yet Another Bad Shop

+

Today I received a text message from a local mechanic/auto shop asking me to leave them a Google review. It was an automated message from a diff --git a/posts/2019-07-21-dancing-the-shag-and-the-new-lion-king.php b/posts/2019-07-21-dancing-the-shag-and-the-new-lion-king.php index bdced0a..02da9b2 100644 --- a/posts/2019-07-21-dancing-the-shag-and-the-new-lion-king.php +++ b/posts/2019-07-21-dancing-the-shag-and-the-new-lion-king.php @@ -1,10 +1,5 @@ - +

Dancing the Shag and The [New] Lion Ling

+

Not all of my posts are huge, and they probably shouldn't be. Amy and I had a really great time yesterday at Two Left Feet Dance Studio, diff --git a/posts/2019-07-28-i-finally-found-a-drink-i-like.php b/posts/2019-07-28-i-finally-found-a-drink-i-like.php index a73de9e..9e6d5a0 100644 --- a/posts/2019-07-28-i-finally-found-a-drink-i-like.php +++ b/posts/2019-07-28-i-finally-found-a-drink-i-like.php @@ -1,10 +1,5 @@ - +

Finally Found a Drink I Like

+

Anyone who knows me even slightly well probably knows that I don't drink. And it's not out of moral obligation or anything like that. I diff --git a/posts/2019-08-11-marrying-my-best-friend.php b/posts/2019-08-11-marrying-my-best-friend.php index 83bde5b..ac18e55 100644 --- a/posts/2019-08-11-marrying-my-best-friend.php +++ b/posts/2019-08-11-marrying-my-best-friend.php @@ -1,11 +1,5 @@ -

I Married My Best Friend!

+

It was an inexplicable mixture of joy and butterflies getting to marry my best friend. It was truly like a dream come true, so much so that it diff --git a/posts/2019-08-30-keep-right-except-to-pass.php b/posts/2019-08-30-keep-right-except-to-pass.php index 660733a..cf4aa85 100644 --- a/posts/2019-08-30-keep-right-except-to-pass.php +++ b/posts/2019-08-30-keep-right-except-to-pass.php @@ -1,10 +1,5 @@ - +

Left Lane is for Passing, Not Cruising

+

Greetings fellow drivers of Hampton Roads. You may have noticed a new sign on I264 today that befuddled or confused you. It went something diff --git a/posts/2019-09-28-my-preferred-method-for-data-recovery.php b/posts/2019-09-28-my-preferred-method-for-data-recovery.php index d7b68d2..77efd5f 100644 --- a/posts/2019-09-28-my-preferred-method-for-data-recovery.php +++ b/posts/2019-09-28-my-preferred-method-for-data-recovery.php @@ -1,10 +1,5 @@ - +

How I Do Data Recovery

+

This week Amy plugged in her flash drive to discover that there were no diff --git a/posts/2020-04-10-the-obligatory-covid-19-post.php b/posts/2020-04-10-the-obligatory-covid-19-post.php index 6cdabe9..711c3f0 100644 --- a/posts/2020-04-10-the-obligatory-covid-19-post.php +++ b/posts/2020-04-10-the-obligatory-covid-19-post.php @@ -1,10 +1,5 @@ - +

Obligatory COVID-19 Post

+

We're alive! All three of us: Amy, Clementine, and myself. We're doing what we do best and that is being hermits with zero social contact. diff --git a/posts/2020-04-10-wedding-photos-are-here.php b/posts/2020-04-10-wedding-photos-are-here.php index 59344d6..36b14e1 100644 --- a/posts/2020-04-10-wedding-photos-are-here.php +++ b/posts/2020-04-10-wedding-photos-are-here.php @@ -1,10 +1,5 @@ - +

Wedding Photo Debacle

+

At long last we have all of our wedding photos together! Unfortunately a diff --git a/posts/2020-07-11-why-computer-science-at-w-m.php b/posts/2020-07-11-why-computer-science-at-w-m.php index f2fb3d1..42c6cfb 100644 --- a/posts/2020-07-11-why-computer-science-at-w-m.php +++ b/posts/2020-07-11-why-computer-science-at-w-m.php @@ -1,10 +1,5 @@ - +

Why Computer Science at William and Mary

+

Recently a rising high-school senior asked for input on what going to diff --git a/posts/2020-07-26-now-this-is-a-minimal-install.php b/posts/2020-07-26-now-this-is-a-minimal-install.php index 3165b71..7835e0b 100644 --- a/posts/2020-07-26-now-this-is-a-minimal-install.php +++ b/posts/2020-07-26-now-this-is-a-minimal-install.php @@ -1,10 +1,5 @@ - +

Now This is a Minimal Install!

+

I just got done configuring Poudriere on Freebsd 12.1-RELEASE. The diff --git a/posts/2020-11-30-titanics-last-signals.php b/posts/2020-11-30-titanics-last-signals.php index 03c0b96..93978d4 100644 --- a/posts/2020-11-30-titanics-last-signals.php +++ b/posts/2020-11-30-titanics-last-signals.php @@ -1,10 +1,5 @@ - +

Titanic's Last Signals

+

I forgot to post this back in April but 108 years ago, a chilling and heroic conversation was had over the airwaves. This is a fascinating way diff --git a/posts/2020-12-01-the-guides.php b/posts/2020-12-01-the-guides.php index a3629be..fb9e5a3 100644 --- a/posts/2020-12-01-the-guides.php +++ b/posts/2020-12-01-the-guides.php @@ -1,10 +1,5 @@ - +

𝔗𝔥𝔢 𝔊𝔲𝔦𝔡𝔢𝔰

+

This is partly satirical and purposefully strange to be humorous. These diff --git a/posts/2020-12-04-aoc-2020-day-1-in-cbm-basic.php b/posts/2020-12-04-aoc-2020-day-1-in-cbm-basic.php index 5196d2c..bb2e057 100644 --- a/posts/2020-12-04-aoc-2020-day-1-in-cbm-basic.php +++ b/posts/2020-12-04-aoc-2020-day-1-in-cbm-basic.php @@ -1,10 +1,5 @@ - +

AOC 2020 Day 1 in CBM Basic

+

I implemented the diff --git a/posts/2020-12-08-useful-sprint-planning-from-a-certified-scrum-master.php b/posts/2020-12-08-useful-sprint-planning-from-a-certified-scrum-master.php index 77aebdf..1f8618b 100644 --- a/posts/2020-12-08-useful-sprint-planning-from-a-certified-scrum-master.php +++ b/posts/2020-12-08-useful-sprint-planning-from-a-certified-scrum-master.php @@ -1,10 +1,5 @@ - +

Useful Sprint Planning from a Certified Scrum Master

+

This is a small collection of sprint planning/story points allocation diff --git a/posts/2020-12-22-why-does-everyone-use-adobe-acrobat-reader.php b/posts/2020-12-22-why-does-everyone-use-adobe-acrobat-reader.php index bb384f2..b2fee03 100644 --- a/posts/2020-12-22-why-does-everyone-use-adobe-acrobat-reader.php +++ b/posts/2020-12-22-why-does-everyone-use-adobe-acrobat-reader.php @@ -1,10 +1,5 @@ - +

Why Does Everyone Use Adobe Acrobat [Reader]?

+

diff --git a/posts/2020-12-29-antivirus-software-is-a-hack.php b/posts/2020-12-29-antivirus-software-is-a-hack.php index cc5f0d0..93040a0 100644 --- a/posts/2020-12-29-antivirus-software-is-a-hack.php +++ b/posts/2020-12-29-antivirus-software-is-a-hack.php @@ -1,10 +1,5 @@ - +

Antivirus Software is a Hack

+

diff --git a/posts/2021-01-15-adam-s-2020-reading-list.php b/posts/2021-01-15-adam-s-2020-reading-list.php index 390bf3e..f347248 100644 --- a/posts/2021-01-15-adam-s-2020-reading-list.php +++ b/posts/2021-01-15-adam-s-2020-reading-list.php @@ -1,10 +1,5 @@ - +

Adam's 2020 (Quarantine) Reading List

+