From 4c9402d04e2180d68692882fb213951b547acef0 Mon Sep 17 00:00:00 2001 From: Erick Ruiz de Chavez Date: Sun, 12 Jan 2025 09:15:19 -0500 Subject: [PATCH] =?UTF-8?q?Replace=20local=20scripts=20with=20=F0=9F=92=8E?= =?UTF-8?q?=20Stargem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- Dockerfile | 10 -- Makefile | 21 --- _draft.py | 10 -- _generate.py | 74 -------- _includes/footer.gmi | 1 - _layouts/article.gmi | 12 -- _layouts/home.gmi | 11 -- _publish.py | 64 ------- _unpublish.py | 59 ------- _utils.py | 50 ------ compose.yaml | 5 - {_drafts => drafts}/.gitkeep | 0 ...live-long-and-prosper-with-these-tools.gmi | 2 +- index.gmi | 1 + {_posts => posts}/.gitkeep | 0 ...-22-regenerating-my-blog-a-fresh-start.gmi | 0 ...t-minimum-automating-laptop-power-mode.gmi | 0 ...sm-and-efficiency-with-gemini-protocol.gmi | 0 requirements.txt | 3 - static/bookmarks.gmi | 19 ++ static/robots.txt | 71 ++++++++ static/styles.css | 167 ++++++++++++++++++ static/test.gmi | 64 +++++++ static/test.svg | 1 + _includes/links.gmi => templates/footer.jinja | 5 +- templates/gemlog.jinja | 18 ++ .../header.gmi => templates/header.jinja | 0 templates/home.jinja | 21 +++ templates/page.jinja | 8 + templates/post.jinja | 10 ++ 31 files changed, 386 insertions(+), 323 deletions(-) delete mode 100644 Dockerfile delete mode 100644 Makefile delete mode 100644 _draft.py delete mode 100644 _generate.py delete mode 100644 _includes/footer.gmi delete mode 100644 _layouts/article.gmi delete mode 100644 _layouts/home.gmi delete mode 100644 _publish.py delete mode 100644 _unpublish.py delete mode 100644 _utils.py delete mode 100644 compose.yaml rename {_drafts => drafts}/.gitkeep (100%) rename {_drafts => drafts}/live-long-and-prosper-with-these-tools.gmi (98%) rename {_posts => posts}/.gitkeep (100%) rename {_posts => posts}/2024-12-22-regenerating-my-blog-a-fresh-start.gmi (100%) rename {_posts => posts}/2024-12-29-energy-shields-at-minimum-automating-laptop-power-mode.gmi (100%) rename {_posts => posts}/2025-01-08-prime-directive-minimalism-and-efficiency-with-gemini-protocol.gmi (100%) delete mode 100644 requirements.txt create mode 100644 static/bookmarks.gmi create mode 100644 static/robots.txt create mode 100644 static/styles.css create mode 100644 static/test.gmi create mode 100644 static/test.svg rename _includes/links.gmi => templates/footer.jinja (53%) create mode 100644 templates/gemlog.jinja rename _includes/header.gmi => templates/header.jinja (100%) create mode 100644 templates/home.jinja create mode 100644 templates/page.jinja create mode 100644 templates/post.jinja diff --git a/.gitignore b/.gitignore index 373b255..ba77fcc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ __pycache__ .venv -_capsule +dist diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index a66f14b..0000000 --- a/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM alpine:latest - -WORKDIR /app -COPY requirements.txt . -RUN apk update \ - && apk add python3 py3-pip lowdown \ - && python3 -m pip install -r requirements.txt --break-system-packages -COPY *.py ./ -ENTRYPOINT [ "python3" ] -CMD [ "_generate.py" ] diff --git a/Makefile b/Makefile deleted file mode 100644 index 095c480..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -env := development - -default: clean generate - -clean: - \rm -rf _capsule __pycache__ - -generate: - docker compose run --rm -e GEMINI_ENV=${env} gemini - -draft: - docker compose run --rm -e GEMINI_ENV=${env} gemini _draft.py - -publish: - docker compose run --rm -e GEMINI_ENV=${env} gemini _publish.py - -unpublish: - docker compose run --rm -e GEMINI_ENV=${env} gemini _unpublish.py - -build: - docker compose build --no-cache diff --git a/_draft.py b/_draft.py deleted file mode 100644 index f8b81ae..0000000 --- a/_draft.py +++ /dev/null @@ -1,10 +0,0 @@ -from slugify import slugify - -import _utils - -title = input("Enter draft's title: ") -slug = slugify(title) -fm = _utils.loads("---\n---\n") -fm.metadata["title"] = title -with open(f"_drafts/{slug}.gmi", mode="w", encoding="utf8") as file: - file.write(_utils.dumps(fm)) diff --git a/_generate.py b/_generate.py deleted file mode 100644 index 7b91930..0000000 --- a/_generate.py +++ /dev/null @@ -1,74 +0,0 @@ -import glob -import os -from datetime import datetime - -import _utils - -if not os.path.exists("_capsule"): - os.makedirs("_capsule") - -with open("_layouts/home.gmi", mode="r", encoding="utf8") as file: - home_body = file.read() -with open("_layouts/article.gmi", mode="r", encoding="utf8") as file: - article_body = file.read() -with open("_includes/header.gmi", mode="r", encoding="utf8") as file: - header_body = file.read() -with open("_includes/footer.gmi", mode="r", encoding="utf8") as file: - footer_body = file.read() -with open("_includes/links.gmi", mode="r", encoding="utf8") as file: - links_body = file.read() - -articles = glob.glob("_posts/*.gmi") -articles.sort() - -if os.getenv("GEMINI_ENV") != "production": - articles += glob.glob("_drafts/*.gmi") - -today = datetime.today().strftime("%F") -year = datetime.today().strftime("%Y") - -articles_list = [] - -for article in articles: - gmi = article.replace("_posts/", "").replace("_drafts/", "") - - fm = _utils.load(article) - article_title = fm.metadata["title"] - article_date = fm.metadata.get("date") - article_content = fm.content - - if article_date is None: - article_date = today - gmi = f"{article_date}-{gmi}" - elif isinstance(article_date, str): - article_date = datetime.fromisoformat(article_date).strftime("%Y-%m-%d") - - body = ( - article_body.replace("%%header%%", header_body) - .replace("%%links%%", links_body) - .replace("%%title%%", f"{article_title}\n{article_date}\n") - .replace("%%body%%", article_content) - .replace("%%footer%%", footer_body) - .replace("%%year%%", year) - ) - - articles_list.append(f"=> {gmi} {article_date} {article_title}") - with open(f"_capsule/{gmi}", mode="w", encoding="utf8") as file: - file.write(body) - -articles_list.sort(reverse=True) - -fm = _utils.load("index.gmi") -home_content = fm.content - -body = ( - home_body.replace("%%header%%", header_body) - .replace("%%links%%", links_body) - .replace("%%body%%", home_content) - .replace("%%articles%%", "\n".join(articles_list)) - .replace("%%footer%%", footer_body) - .replace("%%year%%", year) -) - -with open("_capsule/index.gmi", mode="w", encoding="utf8") as file: - file.write(body) diff --git a/_includes/footer.gmi b/_includes/footer.gmi deleted file mode 100644 index 23044fb..0000000 --- a/_includes/footer.gmi +++ /dev/null @@ -1 +0,0 @@ -© %%year%% Erick Ruiz de Chavez \ No newline at end of file diff --git a/_layouts/article.gmi b/_layouts/article.gmi deleted file mode 100644 index a9f438a..0000000 --- a/_layouts/article.gmi +++ /dev/null @@ -1,12 +0,0 @@ -%%header%% - -=> / Front page - -## %%title%% - -%%body%% - -%%links%% - - -%%footer%% diff --git a/_layouts/home.gmi b/_layouts/home.gmi deleted file mode 100644 index 4519b8e..0000000 --- a/_layouts/home.gmi +++ /dev/null @@ -1,11 +0,0 @@ -%%header%% - -%%body%% - -## Articles -%%articles%% - -%%links%% - - -%%footer%% diff --git a/_publish.py b/_publish.py deleted file mode 100644 index ecc29d7..0000000 --- a/_publish.py +++ /dev/null @@ -1,64 +0,0 @@ -import glob -import os -import sys -from datetime import UTC, datetime - -import _utils - -articles = glob.glob("_drafts/*.gmi") -print(articles) -articles.sort() -titles = [] - -if len(articles) == 0: - print("No drafts found") - sys.exit(1) - -for article in articles: - fm = _utils.load(article) - titles.append(fm.metadata["title"]) - -print("\nAvailable drafts:\n") - -for index, title in enumerate(titles): - print(f"\t[{index + 1}] {title}") - -print("") - -article = "" -selection = "" -index = -1 - -while index < 0 or index > len(articles): - try: - index = int(selection) - 1 - - if index == -1: - sys.exit(0) - - article = articles[index] - - except (ValueError, IndexError): - selection = input("Enter a number (0 to exit): ") - -now = datetime.now(UTC) -file_date = now.strftime("%F") -frontmatter_date = now.strftime("%F %H:%m %z") - - -fm = _utils.load(article) -fm.metadata["date"] = frontmatter_date - -with open( - article.replace("_drafts/", f"_posts/{file_date}-"), - mode="w", - encoding="utf8", -) as file: - file.write(_utils.dumps(fm)) - -try: - os.remove(article) -except PermissionError: - print(f"Permission denied to delete '{article}'.") -except Exception as e: - print(f"An error occurred: {e}") diff --git a/_unpublish.py b/_unpublish.py deleted file mode 100644 index 009da99..0000000 --- a/_unpublish.py +++ /dev/null @@ -1,59 +0,0 @@ -import glob -import os -import sys -from datetime import datetime - -import _utils - -articles = glob.glob("_posts/*.gmi") -articles.sort(reverse=True) -titles = [] - -if len(articles) == 0: - print("No articles found") - sys.exit(1) - -for article in articles: - fm = _utils.load(article) - titles.append(fm.metadata["title"]) - -print("\nAvailable articles:\n") - -for index, title in enumerate(titles): - print(f"\t[{index + 1}] {title}") - -print("") - -article = "" -selection = "" -index = -1 - -while index < 0 or index > len(articles): - try: - index = int(selection) - 1 - - if index == -1: - sys.exit(0) - - article = articles[index] - - except (ValueError, IndexError): - selection = input("Enter a number (0 to exit): ") - -fm = _utils.load(article) -file_date = datetime.fromisoformat(fm.metadata["date"]).strftime("%Y-%m-%d") -del fm.metadata["date"] - -with open( - article.replace(f"_posts/{file_date}-", "_drafts/"), - mode="w", - encoding="utf8", -) as file: - file.write(_utils.dumps(fm)) - -try: - os.remove(article) -except PermissionError: - print(f"Permission denied to delete '{article}'.") -except Exception as e: - print(f"An error occurred: {e}") diff --git a/_utils.py b/_utils.py deleted file mode 100644 index 6ab9ad4..0000000 --- a/_utils.py +++ /dev/null @@ -1,50 +0,0 @@ -from dataclasses import dataclass, field - -import yaml - - -@dataclass -class Article: - metadata: dict = field(default_factory=dict) - content: str = "" - - -def load(file_name) -> Article: - content = "" - with open(file=file_name, mode="r", encoding="utf8") as file: - content = file.read() - - return loads(content) - - -def loads(content: str) -> Article: - lines = content.splitlines() - - start = -1 - end = -1 - - for index, line in enumerate(lines): - if line.startswith("---"): - if start == -1: - start = index - elif end == -1: - end = index - break - - if start == -1 or end == -1: - raise ValueError("Missing frontmatter delimiters") - - metadata = lines[start + 1 : end] - content = lines[end + 1 :] - - metadata = yaml.safe_load("\n".join(metadata)) - if not metadata: - metadata = {} - return Article( - metadata=metadata, - content="\n".join(content), - ) - - -def dumps(article: Article) -> str: - return f"""---\n{yaml.dump(article.metadata)}---\n{article.content}\n""" diff --git a/compose.yaml b/compose.yaml deleted file mode 100644 index a9a099a..0000000 --- a/compose.yaml +++ /dev/null @@ -1,5 +0,0 @@ -services: - gemini: - build: . - volumes: - - .:/app diff --git a/_drafts/.gitkeep b/drafts/.gitkeep similarity index 100% rename from _drafts/.gitkeep rename to drafts/.gitkeep diff --git a/_drafts/live-long-and-prosper-with-these-tools.gmi b/drafts/live-long-and-prosper-with-these-tools.gmi similarity index 98% rename from _drafts/live-long-and-prosper-with-these-tools.gmi rename to drafts/live-long-and-prosper-with-these-tools.gmi index a8d9eba..8dd6f11 100644 --- a/_drafts/live-long-and-prosper-with-these-tools.gmi +++ b/drafts/live-long-and-prosper-with-these-tools.gmi @@ -74,4 +74,4 @@ To help you understand the labels I've used, here's a quick guide to the emojis ## Honorary Mentions -- Keyboard Maestro (💻,1️⃣,🌐) +- Keyboard Maestro (💻,1️⃣,🌐) \ No newline at end of file diff --git a/index.gmi b/index.gmi index 36f1c90..2f757be 100644 --- a/index.gmi +++ b/index.gmi @@ -1,4 +1,5 @@ --- +template: home --- Hi 👋, I'm Erick! diff --git a/_posts/.gitkeep b/posts/.gitkeep similarity index 100% rename from _posts/.gitkeep rename to posts/.gitkeep diff --git a/_posts/2024-12-22-regenerating-my-blog-a-fresh-start.gmi b/posts/2024-12-22-regenerating-my-blog-a-fresh-start.gmi similarity index 100% rename from _posts/2024-12-22-regenerating-my-blog-a-fresh-start.gmi rename to posts/2024-12-22-regenerating-my-blog-a-fresh-start.gmi diff --git a/_posts/2024-12-29-energy-shields-at-minimum-automating-laptop-power-mode.gmi b/posts/2024-12-29-energy-shields-at-minimum-automating-laptop-power-mode.gmi similarity index 100% rename from _posts/2024-12-29-energy-shields-at-minimum-automating-laptop-power-mode.gmi rename to posts/2024-12-29-energy-shields-at-minimum-automating-laptop-power-mode.gmi diff --git a/_posts/2025-01-08-prime-directive-minimalism-and-efficiency-with-gemini-protocol.gmi b/posts/2025-01-08-prime-directive-minimalism-and-efficiency-with-gemini-protocol.gmi similarity index 100% rename from _posts/2025-01-08-prime-directive-minimalism-and-efficiency-with-gemini-protocol.gmi rename to posts/2025-01-08-prime-directive-minimalism-and-efficiency-with-gemini-protocol.gmi diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index eb8a2f2..0000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -python-slugify==8.0.4 -PyYAML==6.0.2 -text-unidecode==1.3 diff --git a/static/bookmarks.gmi b/static/bookmarks.gmi new file mode 100644 index 0000000..c87af7d --- /dev/null +++ b/static/bookmarks.gmi @@ -0,0 +1,19 @@ +# Bookmarks + +## Social +=> gemini://station.martinrue.com/ Station +=> gemini://bbs.geminispace.org/ BBS + +## Agregators +=> gemini://warmedal.se/~antenna/ Antenna +=> gemini://skyjake.fi/~Cosmos/ Cosmos + +## Capsules +=> gemini://erick.is/ Erick +=> gemini://gemi.dev/ Gemi.dev +=> gemini://skyjake.fi/ skyjake +=> gemini://cities.yesterweb.org/ Yestercities + +## Gemini +=> gemini://geminiprotocol.net/ Project Gemini +=> gemini://skyjake.fi/lagrange/getting_started.gmi Getting Started diff --git a/static/robots.txt b/static/robots.txt new file mode 100644 index 0000000..22d7a70 --- /dev/null +++ b/static/robots.txt @@ -0,0 +1,71 @@ +# Modified GoToSocial robots.txt + +# AI scrapers and the like. +# https://github.com/ai-robots-txt/ai.robots.txt/ +User-agent: AI2Bot +User-agent: Ai2Bot-Dolma +User-agent: Amazonbot +User-agent: anthropic-ai +User-agent: Applebot +User-agent: Applebot-Extended +User-agent: Bytespider +User-agent: CCBot +User-agent: ChatGPT-User +User-agent: Claude-Web +User-agent: ClaudeBot +User-agent: cohere-ai +User-agent: cohere-training-data-crawler +User-agent: Diffbot +User-agent: DuckAssistBot +User-agent: FacebookBot +User-agent: FriendlyCrawler +User-agent: Google-Extended +User-agent: GoogleOther +User-agent: GoogleOther-Image +User-agent: GoogleOther-Video +User-agent: GPTBot +User-agent: iaskspider/2.0 +User-agent: ICC-Crawler +User-agent: ImagesiftBot +User-agent: img2dataset +User-agent: ISSCyberRiskCrawler +User-agent: Kangaroo Bot +User-agent: Meta-ExternalAgent +User-agent: Meta-ExternalFetcher +User-agent: OAI-SearchBot +User-agent: omgili +User-agent: omgilibot +User-agent: PanguBot +User-agent: PerplexityBot +User-agent: PetalBot +User-agent: Scrapy +User-agent: SemrushBot +User-agent: Sidetrade indexer bot +User-agent: Timpibot +User-agent: VelenPublicWebCrawler +User-agent: Webzio-Extended +User-agent: YouBot +Disallow: / + +# Marketing/SEO "intelligence" data scrapers +User-agent: AwarioRssBot +User-agent: AwarioSmartBot +User-agent: DataForSeoBot +User-agent: magpie-crawler +User-agent: Meltwater +User-agent: peer39_crawler +User-agent: peer39_crawler/1.0 +User-agent: PiplBot +User-agent: scoop.it +User-agent: Seekr +Disallow: / + +# Well-known.dev crawler. Indexes stuff under /.well-known. +# https://well-known.dev/about/ +User-agent: WellKnownBot +Disallow: / + +# Rules for everything else. +User-agent: * +Crawl-delay: 500 + diff --git a/static/styles.css b/static/styles.css new file mode 100644 index 0000000..d3e2b48 --- /dev/null +++ b/static/styles.css @@ -0,0 +1,167 @@ +html { + font-family: sans-serif; + color: #444; + box-sizing: border-box; +} + +*, +*:before, +*:after { + box-sizing: inherit; +} + +body { + max-width: 800px; + margin: 0 auto; + padding: 1rem 2rem; +} + +blockquote { + background-color: #eee; + border-left: 3px solid #555; + margin: 1rem -1rem 1rem calc(-1rem - 3px); + padding: 1rem; +} + +ul { + margin-top: 1.5rem; + margin-bottom: 2rem; + margin-left: 0; + padding: 0; +} + +li { + padding: 0; + margin: 0; +} + +p:has(img) { + text-align: center; +} + +img { + max-width: 80%; +} + +a { + position: relative; +} + +a, +a:hover, +a:active, +a:visited { + text-decoration: none; +} + +a:before { + content: '⇒'; + color: #999; + font-weight: bold; + position: absolute; + left: -1.25rem; +} + +pre { + margin: 1.5rem -1rem 2rem; + background-color: #eee; + padding: 1rem; + overflow-x: auto; +} + +article { + line-height: 1.5rem; +} + +h1 { + margin-top: 2.5rem; + margin-bottom: 1.5px; + font-size: 1.3rem; +} + +h2 { + margin-top: 2.5rem; + font-size: 1.2rem; +} + +h3 { + font-size: 1.1rem; +} + +p { + margin-bottom: 1.5rem; +} + +p:nth-last-of-type(2) { + margin-top: 2.5rem; + margin-bottom: 2.5rem; + opacity: 0.6; +} + +p:has(a) { + margin-top: 0rem; + margin-bottom: 0.25rem; +} + +details:not([open]) summary, +details:not([open]) summary a { + color: gray; +} + +details summary a:before { + display: none; +} + +dl dt { + font-weight: bold; +} + +dl dt:not(:first-child) { + margin-top: 0.5rem; +} + +@media (prefers-color-scheme: dark) { + html { + background-color: #111; + color: #eee; + } + + blockquote { + background-color: #000; + } + + pre { + background-color: #222; + } + + a, + a:hover, + a:active { + color: #0087bd; + } + + a:visited { + color: #333399; + } +} + +label { + display: block; + font-weight: bold; + margin-bottom: 0.5rem; +} + +input { + display: block; + border: 1px solid #888; + padding: 0.375rem; + line-height: 1.25rem; + transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; + width: 100%; +} + +input:focus { + outline: 0; + border-color: #80bdff; + box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); +} diff --git a/static/test.gmi b/static/test.gmi new file mode 100644 index 0000000..6cc718b --- /dev/null +++ b/static/test.gmi @@ -0,0 +1,64 @@ +# Test page + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi fermentum dolor ut diam efficitur, non pellentesque purus vulputate. Mauris imperdiet sapien at cursus ullamcorper. Donec viverra, purus a viverra varius, leo augue ullamcorper purus, vitae mattis ipsum velit at nibh. Maecenas iaculis aliquam tempor. Mauris sed convallis nunc, laoreet facilisis sem. Pellentesque ultrices, mi at euismod vehicula, turpis ante aliquet arcu, sit amet tincidunt lacus ligula non leo. Quisque fringilla faucibus quam id placerat. + +=> test.svg Test SVG Image + +## Mauris fermentum feugiat enim + +Get maximus augue sagittis sed. Curabitur massa tellus, porttitor nec tellus in, consequat dignissim purus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam non iaculis velit. Nulla at rutrum tellus. Ut iaculis nunc ac faucibus placerat. Duis viverra dictum diam. Donec eu auctor odio. Suspendisse eget massa condimentum lorem molestie maximus. + +=> / Quisque nec nisi rutrum + +Facilisis sapien ac, euismod risus. Nulla faucibus, felis nec pulvinar lacinia, nunc odio ultrices magna, porttitor dictum nisi eros vitae justo. Quisque vulputate, nisi sit amet dapibus fermentum, mi leo iaculis erat, vel tristique risus mi sit amet dui. + +=> https://google.com Phasellus pretium neque nec ligula egestas + +Eget porttitor nibh aliquam. Nulla facilisi. Suspendisse sollicitudin quam id tortor eleifend, in bibendum metus pulvinar. Sed ut nisi at augue ultricies tincidunt. Fusce risus diam, vulputate nec fringilla sit amet, scelerisque sed enim. Aliquam eget risus vitae urna pharetra pretium. + +## Aliquam rutrum commodo quam + +Get commodo justo consequat a. Morbi ornare justo sit amet ultrices congue. Ut ultrices blandit tempor. Curabitur et consequat sapien, eget lobortis metus. Vivamus pretium tellus et urna molestie commodo. Aenean vitae sapien vestibulum, hendrerit nibh sed, tempus leo. Mauris eleifend justo a felis pretium sodales. + +> Cras auctor justo non elementum pharetra. Nulla ullamcorper quam nec velit aliquet convallis. Suspendisse elit nisi, euismod a nulla vitae, volutpat tempor felis. Duis urna orci, dapibus sit amet urna a, convallis ornare lorem. Donec varius vitae elit ac lobortis. Curabitur id hendrerit ipsum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut dui in turpis efficitur rhoncus. In et lacinia lectus, ac molestie odio. Curabitur ultrices felis est, nec semper ante posuere eget. In vel elit lacus. + +## Nam facilisis erat ex + +* Ac ultricies eros tempus a +* Phasellus fermentum lacus odio +* Ac luctus diam cursus ac +* Orci varius natoque penatibus et magnis dis parturient montes + +### Ascetur ridiculus mus + +Ut vitae sagittis tellus. Fusce tortor dui, interdum in risus eget, sollicitudin fringilla ligula. Duis vehicula hendrerit enim, eu fringilla nisi fermentum non. Pellentesque feugiat maximus dolor, ac pellentesque libero venenatis id. Suspendisse vestibulum justo quis magna sodales, et varius ante congue. + + +``` +>>> import this +The Zen of Python, by Tim Peters + +Beautiful is better than ugly. +Explicit is better than implicit. +Simple is better than complex. +Complex is better than complicated. +Flat is better than nested. +Sparse is better than dense. +Readability counts. +Special cases aren't special enough to break the rules. +Although practicality beats purity. +Errors should never pass silently. +Unless explicitly silenced. +In the face of ambiguity, refuse the temptation to guess. +There should be one-- and preferably only one --obvious way to do it. +Although that way may not be obvious at first unless you're Dutch. +Now is better than never. +Although never is often better than *right* now. +If the implementation is hard to explain, it's a bad idea. +If the implementation is easy to explain, it may be a good idea. +Namespaces are one honking great idea -- let's do more of those! +``` + +### Phasellus molestie in metus sit amet vestibulum + +Nunc cursus nunc consectetur sapien aliquet eleifend. Sed facilisis ipsum iaculis egestas accumsan. Morbi congue ac lectus a sollicitudin. Pellentesque bibendum laoreet tortor quis interdum. In sed arcu odio. Pellentesque turpis orci, mattis vitae ligula nec, semper molestie tellus. Integer nunc risus, vehicula non felis eget, ultricies faucibus urna. diff --git a/static/test.svg b/static/test.svg new file mode 100644 index 0000000..cb82a4b --- /dev/null +++ b/static/test.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/_includes/links.gmi b/templates/footer.jinja similarity index 53% rename from _includes/links.gmi rename to templates/footer.jinja index 39c2bc6..70508d2 100644 --- a/_includes/links.gmi +++ b/templates/footer.jinja @@ -2,4 +2,7 @@ => https://linkedin.com/in/erickruizdechavez LinkedIn => https://github.com/eruizdechavez GitHub -=> https://erick.social/@erick Fediverse \ No newline at end of file +=> https://erick.social/@erick Fediverse + + +© {{ now.strftime('%Y') }} Erick Ruiz de Chavez diff --git a/templates/gemlog.jinja b/templates/gemlog.jinja new file mode 100644 index 0000000..c4d59b1 --- /dev/null +++ b/templates/gemlog.jinja @@ -0,0 +1,18 @@ +{% include "header.jinja" %} +{{ content }} + +{% if stargem.posts -%} +## Posts +{% for post in stargem.posts -%} +=> {{ post.path }} {{ post.frontmatter.date.strftime('%F') }} {{ post.frontmatter.title }} +{% endfor -%} +{% endif -%} + +{% if stargem.drafts %} +## Drafts +{% for draft in stargem.drafts -%} +=> {{ draft.path }} {{ draft.frontmatter.title }} +{% endfor -%} +{% endif %} + +{% include "footer.jinja" %} diff --git a/_includes/header.gmi b/templates/header.jinja similarity index 100% rename from _includes/header.gmi rename to templates/header.jinja diff --git a/templates/home.jinja b/templates/home.jinja new file mode 100644 index 0000000..80d3db9 --- /dev/null +++ b/templates/home.jinja @@ -0,0 +1,21 @@ +{% include "header.jinja" %} +{{ content }} + +{% if stargem.posts -%} +## Latests Posts +{% for post in stargem.posts[:5] -%} +=> {{ post.path }} {{ post.frontmatter.date.strftime('%F') }} {{ post.frontmatter.title }} +{% endfor %} +{%- if stargem.posts | length > 5 %} +=> gemlog.gmi See All Posts +{% endif -%} +{% endif -%} + +{% if stargem.drafts %} +## Drafts +{% for draft in stargem.drafts -%} +=> {{ draft.path }} {{ draft.frontmatter.title }} +{% endfor -%} +{% endif %} + +{% include "footer.jinja" %} diff --git a/templates/page.jinja b/templates/page.jinja new file mode 100644 index 0000000..1532434 --- /dev/null +++ b/templates/page.jinja @@ -0,0 +1,8 @@ +{% include "header.jinja" %} +## {{ frontmatter.title }} + +=> / Front page + +{{ content }} + +{% include "footer.jinja" %} diff --git a/templates/post.jinja b/templates/post.jinja new file mode 100644 index 0000000..693df80 --- /dev/null +++ b/templates/post.jinja @@ -0,0 +1,10 @@ +{% include "header.jinja" %} +## {{ frontmatter.title }} + +=> / Front page + +> Published: {% if frontmatter.date %}{{ frontmatter.date.strftime('%F') }}{%else%}TBD{% endif %} + +{{ content }} + +{% include "footer.jinja" %}