Use absolute URLs in Atom feed
This commit is contained in:
parent
74f7b89c15
commit
ffd709d2f9
@ -1,3 +1,5 @@
|
||||
PORT=8000
|
||||
BASE_URL=http://localhost:8000
|
||||
HOME_RELAY_URL=wss://nostr.kosmos.org
|
||||
LDAP_URL=ldap://10.1.1.116:389
|
||||
LDAP_BIND_DN=uid=service,ou=kosmos.org,cn=applications,dc=kosmos,dc=org
|
||||
|
@ -5,6 +5,7 @@ await load({ envPath: `${dirname}/.env`, export: true });
|
||||
|
||||
const config = {
|
||||
port: Deno.env.get("PORT") || 8000,
|
||||
base_url: Deno.env.get("BASE_URL") || `http://localhost:8000`,
|
||||
home_relay_url: Deno.env.get("HOME_RELAY_URL") || "",
|
||||
ldap: {
|
||||
url: Deno.env.get("LDAP_URL"),
|
||||
|
2
feeds.ts
2
feeds.ts
@ -14,7 +14,7 @@ export function profileAtomFeed(profile: Profile, articles: Article[]) {
|
||||
<entry>
|
||||
<id>${articleId}</id>
|
||||
<title>${article.title}</title>
|
||||
<link href="/${article.naddr}" />
|
||||
<link href="${article.url}" />
|
||||
<updated>${isoDate(article.updatedAt)}</updated>
|
||||
<summary>${article.summary}</summary>
|
||||
<content type="html">${article.html}</content>
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { render as renderMarkdown } from "@deno/gfm";
|
||||
import { nip19 } from "@nostr/tools";
|
||||
import { NEvent } from "../nostr.ts";
|
||||
import { render as renderMarkdown } from "@deno/gfm";
|
||||
import config from "../config.ts";
|
||||
|
||||
export default class Article {
|
||||
event: NEvent;
|
||||
@ -14,6 +15,10 @@ export default class Article {
|
||||
return tag ? tag[1] : "";
|
||||
}
|
||||
|
||||
get url(): string {
|
||||
return `${config.base_url}/${this.naddr}`
|
||||
}
|
||||
|
||||
get title(): string {
|
||||
const tag = this.event.tags.find((t) => t[0] === "title");
|
||||
return tag ? tag[1] : "Untitled";
|
||||
|
Loading…
x
Reference in New Issue
Block a user