Pin the hyperzine manifest to W6EqQbl9

The mystic reference has not yet been indexed with the manifest that
includes arweave-for-ao, so load that manifest directly. Blank
MANIFEST_TX_ID to return to reference resolution.
This commit is contained in:
fn
2026-09-03 17:19:16 +01:00
parent 3618d0aa2d
commit 3e92530c47
3 changed files with 10 additions and 3 deletions

View File

@@ -12,7 +12,8 @@ const DEFAULTS = {
BLOG_SITE_URL: "https://hyperzine.xyz", BLOG_SITE_URL: "https://hyperzine.xyz",
BLOG_DEFAULT_DESCRIPTION: "hyperzine", BLOG_DEFAULT_DESCRIPTION: "hyperzine",
ARWEAVE_GATEWAY: "https://arweave.net", ARWEAVE_GATEWAY: "https://arweave.net",
MANIFEST_REFERENCE_NAME: "" MANIFEST_REFERENCE_NAME: "",
MANIFEST_TX_ID: ""
}; };
const asObject = (value) => (typeof value === "object" && value !== null ? value : null); const asObject = (value) => (typeof value === "object" && value !== null ? value : null);
@@ -53,7 +54,8 @@ const parseConfig = async () => {
BLOG_SITE_URL: pick("BLOG_SITE_URL"), BLOG_SITE_URL: pick("BLOG_SITE_URL"),
BLOG_DEFAULT_DESCRIPTION: pick("BLOG_DEFAULT_DESCRIPTION"), BLOG_DEFAULT_DESCRIPTION: pick("BLOG_DEFAULT_DESCRIPTION"),
ARWEAVE_GATEWAY: pick("ARWEAVE_GATEWAY"), ARWEAVE_GATEWAY: pick("ARWEAVE_GATEWAY"),
MANIFEST_REFERENCE_NAME: pick("MANIFEST_REFERENCE_NAME") MANIFEST_REFERENCE_NAME: pick("MANIFEST_REFERENCE_NAME"),
MANIFEST_TX_ID: pick("MANIFEST_TX_ID")
}; };
}; };
@@ -130,6 +132,7 @@ const fetchManifestPosts = async (config, manifestTxId) => {
}; };
const resolveManifestTxId = async (config) => { const resolveManifestTxId = async (config) => {
if (config.MANIFEST_TX_ID) return config.MANIFEST_TX_ID;
if (!config.MANIFEST_REFERENCE_NAME) return ""; if (!config.MANIFEST_REFERENCE_NAME) return "";
const names = new ReferenceClient({ gateway: config.ARWEAVE_GATEWAY || DEFAULTS.ARWEAVE_GATEWAY }); const names = new ReferenceClient({ gateway: config.ARWEAVE_GATEWAY || DEFAULTS.ARWEAVE_GATEWAY });
const value = await names.resolveName(config.MANIFEST_REFERENCE_NAME); const value = await names.resolveName(config.MANIFEST_REFERENCE_NAME);

View File

@@ -5,6 +5,9 @@ export const BLOG_DEFAULT_DESCRIPTION =
"A blog about cyberspace decentralization"; "A blog about cyberspace decentralization";
export const BLOG_TWITTER_HANDLE = ""; export const BLOG_TWITTER_HANDLE = "";
export const MANIFEST_REFERENCE_NAME = "mystic"; export const MANIFEST_REFERENCE_NAME = "mystic";
// Pinned manifest. When set, the site loads this manifest instead of
// resolving the reference. Blank it to go back to reference resolution.
export const MANIFEST_TX_ID = "W6EqQbl9kdM7nqiqhCclZnZEQJs0Rr7sDz-N2ou4TLM";
export const ARWEAVE_GATEWAY = "https://arweave.net"; export const ARWEAVE_GATEWAY = "https://arweave.net";
export const AO_URL = "https://push-1.forward.computer"; export const AO_URL = "https://push-1.forward.computer";

View File

@@ -2,7 +2,7 @@ import DOMPurify from "dompurify";
import { marked, type Tokens } from "marked"; import { marked, type Tokens } from "marked";
import { parse as parseYaml } from "yaml"; import { parse as parseYaml } from "yaml";
import { ReferenceClient } from "@permaweb/references"; import { ReferenceClient } from "@permaweb/references";
import { ARWEAVE_GATEWAY, MANIFEST_REFERENCE_NAME } from "./config"; import { ARWEAVE_GATEWAY, MANIFEST_REFERENCE_NAME, MANIFEST_TX_ID } from "./config";
import { parseManifest, type Frontmatter, type ManifestPost } from "./types"; import { parseManifest, type Frontmatter, type ManifestPost } from "./types";
const formatDate = (date: string): string => const formatDate = (date: string): string =>
@@ -111,6 +111,7 @@ const loadReferenceManifest = async () => {
}; };
const loadCurrentManifest = async () => { const loadCurrentManifest = async () => {
if (MANIFEST_TX_ID) return fetchManifest(MANIFEST_TX_ID);
return loadReferenceManifest(); return loadReferenceManifest();
}; };