A crazy hack attempt at rewriting index.html....

This commit is contained in:
Jeffrey Phillips Freeman 2023-10-12 18:43:18 -04:00
parent becc986b5b
commit 2be3dd608a
No known key found for this signature in database
GPG key ID: AD914585C9406B6A
4 changed files with 43 additions and 13 deletions

4
clean-build.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
find public/news -name "index.html" -exec rename --all "index.html" "status.html" {} \;
find public/projects -name "index.html" -exec rename --all "index.html" "status.html" {} \;
find public/resource -name "index.html" -exec rename --all "index.html" "status.html" {} \;

View file

@ -8,15 +8,21 @@ DefaultContentLanguage = "en"
defaultContentLanguageInSubdir = false
enableRobotsTXT = true
uglyURLs=false
[services.rss]
limit = 50
# [permalinks]
# news = "/:section/:slug/"
# projects = "/:section/:slug/"
# resource = "/:section/:slug/"
# '/' = "/:section/:slug/"
# [permalinks.page]
# news = "/:section/:slug/"
# projects = "/:section/:slug/"
# resource = "/:section/:slug/"
# '/' = "/:section/:slug/"
[taxonimies]
tag = "tags"
@ -44,8 +50,14 @@ notAlternative = true
baseName = "manifest"
[outputFormats.ACTIVITY_STATUS]
mediaType = "application/activity+json"
notAlternative = true
notAlternative = false
baseName = "status"
#[outputFormats.HTML_STATUS]
#mediaType = "text/html"
#notAlternative = true
#baseName = "index"
#permalinkable=false
#noUgly=true
[outputs]
home = ["HTML", "RSS", "ACTIVITY", "ACTIVITY_OUTBOX", "MANIFEST"]

View file

@ -28,5 +28,8 @@
"@types/multiparty": "^0.0.34",
"typescript": "^5.2.2"
},
"type": "module"
"type": "module",
"scripts": {
"vercel-build": "sh clean-build.sh"
}
}

View file

@ -20,17 +20,6 @@
}
],
"rewrites": [
{
"source": "/news/(.*)/",
"has": [
{
"type": "header",
"key": "Accept",
"value": "application/activity+json"
}
],
"destination": "/news/$1/status.ajson"
},
{
"source": "/(.+)/$",
"destination": "/$1/index.html"
@ -71,6 +60,28 @@
"source": "/send-note",
"destination": "/api/activitypub/sendNote.js"
},
{
"source": "/:pathSection/:pathPage/",
"has": [
{
"type": "header",
"key": "Accept",
"value": "application/activity+json"
}
],
"destination": "/:pathSection/pathPage/status.ajson"
},
{
"source": "/:pathSection/:pathPage/",
"missing": [
{
"type": "header",
"key": "Accept",
"value": "application/activity+json"
}
],
"destination": "/:pathSection/pathPage/status.html"
},
{
"source": "/:pathSection/:pathPage/activity",
"destination": "/:pathSection/:pathPage/activity.ajson"