···11-import { RichText } from "npm:@atproto/api";
22-import * as ammonia from "https://deno.land/x/ammonia@0.3.1/mod.ts";
33-import { agent } from "./main.js";
44-55-await ammonia.init();
66-77-export function getFacets(text) {
88- const rt = new RichText({ text: text });
99- rt.detectFacetsWithoutResolution(agent);
1010-1111- let res = "";
1212- for (const segment of rt.segments()) {
1313- if (segment.isLink()) res += `<a href="${segment.link.uri}">${segment.text}</a>`;
1414- else if (segment.isMention()) res += `<a href="/profile/${segment.mention.did}/">${segment.text}</a>`;
1515- else if (segment.isTag()) res += `<a href="https://bsky.app/hashtag/${segment.tag.tag}">${segment.text}</a>`;
1616- else res += segment.text;
1717- }
1818-1919- res = ammonia.clean(res);
2020- res = res.replaceAll("\n", "<br>");
2121-2222- return res;
2323-}
+26
fly.toml
···11+# fly.toml app configuration file generated for htmlsky on 2024-06-08T16:01:00Z
22+#
33+# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
44+#
55+66+app = 'htmlsky'
77+primary_region = 'iad'
88+99+[build]
1010+ [build.args]
1111+ GO_VERSION = '1.22.1'
1212+1313+[env]
1414+ PORT = '8080'
1515+1616+[http_service]
1717+ internal_port = 8080
1818+ auto_stop_machines = true
1919+ auto_start_machines = true
2020+ min_machines_running = 0
2121+ processes = ['app']
2222+2323+[[vm]]
2424+ memory = '256mb'
2525+ cpu_kind = 'shared'
2626+ cpus = 1