Jesús Pérez d59644b96f
feat: unified auth model, project onboarding, install pipeline, config management
The full scope across this batch: POST /sessions key→token exchange, SessionStore dual-index with revoke_by_id, CLI Bearer injection (ONTOREF_TOKEN), ontoref setup
  --gen-keys, install scripts, daemon config form roundtrip, ADR-004/005, on+re self-description update (fully-self-described), and landing page refresh.
2026-03-13 20:56:31 +00:00

39 lines
988 B
TypeScript

import type { CSSProperties } from 'vue'
/**
* Resolve urls from frontmatter and append with the base url
*/
export function resolveAssetUrl(url: string) {
if (url.startsWith('/'))
return import.meta.env.BASE_URL + url.slice(1)
return url
}
export function handleBackground(background?: string, dim = false): CSSProperties {
const isColor = background && ['#', 'rgb', 'hsl'].some(v => background.indexOf(v) === 0)
const style = {
background: isColor
? background
: undefined,
color: (background && !isColor)
? 'white'
: undefined,
backgroundImage: isColor
? undefined
: background
? dim
? `linear-gradient(#0005, #0008), url(${resolveAssetUrl(background)})`
: `url("${resolveAssetUrl(background)}")`
: undefined,
backgroundRepeat: 'no-repeat',
backgroundPosition: 'center',
backgroundSize: 'cover',
}
if (!style.background)
delete style.background
return style
}