Short up the main paths

- `archive` -> `a`
- `blog` -> `b`
- `projects` -> `p`
This commit is contained in:
Awiteb 2024-02-27 16:47:33 +03:00
parent 7603954f86
commit ad18b87239
No known key found for this signature in database
GPG key ID: 16C8AD0B49C39C88
8 changed files with 10 additions and 9 deletions

View file

@ -138,9 +138,9 @@ favicon = "/favicon.png"
social_media_card = "img/social_cards/index.jpg"
menu = [
{name = "blog", url = "blog/"},
{name = "archive", url = "archive/"},
{name = "projects", url = "projects/"},
{name = "blog", url = "b/"},
{name = "archive", url = "a/"},
{name = "projects", url = "p/"},
]
# Extra menu to show on the footer, below socials section.

View file

@ -8,7 +8,7 @@ insert_anchor_links = "left"
[extra]
header = {title = "اهلآ، انا عويتب", img = "/img/awiteb-profile.png"}
section_path = "blog/_index.md"
section_path = "b/_index.md"
social_media_card = "img/social_cards/index.jpg"
max_posts = 4
+++

View file

@ -4,4 +4,5 @@ path = "archive"
template = "archive.html"
[extra]
section_path = "b/"
+++

View file

@ -1,6 +1,6 @@
+++
paginate_by = 5
path = "/blog"
path = "/b"
title = "تدويناتي"
sort_by = "date"
template = "section.html"

View file

@ -52,7 +52,7 @@ def now() -> str:
class Article:
def __init__(self, name: str) -> None:
self.name = name
self.path = f"content/blog/{name}/index.md"
self.path = f"content/b/{name}/index.md"
self.headers = {
"global": {},
"taxonomies": {},

View file

@ -1,11 +1,11 @@
#! /usr/bin/env nu
def main () {
let paths: list<string> = (git diff --name-only | split row "\n" | filter {|p| $p | str contains "content/blog"});
let posts: string = (ls content/blog | filter {|p| $p.type == "dir"} | each {|p| $p.name | sed 's/content\/blog\///g'});
let paths: list<string> = (git diff --name-only | split row "\n" | filter {|p| $p | str contains "content/b"});
let posts: string = (ls content/b | filter {|p| $p.type == "dir"} | each {|p| $p.name | sed 's/content\/b\///g'});
for post in $posts {
if $"content/blog/($post)/index.md" in $paths {
if $"content/b/($post)/index.md" in $paths {
echo $"`($post)` post has been modified";
python3 ./scripts/article.py card $post
python3 ./scripts/article.py update $post "global" "updated" $"(date now | format date '%Y-%m-%d')"