This repository contains the source code and maintenance scripts for the Fractal Thought Engine static site. The project is built using Jekyll and utilizes a suite of custom Node.js and Shell/PowerShell scripts to manage content, validate links, handle assets, and deploy to AWS S3.
Before running these scripts, ensure you have the following installed:
sharp library used in image processing)1
npm install sharp gray-matter glob js-yaml
1
bundle install
Automated scripts are provided for building the Jekyll site and syncing it to the S3 bucket (s3://fractalthoughtengine.com) with proper cache headers and CloudFront invalidation.
deploy.sh)1
2
3
4
5
6
7
8
# Standard deployment
./scripts/deploy.sh
# Dry run (see what will happen without uploading)
./scripts/deploy.sh --dry-run
# Use a specific AWS profile
./scripts/deploy.sh --profile my-profile
deploy.ps1)1
2
3
4
5
6
7
8
# Standard deployment
.\scripts\deploy.ps1
# Dry run
.\scripts\deploy.ps1 -DryRun
# Use a specific AWS profile
.\scripts\deploy.ps1 -Profile my-profile
Features:
_site).JEKYLL_ENV=production.--delete (removes files on S3 that no longer exist locally).The project uses a sophisticated “Export -> Transform -> Import” workflow to handle complex content structures and asset organization.
export-posts.js)Converts standard Jekyll _posts/*.md files into a folder-based structure in post_data/.
post_data/2024/01/my-post/).frontmatter.yaml.content.md.1
node scripts/export-posts.js
import-posts.js)Reconstructs Jekyll markdown files from the post_data/ directory back into _posts/.
frontmatter.yaml and content files.tutorial.md, comic.md, socratic.md, etc.) and automatically generates HTML tab navigation within the post.assets/images/{post-slug}/ and updates paths in both Markdown and Frontmatter.Game-Theory tag if gametheory.md exists).1
node scripts/import-posts.js
These scripts allow you to edit Frontmatter (metadata) for all posts simultaneously using CSV files (e.g., in Excel or Google Sheets).
extract-frontmatter.js)Scans all posts and creates CSV files in _data/ for every unique frontmatter key found.
_data/title.csv, _data/tags.csv, etc.filepath, value1
node scripts/extract-frontmatter.js
ingest-frontmatter.js)Reads modified CSV files from _data/ and updates the actual Markdown files in _posts/.
1
node scripts/ingest-frontmatter.js
validate-links.js)A powerful utility to ensure site integrity.
[text](path.md).parent_document, related_documents).conciousness.md to consciousness.md).link-validation-report.json and all-links-report.csv.1
node scripts/validate-links.js
generate-favicons.js)Generates a complete suite of favicons from a single source image.
assets/images/fractal_thought_engine_logo.pngfavicon.ico, Apple Touch Icons, Android Chrome icons, and site.webmanifest.1
node scripts/generate-favicons.js
normalize-featured-images.js)Ensures every post has a valid featured_image.
main.png for consistency.featured_image keys that point to missing files.1
node scripts/normalize-featured-images.js
fix-post-dates.js)Ensures the date in the Frontmatter matches the date in the filename.
2023-01-01-test.md but frontmatter says 2022-12-31, it updates the frontmatter to 2023-01-01.1
node scripts/fix-post-dates.js
rename_posts.sh)Standardizes filenames based on the file creation/modification date and title.
YYYY-MM-DD-slugified-title.md1
./scripts/rename_posts.sh
node scripts/extract-frontmatter.js._data/tags.csv in Excel.node scripts/ingest-frontmatter.js.node scripts/export-posts.js.post_data/YYYY/MM/slug/.comic.md or socratic.md alongside content.md.node scripts/import-posts.js.node scripts/fix-post-dates.js.node scripts/validate-links.js to fix broken references../scripts/deploy.sh.