Skip to content

Commit f76824b

Browse files
reorganize + template bump + new (belated) update
1 parent 8826969 commit f76824b

File tree

159 files changed

+641
-306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+641
-306
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
__pycache__/
2+
.DS_Store

Diff for: Makefile

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
.PHONY: build
1+
.PHONY: build clean pelican
22

3-
build:
3+
build: clean pelican copy
4+
5+
clean:
6+
rm -rf docs
7+
8+
pelican:
49
./build.py
10+
11+
copy:
12+
cp badlink_detector.js docs/badlink_detector.js
13+
cp *.png docs/

Diff for: badlink_detector.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
(async () => {
2+
for (var a of document.querySelectorAll("a[href]")) {
3+
var ok = false;
4+
for (var url of [a.href, "https://corsproxy.io/?" + encodeURIComponent(a.href)]) {
5+
try {
6+
const response = await fetch(url, { method: "HEAD", mode: "no-cors" });
7+
ok = true;
8+
break;
9+
} catch (err) {
10+
continue;
11+
}
12+
}
13+
if (!ok) {
14+
a.classList.add("broken");
15+
a.title = "Possibly a broken link.";
16+
}
17+
}
18+
})();

Diff for: build.py

+19-9
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
ICON_MIMETYPE = "image/png"
2222
THEME_CSS_FILE = "/armdroid/theme.css"
2323
THEME_MAIN_CSS = "/static/css/main.css"
24-
EXTRA_JS = "/static/misc.js"
24+
EXTRA_JS = ("/static/misc.js", "/armdroid/badlink_detector.js")
2525
THEME_STATIC_DIR = "static/"
2626
USE_FOLDER_AS_CATEGORY = False
2727

2828
GOOGLE_TAG = "G-XR0F89CCGK" # cSpell: ignore ccgk
2929

30-
PATH = "aaaa/"
31-
OUTPUT_PATH = "./"
30+
PATH = "markdown/"
31+
OUTPUT_PATH = "docs/"
3232

3333
TIMEZONE = "America/New_York"
3434

@@ -48,10 +48,13 @@
4848
AUTHOR_SAVE_AS = AUTHORS_SAVE_AS = ""
4949
TAG_SAVE_AS = TAGS_SAVE_AS = ""
5050
CATEGORY_SAVE_AS = CATEGORIES_SAVE_AS = ""
51-
ARTICLE_SAVE_AS = ARTICLE_URL = "updates/{date:%Y}/{slug}.html"
52-
ARCHIVES_SAVE_AS = "updates/archive.html"
51+
ARTICLE_URL = "updates/{date:%Y}/{slug}"
52+
ARTICLE_SAVE_AS = ARTICLE_URL + "/index.html"
53+
ARCHIVES_URL = "updates/"
54+
ARCHIVES_SAVE_AS = "updates/index.html"
5355
PATH_METADATA = r"(?P<path_no_ext>.*)\.[^.]*"
54-
PAGE_URL = PAGE_SAVE_AS = "{path_no_ext}.html"
56+
PAGE_SAVE_AS = "{path_no_ext}/index.html"
57+
PAGE_URL = "{path_no_ext}"
5558
FILENAME_METADATA = ""
5659

5760
# Blogroll
@@ -67,6 +70,7 @@
6770
# Social
6871
SOCIAL = (
6972
(f"{AUTHOR} on GitHub", f"https://github.com/{AUTHOR}"),
73+
(f"{AUTHOR} on YouTube", f"https://youtube.com/@{AUTHOR}"),
7074
)
7175

7276
MENUITEMS = (
@@ -77,8 +81,8 @@
7781
DEFAULT_PAGINATION = 10
7882
DEFAULT_ORPHANS = 3
7983
PAGINATION_PATTERNS = (
80-
(1, "{name}{extension}", "{name}{extension}"),
81-
(2, "{name}_{number}{extension}", "{name}_{number}{extension}"),
84+
(1, "{url}", "{save_as}"),
85+
(2, "{base_name}/page{number}", "{base_name}/page{number}/index.html"),
8286
)
8387

8488
PAGE_PATHS = ["info/"]
@@ -161,4 +165,10 @@ def kroki_fence(source, language, css_class, options, md, **kwargs):
161165

162166
if __name__ == "__main__":
163167
import os
164-
os.system(f"pelican {PATH} -o {OUTPUT_PATH} -s {__file__}")
168+
import shlex
169+
os.system(f"""pelican {
170+
shlex.quote(PATH)
171+
} -o {
172+
shlex.quote(OUTPUT_PATH)
173+
} -s {
174+
shlex.quote(__file__)}""")

Diff for: .nojekyll renamed to docs/.nojekyll

File renamed without changes.

Diff for: 404.html renamed to docs/404.html

+7-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: docs/Arm_Welcome.png

1.13 MB
Loading

Diff for: docs/arm_pieces_junk.png

1.71 MB
Loading

Diff for: docs/armdroid.png

2.65 KB
Loading

Diff for: docs/armdroid_sm.png

363 Bytes
Loading

Diff for: docs/badlink_detector.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
(async () => {
2+
for (var a of document.querySelectorAll("a[href]")) {
3+
var ok = false;
4+
for (var url of [a.href, "https://corsproxy.io/?" + encodeURIComponent(a.href)]) {
5+
try {
6+
const response = await fetch(url, { method: "HEAD", mode: "no-cors" });
7+
ok = true;
8+
break;
9+
} catch (err) {
10+
continue;
11+
}
12+
}
13+
if (!ok) {
14+
a.classList.add("broken");
15+
a.title = "Possibly a broken link.";
16+
}
17+
}
18+
})();

0 commit comments

Comments
 (0)