Compare commits
No commits in common. "c36ce7dd2055e23781b3e5c830f80f87e7ad0552" and "3ac4bc2965f3a0b8b006cd4873d4329eded53067" have entirely different histories.
c36ce7dd20
...
3ac4bc2965
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
**/__pycache__/
|
||||
**/__pycache__/*
|
||||
html/
|
||||
./.*/
|
||||
[articles/**/.static/]
|
||||
|
@ -1,7 +1,7 @@
|
||||
Title: Testing Firefox Wasm Tail Call
|
||||
Brief: Or why assumptions are not always correct.
|
||||
Date: 1708076705
|
||||
Tags: Optimization, Wasm, Interpreters
|
||||
Tags: Wasm, Interpreters
|
||||
CSS: /style.css
|
||||
|
||||
### Lore ###
|
||||
|
@ -1,7 +1,7 @@
|
||||
Title: Hand Optimized Simplex 2D
|
||||
Brief: Results of messing around with moving and hoisting stuff around.
|
||||
Date: 1688995095
|
||||
Tags: Programming, GLSL, OpenGL, Optimization
|
||||
Tags: Programming, GLSL, OpenGL
|
||||
CSS: /style.css
|
||||
|
||||
![](/articles/hand-opt-simplex-2d/noise.png)
|
||||
|
@ -1,7 +1,7 @@
|
||||
Title: Cached Neocities Uploads
|
||||
Brief: Making uploading of directories to Neocities less painful.
|
||||
Date: 1707585916
|
||||
Tags: Programming, Bash
|
||||
Tags: Bash
|
||||
CSS: /style.css
|
||||
|
||||
Quick and dirty Bash-based sha256sum checksum solution to create stamps for later checking and rejection.
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
|
||||
cd $(dirname "$0")
|
||||
mkdir -p ./.dynamic
|
||||
mkdir -p ./.temp
|
||||
$CC -Wno-unused-result -Wno-incompatible-pointer-types waveforms.c ../../tools/gifenc/gifenc.c -I../../tools -O2 -o ./.temp/waveforms
|
||||
gcc -Wno-unused-result -Wno-incompatible-pointer-types waveforms.c ../../tools/gifenc/gifenc.c -I../../tools -O2 -o ./.temp/waveforms
|
||||
./.temp/waveforms
|
||||
|
20
compile.sh
20
compile.sh
@ -1,12 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
|
||||
set +e
|
||||
|
||||
# Settings:
|
||||
# =========
|
||||
export CC=cc
|
||||
export URL=https://mjestecko.neocities.org
|
||||
|
||||
mkdir -p ./html/articles
|
||||
|
||||
./tools/main_page_generator.py ./articles | ./tools/mmd/build/multimarkdown > ./html/index.html
|
||||
@ -14,7 +9,7 @@ mkdir -p ./html/articles
|
||||
for d in ./articles/*/; do
|
||||
if [ -d "$d" ]; then
|
||||
if test -f "$d/make"; then
|
||||
("$d/make")
|
||||
"$d/make"
|
||||
fi
|
||||
if test -d "$d/.dynamic"; then
|
||||
mkdir -p "./html/articles/$(basename -- $d)"
|
||||
@ -24,15 +19,8 @@ for d in ./articles/*/; do
|
||||
mkdir -p "./html/articles/$(basename -- $d)"
|
||||
cp -r "$d/.static/." "./html/articles/$(basename -- $d)/"
|
||||
fi
|
||||
./tools/article_wrapper.py "$d/page.mmd" $URL | ./tools/mmd/build/multimarkdown > "./html/articles/$(basename -- $d).html"
|
||||
./tools/article_wrapper.py "$d/page.mmd" https://mjestecko.neocities.org | ./tools/mmd/build/multimarkdown > "./html/articles/$(basename -- $d).html"
|
||||
fi
|
||||
done
|
||||
|
||||
mkdir -p "./html/tags/"
|
||||
./tools/tag_listing_generator.py ./articles/ ./html/ | ./tools/mmd/build/multimarkdown > "./html/tags.html"
|
||||
|
||||
for f in ./html/tags/*.html; do
|
||||
echo $(cat "$f" | ./tools/mmd/build/multimarkdown) > "$f"
|
||||
done
|
||||
|
||||
./tools/feed_generator.py ./articles/ $URL > ./html/feed.xml
|
||||
./tools/feed_generator.py ./articles/ https://mjestecko.neocities.org > ./html/feed.xml
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/bash
|
||||
|
||||
set +e
|
||||
shopt -s extglob
|
||||
|
@ -16,87 +16,87 @@ a {
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: 20px;
|
||||
font-family: "Charter","Georgia",'Times New Roman',serif;
|
||||
font-size: 20px;
|
||||
font-family: "Charter","Georgia",'Times New Roman',serif;
|
||||
}
|
||||
body {
|
||||
background-color: var(--bg-color);
|
||||
line-height: 1.3;
|
||||
background-color: var(--bg-color);
|
||||
line-height: 1.3;
|
||||
}
|
||||
article, .container {
|
||||
max-width: 800px;
|
||||
margin: auto;
|
||||
max-width: 800px;
|
||||
margin: auto;
|
||||
}
|
||||
h1,h2,h3,h4 {
|
||||
font-family: arial, sans;
|
||||
font-family: arial, sans;
|
||||
}
|
||||
h2 {
|
||||
text-align: center;
|
||||
margin-bottom: 1em;
|
||||
text-align: center;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
h3 {
|
||||
font-family: arial, sans;
|
||||
margin: 1.3em 0 0.9em;
|
||||
font-family: arial, sans;
|
||||
margin: 1.3em 0 0.9em;
|
||||
}
|
||||
b {
|
||||
font-family: arial, sans;
|
||||
font-weight: normal;
|
||||
font-size: 0.8em;
|
||||
font-family: arial, sans;
|
||||
font-weight: normal;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
pre, p {
|
||||
margin: 0.9em 0px 0.9em;
|
||||
margin: 0.9em 0px 0.9em;
|
||||
}
|
||||
pre, code {
|
||||
background-color: var(--bg-color);
|
||||
line-height: normal;
|
||||
overflow: auto;
|
||||
font-size: 0.8em;
|
||||
background-color: var(--bg-color);
|
||||
line-height: normal;
|
||||
overflow: auto;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
pre {
|
||||
padding: 0.5em 0.5em;
|
||||
border-radius: 4px;
|
||||
padding: 0.5em 0.5em;
|
||||
border-radius: 4px;
|
||||
}
|
||||
nav ul {
|
||||
padding-left: 0;
|
||||
border-radius: 4px;
|
||||
list-style: none;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
font-size: 0.8em;
|
||||
background-color: var(--bg-color);
|
||||
border: 1px solid #bbbbdd;
|
||||
padding-left: 0;
|
||||
border-radius: 4px;
|
||||
list-style: none;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
font-size: 0.8em;
|
||||
background-color: var(--bg-color);
|
||||
border: 1px solid #bbbbdd;
|
||||
}
|
||||
nav li:first-child {
|
||||
border-left: none;
|
||||
border-left: none;
|
||||
}
|
||||
nav li {
|
||||
border-right: 1px solid #bbbbdd;
|
||||
border-left: 1px solid #ffffff;
|
||||
border-right: 1px solid #bbbbdd;
|
||||
border-left: 1px solid #ffffff;
|
||||
}
|
||||
nav a {
|
||||
padding: 0.4em 1em;
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
font-family: arial, sans;
|
||||
padding: 0.4em 1em;
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
font-family: arial, sans;
|
||||
}
|
||||
nav a:hover {
|
||||
background-color: #e0e0e0;
|
||||
background-color: #e0e0e0;
|
||||
}
|
||||
nav a:link {
|
||||
color: var(--link-color);
|
||||
color: var(--link-color);
|
||||
}
|
||||
nav a:visited {
|
||||
color: var(--link-color);
|
||||
color: var(--link-color);
|
||||
}
|
||||
nav a.here {
|
||||
background-color: #e0e0e0;
|
||||
background-color: #e0e0e0;
|
||||
}
|
||||
@media only screen and (max-device-width: 480px) {
|
||||
article, .container {
|
||||
width: 100%;
|
||||
}
|
||||
html {
|
||||
font-size: 13px;
|
||||
}
|
||||
article, .container {
|
||||
width: 100%;
|
||||
}
|
||||
html {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
|
||||
git submodule init
|
||||
git submodule update
|
||||
|
@ -18,7 +18,7 @@ def parse_metadata(filepath: str) -> {}:
|
||||
if key == "Date":
|
||||
result["Date"] = time.gmtime(int(val))
|
||||
elif key == "Tags":
|
||||
result["Tags"] = [v.strip() for v in val.split(",")]
|
||||
result["Tags"] = val.split(",")
|
||||
else:
|
||||
result[key] = val
|
||||
result["Last Edit"] = time.gmtime(int(subprocess.getoutput(r"stat -c %Y " + filepath)))
|
||||
|
@ -24,7 +24,7 @@ with open(argv[1], "r") as f:
|
||||
metadata = parse_metadata(argv[1])
|
||||
directory = path.split(path.dirname(path.abspath(argv[1])))[-1]
|
||||
|
||||
title = metadata["Title"]
|
||||
title = metadata.get("Title", "Oopsie, somebody forgot to name the article!")
|
||||
article_head = "\n# " + title + "\n"
|
||||
|
||||
brief = metadata.get("Brief")
|
||||
@ -41,12 +41,10 @@ if not last_edit is None:
|
||||
last_edit.tm_mday != date.tm_mday or last_edit.tm_year != date.tm_year:
|
||||
article_head += f"-- Edited: *{MONTHS[last_edit.tm_mon]} {last_edit.tm_mday}, {last_edit.tm_year} UTC*\n\n"
|
||||
|
||||
# todo: Hyperlinks to appropriate tag pages.
|
||||
tags = metadata.get("Tags")
|
||||
if tags:
|
||||
tag_links = []
|
||||
for tag in tags:
|
||||
tag_links.append(f"[{tag}](/tags/{urllib.parse.quote(tag.lower())}.html)")
|
||||
article_head += f"""-- Tags: *{", ".join(tag_links)}*\n\n"""
|
||||
article_head += f"""-- Tags: *{",".join(tags)}*\n\n"""
|
||||
|
||||
article_head += "---\n\n"
|
||||
|
||||
|
@ -10,7 +10,6 @@ HEAD_EMBED = """
|
||||
<li><a href="/articles/mjestečko.html">about</a></li>
|
||||
<li><a href="https://modarchive.org/index.php?request=view_artist_modules&query=96070">tracks</a></li>
|
||||
<li><a rel="me" href="https://poto.cafe/@veclavtalica">mastodon</a></li>
|
||||
<li><a href="/tags.html">tags</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
@ -18,7 +17,7 @@ HEAD_EMBED = """
|
||||
|
||||
NOTICE = """
|
||||
<footer>
|
||||
<a href="#top">^ Return</a>
|
||||
<a href="#top">Take me home ↑</a>
|
||||
</footer>
|
||||
|
||||
"""
|
||||
|
@ -1,54 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# todo: Problems might arise with casing if there are overlaps such as 'Tag' and 'tag'.
|
||||
|
||||
from sys import argv, exit
|
||||
import time, urllib.parse, re
|
||||
from os import walk
|
||||
import os.path as path
|
||||
|
||||
from article_utils import the_line_after_metadata, parse_metadata
|
||||
from page_shares import wrap_page
|
||||
|
||||
tag_listing_header = "CSS: /style.css\n\n"
|
||||
main_listing_header = "CSS: /style.css\n\n"
|
||||
|
||||
if len(argv) <= 1:
|
||||
print("No article directory was supplied")
|
||||
exit(-1)
|
||||
|
||||
if len(argv) <= 2:
|
||||
print("No tag listing output directory was supplied")
|
||||
exit(-1)
|
||||
|
||||
tag_to_tag_page = {}
|
||||
tag_to_articles = {}
|
||||
tag_counts = {}
|
||||
article_to_title = {}
|
||||
|
||||
for root, dirs, _ in walk(argv[1]):
|
||||
for d in dirs:
|
||||
metadata = parse_metadata(path.abspath(root + '/' + d + "/page.mmd"))
|
||||
article = "/articles/" + urllib.parse.quote(d) + ".html"
|
||||
for tag in metadata.get('Tags', []):
|
||||
tag_to_articles[tag] = tag_to_articles.get(tag, []) + [article]
|
||||
tag_counts[tag] = tag_counts.get(tag, 0) + 1
|
||||
article_to_title[article] = metadata['Title']
|
||||
break
|
||||
|
||||
for tag in tag_to_articles:
|
||||
tag_page = f"/tags/{urllib.parse.quote(tag.lower())}.html"
|
||||
tag_to_tag_page[tag] = tag_page
|
||||
|
||||
with open(argv[2] + tag_page, 'w') as f:
|
||||
tagged_article_listing = f"\n# Tagged {tag} #\n---\n" + \
|
||||
'\n'.join(f"- [{article_to_title[article]}]({article})" \
|
||||
for article in tag_to_articles[tag])
|
||||
f.write(tag_listing_header + wrap_page(tagged_article_listing))
|
||||
|
||||
main_listing = "\n# Tag Listing #\n---\n" + \
|
||||
', '.join(f"[{tag}]({tag_to_tag_page[tag]}) ({tag_counts[tag]})" \
|
||||
for tag in sorted(tag_counts.keys(), key=lambda x: tag_counts[x], reverse=True)) + \
|
||||
'\n\n'
|
||||
|
||||
print(main_listing_header + wrap_page(main_listing))
|
Loading…
Reference in New Issue
Block a user