]> Lady’s Gitweb - x_status_git/commitdiff
Add basic full‐site metadata 0.1.1
authorLady <redacted>
Mon, 29 Aug 2022 01:09:32 +0000 (18:09 -0700)
committerLady <redacted>
Fri, 15 Dec 2023 03:55:15 +0000 (22:55 -0500)
README.markdown
about.html [new file with mode: 0644]
post-receive

index 31f9ac56512670555f26ae14639e6ec52b8d8a13..a0f841366a0c919f49d79f265640fcae53652b9c 100644 (file)
@@ -81,6 +81,15 @@ Note that these paths **do not** have a trailing slash.
 
  +  **`GET /`**:
     Serve the file at `/index.html`.
 
  +  **`GET /`**:
     Serve the file at `/index.html`.
+    A `Link` header with the value
+      `</about.jsonld>;rel=meta;type="application/ld+json"` (or
+      equivalent) **must** be provided.
+
+ +  **`GET /about`**:
+    Serve the file at `/.about.html`.
+    A `Link` header with the value
+      `</about.jsonld>;rel=meta;type="application/ld+json"` (or
+      equivalent) **must** be provided.
 
  +  **`GET /statuses`**:
     Serve the file at `/.statuses.html`.
 
  +  **`GET /statuses`**:
     Serve the file at `/.statuses.html`.
@@ -126,6 +135,9 @@ These responses **should** be served with a `Content-Type` of
 In all cases, for `/$PATH.jsonld`, this just serves the file at
   `/$PATH/index.jsonld`.
 
 In all cases, for `/$PATH.jsonld`, this just serves the file at
   `/$PATH/index.jsonld`.
 
+ +  **`GET /about.jsonld`**:
+    Serve the file at `/about/index.jsonld`.
+
  +  **`GET /statuses.jsonld`**:
     Serve the file at `/statuses/index.jsonld`.
 
  +  **`GET /statuses.jsonld`**:
     Serve the file at `/statuses/index.jsonld`.
 
@@ -280,21 +292,27 @@ Assuming the U·R·L you were given was valid, you will end this
  +  If the `@type` is or contains `Thread`, the resource is a
       collection of statuses.
 
  +  If the `@type` is or contains `Thread`, the resource is a
       collection of statuses.
 
-The items in the collection may be determined through one of the
-  following methods :—
+ +  If the `@type` is or contains `Microblog`, the resource describes
+      this site as a whole.
+    The `streams` property will contain a list of available `Forum`s
+      and `Thread`s, as objects with an `@id` and `@type`.
+
+The items in the collection (`Forum` or `Thread`) may be determined
+  through one of the following methods :—
 
 
- +  If the `@type` is or contains `OrderedCollectionPage`, then its
-      `items` will be an array of resources.
+ +  If the `@type` is or contains `CollectionPage` or
+      `OrderedCollectionPage`, then its `items` will contain resources.
     This is a partial collection, and the `prev` and `next` properties
       can be used to access further items from the parent collection
       (indicated by `partOf`).
     This is a partial collection, and the `prev` and `next` properties
       can be used to access further items from the parent collection
       (indicated by `partOf`).
+    `first` and `current`, in this scenario, point “horizontally” to
+      the first and latest pages of items, not to subpages.
 
 
- +  If the `@type` is or contains `OrderedCollection`, and the resource
-      has `first` and `current` properties, then the `items` property
-      will not be present.
+ +  If the `@type` is or contains `Collection` or `OrderedCollection`
+      and the resource has `first` and/or `current` properties, then
+      the `items` property will not be present.
     `first` and `current` can be accessed to provide
     `first` and `current` can be accessed to provide
-      `OrderedCollectionPage`s listing the items of the collection as
-      above.
+      `OrderedCollectionPage`s listing the items of the collection.
 
  +  Otherwise, the `items` property will contain every item in the
       collection.
 
  +  Otherwise, the `items` property will contain every item in the
       collection.
diff --git a/about.html b/about.html
new file mode 100644 (file)
index 0000000..c12dfa5
--- /dev/null
@@ -0,0 +1,26 @@
+<!dOcTyPe html>
+<HTML Lang=en>
+<TITLE>About</TITLE>
+<STYLE>
+body{ Display: Grid; Box-Sizing: Border-Box; Margin: Auto; Padding-Inline: 1REM; Min-Block-Size: 100VH; Inline-Size: 100%; Max-Inline-Size: 45REM; Align-Content: Center; Justify-Content: Stretch; Font-Family: Sans-Serif }
+</STYLE>
+<H1>About</H1>
+<NAV><UL></UL></NAV>
+<SCRIPT Type=module>
+document.title = location.hostname
+document.body.querySelector("h1").textContent = location.hostname
+const ul = document.body.querySelector("nav>ul")
+fetch(`${location}.jsonld`)
+.then($ => $.json())
+.then(meta => {
+  { const a = ul
+    .appendChild(document.createElement("li"))
+    .appendChild(document.createElement("a"))
+    a.href = meta.streams.find($ => $["@type"] == "Thread")["@id"]
+    a.textContent = "Updates" }
+  { const a = ul
+    .appendChild(document.createElement("li"))
+    .appendChild(document.createElement("a"))
+    a.href = meta.streams.find($ => $["@type"] == "Forum")["@id"]
+    a.textContent = "Topics" } })
+</SCRIPT>
index 94620bef5af2ff241278cadb7e005994965f3b46..bc16a55fab558b444134ae5a4197b7a69652e801 100755 (executable)
@@ -128,11 +128,18 @@ if stdin.read().split()[-1] == f"refs/heads/{LIVE_BRANCH}":
 
        # Copy H·T·M·L files to their expected locations.
        copy2(f"{BUILD_DIRECTORY}/index.html", f"{PUBLIC_DIRECTORY}/index.html")
 
        # Copy H·T·M·L files to their expected locations.
        copy2(f"{BUILD_DIRECTORY}/index.html", f"{PUBLIC_DIRECTORY}/index.html")
+       copy2(f"{BUILD_DIRECTORY}/about.html", f"{PUBLIC_DIRECTORY}/.about.html")
        copy2(f"{BUILD_DIRECTORY}/status.html", f"{PUBLIC_DIRECTORY}/.status.html")
        copy2(f"{BUILD_DIRECTORY}/statuses.html", f"{PUBLIC_DIRECTORY}/.statuses.html")
        copy2(f"{BUILD_DIRECTORY}/topic.html", f"{PUBLIC_DIRECTORY}/.topic.html")
        copy2(f"{BUILD_DIRECTORY}/topics.html", f"{PUBLIC_DIRECTORY}/.topics.html")
 
        copy2(f"{BUILD_DIRECTORY}/status.html", f"{PUBLIC_DIRECTORY}/.status.html")
        copy2(f"{BUILD_DIRECTORY}/statuses.html", f"{PUBLIC_DIRECTORY}/.statuses.html")
        copy2(f"{BUILD_DIRECTORY}/topic.html", f"{PUBLIC_DIRECTORY}/.topic.html")
        copy2(f"{BUILD_DIRECTORY}/topics.html", f"{PUBLIC_DIRECTORY}/.topics.html")
 
+       # Output “about” metadata
+       if not exists(f"{PUBLIC_DIRECTORY}/about"):
+               mkdir(f"{PUBLIC_DIRECTORY}/about")
+       with open(f"{PUBLIC_DIRECTORY}/about/index.jsonld", "w", encoding="utf-8") as f:
+               json.dump({ "@context": { "@language": LANG, "activity": "https://www.w3.org/ns/activitystreams#", "sioc": "http://rdfs.org/sioc/ns#", "sioct": "http://rdfs.org/sioc/types#", "Forum": "sioc:Forum", "Thread": "sioc:Thread", "Microblog": "sioct:Microblog", "streams": { "@id": "activity:streams", "@type": "@id" } }, "@id": f"{PUBLIC_URL}", "@type": "Microblog", "streams": [{ "@id": f"{PUBLIC_URL}/statuses", "@type": "Thread" }, { "@id": f"{PUBLIC_URL}/topics", "@type": "Forum" }] }, f, ensure_ascii=False, allow_nan=False)
+
        # Output month‐based listings and the non‐topic index
        statuspairs = list(enumerate(months.items()))
        for (index, (yyyy_mm, ld)) in statuspairs:
        # Output month‐based listings and the non‐topic index
        statuspairs = list(enumerate(months.items()))
        for (index, (yyyy_mm, ld)) in statuspairs:
@@ -149,7 +156,7 @@ if stdin.read().split()[-1] == f"refs/heads/{LIVE_BRANCH}":
        if not exists(f"{PUBLIC_DIRECTORY}/statuses"):
                mkdir(f"{PUBLIC_DIRECTORY}/statuses")
        with open(f"{PUBLIC_DIRECTORY}/statuses/index.jsonld", "w", encoding="utf-8") as f:
        if not exists(f"{PUBLIC_DIRECTORY}/statuses"):
                mkdir(f"{PUBLIC_DIRECTORY}/statuses")
        with open(f"{PUBLIC_DIRECTORY}/statuses/index.jsonld", "w", encoding="utf-8") as f:
-               json.dump({ "@context": { "@language": LANG, "activity": "https://www.w3.org/ns/activitystreams#", "sioc": "http://rdfs.org/sioc/ns#", "OrderedCollection": "activity:OrderedCollection", "Thread": "sioc:Thread", "current": { "@id": "activity:current", "@type": "@id" }, "first": { "@id": "activity:first", "@type": "@id" } }, "@id": f"{PUBLIC_URL}/statuses", "@type": ["OrderedCollection", "Thread"], "first": f"{PUBLIC_URL}/{statuspairs[0][1][0]}", "current": f"{PUBLIC_URL}/{statuspairs[-1][1][0]}" }, f, ensure_ascii=False, allow_nan=False)
+               json.dump({ "@context": { "@language": LANG, "activity": "https://www.w3.org/ns/activitystreams#", "sioc": "http://rdfs.org/sioc/ns#", "OrderedCollection": "activity:OrderedCollection", "Thread": "sioc:Thread", "current": { "@id": "activity:current", "@type": "@id" }, "first": { "@id": "activity:first", "@type": "@id" }, "has_parent": { "@id": "sioc:has_parent", "@type": "id" } }, "@id": f"{PUBLIC_URL}/statuses", "@type": ["OrderedCollection", "Thread"], "first": f"{PUBLIC_URL}/{statuspairs[0][1][0]}", "current": f"{PUBLIC_URL}/{statuspairs[-1][1][0]}", "has_parent": f"{PUBLIC_URL}" }, f, ensure_ascii=False, allow_nan=False)
 
        # Output topic‐based listings and the topic index
        if not exists(f"{PUBLIC_DIRECTORY}/topics"):
 
        # Output topic‐based listings and the topic index
        if not exists(f"{PUBLIC_DIRECTORY}/topics"):
@@ -160,7 +167,7 @@ if stdin.read().split()[-1] == f"refs/heads/{LIVE_BRANCH}":
                with open(f"{PUBLIC_DIRECTORY}/topics/{topic}/index.jsonld", "w", encoding="utf-8") as f:
                        json.dump(ld, f, ensure_ascii=False, allow_nan=False)
        with open(f"{PUBLIC_DIRECTORY}/topics/index.jsonld", "w", encoding="utf-8") as f:
                with open(f"{PUBLIC_DIRECTORY}/topics/{topic}/index.jsonld", "w", encoding="utf-8") as f:
                        json.dump(ld, f, ensure_ascii=False, allow_nan=False)
        with open(f"{PUBLIC_DIRECTORY}/topics/index.jsonld", "w", encoding="utf-8") as f:
-               json.dump({ "@context": { "@language": LANG, "activity": "https://www.w3.org/ns/activitystreams#", "dct": "http://purl.org/dc/terms/", "sioc": "http://rdfs.org/sioc/ns#", "Collection": "activity:Collection", "Forum": "sioc:Forum", "items": { "@id": "activity:items", "@type": "@id" }, "subject": "dct:subject" }, "@id": f"{PUBLIC_URL}/topics", "@type": ["Collection", "Forum"], "items": list(map(lambda a: { "@id": a["@id"], "subject": a["subject"] }, topics.values())) }, f, ensure_ascii=False, allow_nan=False)
+               json.dump({ "@context": { "@language": LANG, "activity": "https://www.w3.org/ns/activitystreams#", "dct": "http://purl.org/dc/terms/", "sioc": "http://rdfs.org/sioc/ns#", "Collection": "activity:Collection", "Forum": "sioc:Forum", "items": { "@id": "activity:items", "@type": "@id" }, "has_parent": { "@id": "sioc:has_parent", "@type": "id" }, "subject": "dct:subject" }, "@id": f"{PUBLIC_URL}/topics", "@type": ["Collection", "Forum"], "items": list(map(lambda a: { "@id": a["@id"], "subject": a["subject"] }, topics.values())), "has_parent": f"{PUBLIC_URL}" }, f, ensure_ascii=False, allow_nan=False)
 
        # Remove the build directory.
        rmtree(BUILD_DIRECTORY)
 
        # Remove the build directory.
        rmtree(BUILD_DIRECTORY)
This page took 0.033159 seconds and 4 git commands to generate.