{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "207d2510", "metadata": {}, "outputs": [], "source": [ "import os\n", "import re\n", "import shutil\n", "import markdown\n", "import yaml\n", "import subprocess\n", "import rfeed\n", "import pydantic\n", "import glob\n", "from dotmap import DotMap\n", "from typing import Optional, Union, Literal, BinaryIO, Any\n", "\n", "\n", "\n", "from datetime import datetime\n", "from jimsite import *" ] }, { "cell_type": "code", "execution_count": 3, "id": "8f435a12", "metadata": {}, "outputs": [], "source": [ "with open('config.yaml', 'r') as config_file:\n", " config = yaml.safe_load(config_file.read())\n", " \n", "templates = map_templates(config['templates_folder'])\n", "\n", "sites = {k:SiteConfig(**v) for k,v in config['sites'].items()}" ] }, { "cell_type": "code", "execution_count": null, "id": "e32458c7", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Dogma Jimfiniumhttp://localhost:8000/dogma-jimfinium/rssDogma Jimfiniumen-USThu, 29 Jan 2026 16:29:57 GMTrfeed v1.1.1https://github.com/svpino/rfeed/blob/master/README.mdSuperlockhttp://localhost:8000/dogma-jimfinium/superlockJim Shepich IIIWed, 26 Nov 2025 00:00:00 GMTsuperlockSustainable Livinghttp://localhost:8000/dogma-jimfinium/sustainable-livingJim Shepich IIIThu, 20 Nov 2025 00:00:00 GMTsustainable-livingStocking Uphttp://localhost:8000/dogma-jimfinium/stocking-upJim Shepich IIIWed, 19 Nov 2025 00:00:00 GMTstocking-upSet Up the Toyshttp://localhost:8000/dogma-jimfinium/set-up-the-toysJim Shepich IIIWed, 14 Jan 2026 00:00:00 GMTset-up-the-toysDo What You Lovehttp://localhost:8000/dogma-jimfinium/do-what-you-loveJim Shepich IIITue, 10 Jun 2025 00:00:00 GMTdo-what-you-loveSelf-Care is not Selfishhttp://localhost:8000/dogma-jimfinium/self-care-is-not-selfishJim Shepich IIISun, 18 May 2025 00:00:00 GMTself-care-is-not-selfishBlowoutshttp://localhost:8000/dogma-jimfinium/blowoutsJim Shepich IIIWed, 26 Nov 2025 00:00:00 GMTblowoutsVitamins & Supplementshttp://localhost:8000/dogma-jimfinium/vitaminsJim Shepich IIISun, 18 May 2025 00:00:00 GMTvitaminsGear for New Parentshttp://localhost:8000/dogma-jimfinium/gear-for-new-parentsJim Shepich IIIFri, 12 Jul 2024 00:00:00 GMTgear-for-new-parents\n" ] } ], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "70408b85", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "7de0d84d", "metadata": {}, "outputs": [], "source": [ "\n", "index = {}\n", "\n", "for article in glob.glob('build/dogma-jimfinium/*.md'):\n", " metadata, content = load_markdown(article)\n", "\n", " if metadata is None:\n", " print(article)\n", "\n", " # Skip unpublished articles.\n", " if not metadata.published:\n", " continue\n", "\n", " article_filestem = os.path.splitext(os.path.basename(article))[0]\n", "\n", " # Add the article to the index.\n", " index[article_filestem] = (metadata, content)\n", "\n", " # Interpolate the article contents into the webpage template.\n", " article_html = format_html_template(\n", " 'templates/components/blog_article.html',\n", " content = content,\n", " blog_tags = ' '.join(format_article_tags(metadata.tags)),\n", " metadata = metadata\n", " )\n", " html = format_html_template('templates/pages/default.html', content = article_html, **PARTIALS)\n", " \n", " # Write the HTML file to /dist/dogma-jimfinium.\n", " with open(f'dist/dogma-jimfinium/{article_filestem}.html', 'w') as f:\n", " f.write(html)\n", "\n", "\n", "index_html = build_blog_archive(index, **PARTIALS)\n", "# Write the HTML file to /dist/dogma-jimfinium.\n", "with open(f'dist/dogma-jimfinium/index.html', 'w') as f:\n", " f.write(index_html)" ] }, { "cell_type": "code", "execution_count": null, "id": "e3171afd", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 10, "id": "a28b95a6", "metadata": {}, "outputs": [], "source": [ "build_site(sites['resume'])" ] } ], "metadata": { "kernelspec": { "display_name": ".venv", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.3" } }, "nbformat": 4, "nbformat_minor": 5 }