authoring server 5
All checks were successful
Build Org Website / build (push) Successful in 44s

This commit is contained in:
2026-05-07 14:02:04 +01:00
parent 2fd5a098b1
commit 900ef114a3
9 changed files with 41 additions and 25 deletions

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -271,7 +271,7 @@ def safe_target_path(path: str, slug: str, page_type: str) -> Path:
def markdown_title(content: str, fallback: str) -> str:
for line in content.splitlines():
match = re.match(r"^#\s+(.+?)\s*$", line)
match = re.match(r"^#{1,6}\s+(.+?)\s*$", line)
if match:
return match.group(1).strip()
return fallback.replace("-", " ").replace("_", " ").title()
@@ -404,7 +404,23 @@ def render_markdown(data: dict[str, Any]) -> str:
title = str(data.get("title") or "").strip()
if not title:
raise ValueError("Title is required.")
content = re.sub(
r'<a\b[^>]*>\s*<img\b[^>]*\bsrc="([^"]+)"[^>]*\balt="([^"]*)"[^>]*>\s*</a>',
lambda match: f"![{match.group(2)}]({match.group(1)})",
content,
flags=re.IGNORECASE,
)
if content:
if re.search(r"^#{1,6}\s+.+?\s*$", content, flags=re.MULTILINE):
content = re.sub(
r"^#{1,6}\s+.+?\s*$",
f"# {title}",
content,
count=1,
flags=re.MULTILINE,
)
else:
content = f"# {title}\n\n{content}"
return content + "\n"
return f"# {title}\n"
@@ -533,7 +549,7 @@ def save_upload(filename: str, payload: bytes, page_path: str = "") -> dict[str,
if mime.startswith("video/") or ext in {".mp4", ".webm", ".mov"}:
markdown = f'<video controls src="{relative_url}"></video>'
else:
markdown = gallery_image_html(target.name, rel, page_path, payload, ext)
markdown = f"![{target.name}]({relative_url})"
return {
"url": absolute_url,
"relativeUrl": relative_url,

View File

@@ -32,6 +32,8 @@ redefine site-root themselves.")
;; Keep the old name around so any stray code still compiles.
(defvaralias 'site-root 'z/site-root)
(setq create-lockfiles nil)
(defun site-path (path)
"Expand PATH relative to `z/site-root'."
(expand-file-name path z/site-root))
@@ -419,7 +421,7 @@ Created with %c on <a href=\"https://www.archlinux.org/\">Arch</a> \
(with-temp-buffer
(insert-file-contents filename nil 0 4096)
(goto-char (point-min))
(if (re-search-forward "^# +\\(.+?\\)\\s-*$" nil t)
(if (re-search-forward "^#+ +\\(.+?\\)\\s-*$" nil t)
(match-string 1)
fallback)))

View File

@@ -1,5 +1,4 @@
## Welcome to the new lima page!
# Weeee
I made quite a few changes. It all started when I realised that not everyone knows how to use `.org` files and editing with them (they are quite niche). So I decided to make a very unique solution by having markdown files, which through a process of very complicated transformations result into the very page youre looking at now :)
- You can edit files using this link in [nextcloud](https://nextcloud.zainezq.com/apps/files/files/18016?dir=/lima-website).
@@ -12,4 +11,4 @@ I made quite a few changes. It all started when I realised that not everyone kno
- One other thing, a more personal one: what do you think of all this? am i doing too much? am i doing too little? am i overengineering things? am i forcing you to do something you dont wanna do? these little trinkets work for me, but im not sure if it would work for someone else, so at any point if you have reservations, let me know okay?
<a href="https://zainezq.com/assets/images/hzone/2026/05/20260507-135058-example-png-image.png" data-img="https://zainezq.com/assets/images/hzone/2026/05/20260507-135058-example-png-image.png" data-alt="20260507-135058-example-png-image.png" data-width="512" data-height="512"><img src="../assets/images/hzone/2026/05/20260507-135058-example-png-image.png" alt="20260507-135058-example-png-image.png" style="cursor: zoom-in;"></a>
![20260507-140053-example-png-image.png](../assets/images/hzone/2026/05/20260507-140053-example-png-image.png)

View File

@@ -2,7 +2,6 @@
#+OPTIONS: num:nil
#+DATE: <2026-02-15 Sun 23:00>
#+filetags: :learning:notes:
#+WIP:
#+COMMENTS: t
#+SLUG: restful-api

View File

@@ -4,7 +4,7 @@
See the categories: @@html:<a href="../home/categories.html">Categories</a>@@
* Posts:
- [[file:career/career-list.org][Career List]] @@html:<span class="post-date">07-05-2026 13:53</span>@@
- [[file:career/career-list.org][Career List]] @@html:<span class="post-date">07-05-2026 14:01</span>@@
- [[file:posts-list.sync-conflict-20260417-233432-VT6366A.org][Posts List]] @@html:<span class="post-date">14-04-2026 16:36</span>@@
- [[file:career/ha-dr.org][High Availability, Disaster Recovery and Business Continuity]] @@html:<span class="post-date">11-03-2026 17:18</span>@@ @@html:<a href="/tags/learning.html"><span class="post-tag">learning</span></a>@@ @@html:<a href="/tags/notes.html"><span class="post-tag">notes</span></a>@@
- [[file:career/javascript.org][Understands the Javascript language]] @@html:<span class="post-date">11-03-2026 16:52</span>@@ @@html:<a href="/tags/learning.html"><span class="post-tag">learning</span></a>@@ @@html:<a href="/tags/notes.html"><span class="post-tag">notes</span></a>@@

View File

@@ -4,6 +4,21 @@
- [[file:recently-updated.sync-conflict-20260417-233430-VT6366A.org][Recently Updated]]
- [[file:wip.org][Work in progress]]
- [[file:recently-updated.org][Recently Updated]]
- tags
- [[file:tags/review.sync-conflict-20260328-203248-VT6366A.org][Tag: review]]
- [[file:tags/life.sync-conflict-20260417-233423-VT6366A.org][Tag: life]]
- [[file:tags/introduction.org][Tag: introduction]]
- [[file:tags/learning.org][Tag: learning]]
- [[file:tags/notes.org][Tag: notes]]
- [[file:tags/review.org][Tag: review]]
- [[file:tags/website.org][Tag: website]]
- [[file:tags/update.org][Tag: update]]
- [[file:tags/life.org][Tag: life]]
- [[file:tags/education.org][Tag: education]]
- [[file:tags/insights.org][Tag: insights]]
- [[file:tags/reading.org][Tag: reading]]
- [[file:tags/emacs.org][Tag: emacs]]
- [[file:tags/maths.org][Tag: maths]]
- home
- [[file:home/countdown.org][Countdown]]
- [[file:home/contact.org][Contact]]
@@ -51,18 +66,3 @@
- [[file:books/clean-code/clean-code-notes.org][Clean Code Notes]]
- lima
- [[file:lima/lima-list.org][Lima]]
- tags
- [[file:tags/review.sync-conflict-20260328-203248-VT6366A.org][Tag: review]]
- [[file:tags/life.sync-conflict-20260417-233423-VT6366A.org][Tag: life]]
- [[file:tags/introduction.org][Tag: introduction]]
- [[file:tags/learning.org][Tag: learning]]
- [[file:tags/notes.org][Tag: notes]]
- [[file:tags/review.org][Tag: review]]
- [[file:tags/website.org][Tag: website]]
- [[file:tags/update.org][Tag: update]]
- [[file:tags/life.org][Tag: life]]
- [[file:tags/insights.org][Tag: insights]]
- [[file:tags/emacs.org][Tag: emacs]]
- [[file:tags/education.org][Tag: education]]
- [[file:tags/reading.org][Tag: reading]]
- [[file:tags/maths.org][Tag: maths]]