This commit is contained in:
0
assets/images/hzone/2026/05/20260507-135058-example-png-image.png
Normal file → Executable file
0
assets/images/hzone/2026/05/20260507-135058-example-png-image.png
Normal file → Executable 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 |
@@ -271,7 +271,7 @@ def safe_target_path(path: str, slug: str, page_type: str) -> Path:
|
|||||||
|
|
||||||
def markdown_title(content: str, fallback: str) -> str:
|
def markdown_title(content: str, fallback: str) -> str:
|
||||||
for line in content.splitlines():
|
for line in content.splitlines():
|
||||||
match = re.match(r"^#\s+(.+?)\s*$", line)
|
match = re.match(r"^#{1,6}\s+(.+?)\s*$", line)
|
||||||
if match:
|
if match:
|
||||||
return match.group(1).strip()
|
return match.group(1).strip()
|
||||||
return fallback.replace("-", " ").replace("_", " ").title()
|
return fallback.replace("-", " ").replace("_", " ").title()
|
||||||
@@ -404,7 +404,23 @@ def render_markdown(data: dict[str, Any]) -> str:
|
|||||||
title = str(data.get("title") or "").strip()
|
title = str(data.get("title") or "").strip()
|
||||||
if not title:
|
if not title:
|
||||||
raise ValueError("Title is required.")
|
raise ValueError("Title is required.")
|
||||||
|
content = re.sub(
|
||||||
|
r'<a\b[^>]*>\s*<img\b[^>]*\bsrc="([^"]+)"[^>]*\balt="([^"]*)"[^>]*>\s*</a>',
|
||||||
|
lambda match: f"})",
|
||||||
|
content,
|
||||||
|
flags=re.IGNORECASE,
|
||||||
|
)
|
||||||
if content:
|
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 content + "\n"
|
||||||
return f"# {title}\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"}:
|
if mime.startswith("video/") or ext in {".mp4", ".webm", ".mov"}:
|
||||||
markdown = f'<video controls src="{relative_url}"></video>'
|
markdown = f'<video controls src="{relative_url}"></video>'
|
||||||
else:
|
else:
|
||||||
markdown = gallery_image_html(target.name, rel, page_path, payload, ext)
|
markdown = f""
|
||||||
return {
|
return {
|
||||||
"url": absolute_url,
|
"url": absolute_url,
|
||||||
"relativeUrl": relative_url,
|
"relativeUrl": relative_url,
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ redefine site-root themselves.")
|
|||||||
;; Keep the old name around so any stray code still compiles.
|
;; Keep the old name around so any stray code still compiles.
|
||||||
(defvaralias 'site-root 'z/site-root)
|
(defvaralias 'site-root 'z/site-root)
|
||||||
|
|
||||||
|
(setq create-lockfiles nil)
|
||||||
|
|
||||||
(defun site-path (path)
|
(defun site-path (path)
|
||||||
"Expand PATH relative to `z/site-root'."
|
"Expand PATH relative to `z/site-root'."
|
||||||
(expand-file-name path 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
|
(with-temp-buffer
|
||||||
(insert-file-contents filename nil 0 4096)
|
(insert-file-contents filename nil 0 4096)
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(if (re-search-forward "^# +\\(.+?\\)\\s-*$" nil t)
|
(if (re-search-forward "^#+ +\\(.+?\\)\\s-*$" nil t)
|
||||||
(match-string 1)
|
(match-string 1)
|
||||||
fallback)))
|
fallback)))
|
||||||
|
|
||||||
|
|||||||
@@ -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 you’re looking at now :)
|
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 you’re looking at now :)
|
||||||
|
|
||||||
- You can edit files using this link in [nextcloud](https://nextcloud.zainezq.com/apps/files/files/18016?dir=/lima-website).
|
- 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 i’m not sure if it would work for someone else, so at any point if you have reservations, let me know okay?
|
- 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 i’m 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>
|

|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
#+OPTIONS: num:nil
|
#+OPTIONS: num:nil
|
||||||
#+DATE: <2026-02-15 Sun 23:00>
|
#+DATE: <2026-02-15 Sun 23:00>
|
||||||
#+filetags: :learning:notes:
|
#+filetags: :learning:notes:
|
||||||
#+WIP:
|
|
||||||
#+COMMENTS: t
|
#+COMMENTS: t
|
||||||
#+SLUG: restful-api
|
#+SLUG: restful-api
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
See the categories: @@html:<a href="../home/categories.html">Categories</a>@@
|
See the categories: @@html:<a href="../home/categories.html">Categories</a>@@
|
||||||
|
|
||||||
* Posts:
|
* 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: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/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>@@
|
- [[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>@@
|
||||||
|
|||||||
30
sitemap.org
30
sitemap.org
@@ -4,6 +4,21 @@
|
|||||||
- [[file:recently-updated.sync-conflict-20260417-233430-VT6366A.org][Recently Updated]]
|
- [[file:recently-updated.sync-conflict-20260417-233430-VT6366A.org][Recently Updated]]
|
||||||
- [[file:wip.org][Work in progress]]
|
- [[file:wip.org][Work in progress]]
|
||||||
- [[file:recently-updated.org][Recently Updated]]
|
- [[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
|
- home
|
||||||
- [[file:home/countdown.org][Countdown]]
|
- [[file:home/countdown.org][Countdown]]
|
||||||
- [[file:home/contact.org][Contact]]
|
- [[file:home/contact.org][Contact]]
|
||||||
@@ -51,18 +66,3 @@
|
|||||||
- [[file:books/clean-code/clean-code-notes.org][Clean Code Notes]]
|
- [[file:books/clean-code/clean-code-notes.org][Clean Code Notes]]
|
||||||
- lima
|
- lima
|
||||||
- [[file:lima/lima-list.org][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]]
|
|
||||||
Reference in New Issue
Block a user