154 lines
6.1 KiB
Plaintext
154 lines
6.1 KiB
Plaintext
{
|
|
"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": [
|
|
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
|
|
"<rss version=\"2.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\"><channel><title>Dogma Jimfinium</title><link>http://localhost:8000/dogma-jimfinium/rss</link><description>Dogma Jimfinium</description><language>en-US</language><lastBuildDate>Thu, 29 Jan 2026 16:29:57 GMT</lastBuildDate><generator>rfeed v1.1.1</generator><docs>https://github.com/svpino/rfeed/blob/master/README.md</docs><item><title>Superlock</title><link>http://localhost:8000/dogma-jimfinium/superlock</link><author>Jim Shepich III</author><pubDate>Wed, 26 Nov 2025 00:00:00 GMT</pubDate><guid isPermaLink=\"true\">superlock</guid></item><item><title>Sustainable Living</title><link>http://localhost:8000/dogma-jimfinium/sustainable-living</link><author>Jim Shepich III</author><pubDate>Thu, 20 Nov 2025 00:00:00 GMT</pubDate><guid isPermaLink=\"true\">sustainable-living</guid></item><item><title>Stocking Up</title><link>http://localhost:8000/dogma-jimfinium/stocking-up</link><author>Jim Shepich III</author><pubDate>Wed, 19 Nov 2025 00:00:00 GMT</pubDate><guid isPermaLink=\"true\">stocking-up</guid></item><item><title>Set Up the Toys</title><link>http://localhost:8000/dogma-jimfinium/set-up-the-toys</link><author>Jim Shepich III</author><pubDate>Wed, 14 Jan 2026 00:00:00 GMT</pubDate><guid isPermaLink=\"true\">set-up-the-toys</guid></item><item><title>Do What You Love</title><link>http://localhost:8000/dogma-jimfinium/do-what-you-love</link><author>Jim Shepich III</author><pubDate>Tue, 10 Jun 2025 00:00:00 GMT</pubDate><guid isPermaLink=\"true\">do-what-you-love</guid></item><item><title>Self-Care is not Selfish</title><link>http://localhost:8000/dogma-jimfinium/self-care-is-not-selfish</link><author>Jim Shepich III</author><pubDate>Sun, 18 May 2025 00:00:00 GMT</pubDate><guid isPermaLink=\"true\">self-care-is-not-selfish</guid></item><item><title>Blowouts</title><link>http://localhost:8000/dogma-jimfinium/blowouts</link><author>Jim Shepich III</author><pubDate>Wed, 26 Nov 2025 00:00:00 GMT</pubDate><guid isPermaLink=\"true\">blowouts</guid></item><item><title>Vitamins & Supplements</title><link>http://localhost:8000/dogma-jimfinium/vitamins</link><author>Jim Shepich III</author><pubDate>Sun, 18 May 2025 00:00:00 GMT</pubDate><guid isPermaLink=\"true\">vitamins</guid></item><item><title>Gear for New Parents</title><link>http://localhost:8000/dogma-jimfinium/gear-for-new-parents</link><author>Jim Shepich III</author><pubDate>Fri, 12 Jul 2024 00:00:00 GMT</pubDate><guid isPermaLink=\"true\">gear-for-new-parents</guid></item></channel></rss>\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
|
|
}
|