Compare commits
1 Commits
ca7597ee8f
...
4163177071
Author | SHA1 | Date | |
---|---|---|---|
|
4163177071 |
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
cd $(dirname "$0")
|
cd $(dirname "$0")
|
||||||
mkdir -p ./.dynamic
|
mkdir ./.dynamic
|
||||||
mkdir -p ./.temp
|
mkdir ./.temp
|
||||||
gcc -Wno-unused-result -Wno-incompatible-pointer-types waveforms.c ../../tools/gifenc/gifenc.c -I../../tools -O2 -o ./.temp/waveforms
|
gcc waveforms.c -I../../tools ../../tools/gifenc/gifenc.c -O2 -o ./.temp/waveforms
|
||||||
./.temp/waveforms
|
./.temp/waveforms
|
||||||
|
@ -15,7 +15,7 @@ for d in ./articles/*/; do
|
|||||||
mkdir -p "./html/articles/$(basename -- $d)"
|
mkdir -p "./html/articles/$(basename -- $d)"
|
||||||
cp -r "$d/.dynamic/." "./html/articles/$(basename -- $d)/"
|
cp -r "$d/.dynamic/." "./html/articles/$(basename -- $d)/"
|
||||||
fi
|
fi
|
||||||
./tools/article_wrapper.py "$d/page.mmd" https://mjestecko.neocities.org/ | ./tools/mmd/build/multimarkdown > "./html/articles/$(basename -- $d).html"
|
./tools/article_wrapper.py "$d/page.mmd" | ./tools/mmd/build/multimarkdown > "./html/articles/$(basename -- $d).html"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# todo: Show related git history of a file?
|
# todo: Show related git history of a file?
|
||||||
|
|
||||||
from sys import argv, exit
|
from sys import argv, exit
|
||||||
import time, urllib.parse, re
|
import time
|
||||||
|
|
||||||
from article_utils import the_line_after_metadata, parse_metadata
|
from article_utils import the_line_after_metadata, parse_metadata
|
||||||
from page_shares import wrap_page, MONTHS
|
from page_shares import wrap_page, MONTHS
|
||||||
@ -12,10 +12,6 @@ if len(argv) <= 1:
|
|||||||
print("No file was supplied")
|
print("No file was supplied")
|
||||||
exit(-1)
|
exit(-1)
|
||||||
|
|
||||||
if len(argv) <= 2:
|
|
||||||
print("No address was supplied")
|
|
||||||
exit(-1)
|
|
||||||
|
|
||||||
with open(argv[1], "r") as f:
|
with open(argv[1], "r") as f:
|
||||||
content = f.readlines()
|
content = f.readlines()
|
||||||
i = the_line_after_metadata(content)
|
i = the_line_after_metadata(content)
|
||||||
@ -46,16 +42,4 @@ if tags:
|
|||||||
|
|
||||||
article_head += "---\n\n"
|
article_head += "---\n\n"
|
||||||
|
|
||||||
# todo: Article namespace with related metadata.
|
print(''.join(content[:i]) + wrap_page(article_head + ''.join(content[i:])))
|
||||||
header = f"""HTML header: <meta property="og:title" content="{title} on mjestečko"></meta>
|
|
||||||
<meta property="og:type" content="article"></meta>
|
|
||||||
<meta property="og:url" content="{argv[2]}/articles/{urllib.parse.quote(title)}.html"></meta>
|
|
||||||
"""
|
|
||||||
if not brief is None:
|
|
||||||
header += f"""<meta property="og:description" content="{brief}"></meta>\n"""
|
|
||||||
|
|
||||||
front_image = re.compile(r"!\[.*\]\((.+?)\)", re.DOTALL).search(''.join(content[i:]))
|
|
||||||
if not front_image is None:
|
|
||||||
header += f"""<meta property="og:image" content="{argv[2]}/{urllib.parse.quote(front_image.group(1))}"></meta>\n"""
|
|
||||||
|
|
||||||
print(header + ''.join(content[:i]) + wrap_page(article_head + ''.join(content[i:])))
|
|
||||||
|
15
upload.sh
15
upload.sh
@ -1,15 +0,0 @@
|
|||||||
#!/usr/bin/bash
|
|
||||||
|
|
||||||
for cur in ./html/{*,**/*}; do
|
|
||||||
if [[ "$cur" == *"/tracks/"* ]]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
if [ -f "$cur" ]; then
|
|
||||||
d=$(dirname $(realpath --relative-to="./html" "$cur"))
|
|
||||||
if [[ "$d" == "." ]]; then
|
|
||||||
neocities upload $cur
|
|
||||||
else
|
|
||||||
neocities upload -d $(dirname $(realpath --relative-to="./html" "$cur")) $cur
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
Loading…
Reference in New Issue
Block a user