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