Add OUTLINE_* env vars to K8s spec and fix markmark blog impl to use FQ urls

This commit is contained in:
Garrett Mills 2025-01-07 23:46:46 -05:00
parent 611b73c3c3
commit 005668b46f
2 changed files with 20 additions and 2 deletions

View File

@ -110,3 +110,21 @@ spec:
name: garrettmills-dev-secrets name: garrettmills-dev-secrets
key: COREID_BASE key: COREID_BASE
optional: false optional: false
- name: OUTLINE_API_URL
valueFrom:
secretKeyRef:
name: garrettmills-dev-secrets
key: OUTLINE_API_URL
optional: false
- name: OUTLINE_API_KEY
valueFrom:
secretKeyRef:
name: garrettmills-dev-secrets
key: OUTLINE_API_KEY
optional: false
- name: OUTLINE_MM_DOCUMENT_ID
valueFrom:
secretKeyRef:
name: garrettmills-dev-secrets
key: OUTLINE_MM_DOCUMENT_ID
optional: false

View File

@ -2,7 +2,6 @@ import * as RSSFeed from 'feed'
import {Awaitable, collect, Collection, Inject, Maybe, Singleton} from '@extollo/lib' import {Awaitable, collect, Collection, Inject, Maybe, Singleton} from '@extollo/lib'
import {AbstractBlog, BlogBackend, BlogPost, BlogPostFrontMatter, isBlogPostFrontMatter} from './AbstractBlog.service' import {AbstractBlog, BlogBackend, BlogPost, BlogPostFrontMatter, isBlogPostFrontMatter} from './AbstractBlog.service'
import {MarkMarkService} from '../MarkMark.service' import {MarkMarkService} from '../MarkMark.service'
import {Link} from '../../../markmark/types'
import {MarkMarkRenderer} from '../../../markmark/markmark.renderer' import {MarkMarkRenderer} from '../../../markmark/markmark.renderer'
@Singleton() @Singleton()
@ -83,8 +82,9 @@ export class MarkMarkBlog extends AbstractBlog<BlogPostFrontMatter> {
} }
getUrl(post: BlogPost): string { getUrl(post: BlogPost): string {
const appUrl = this.routing.getAppUrl().toRemote
let prefix = this.getBackend().routePrefix let prefix = this.getBackend().routePrefix
if ( !prefix.startsWith('/') ) prefix = `/${prefix}` if ( !prefix.startsWith('/') ) prefix = `/${prefix}`
return `${prefix}/#link-${post.slug}` return `${appUrl}${prefix}/#link-${post.slug}`
} }
} }