updates for events
This commit is contained in:
@@ -8,6 +8,7 @@ import { load_from_dir } from './fs';
|
||||
import { ColorTheme } from '@doc-utils/color-themes';
|
||||
import { ThemeGroups } from './build-files';
|
||||
import { ChangeFreq } from './build-files/sitemap';
|
||||
import { DateTime } from 'luxon';
|
||||
|
||||
export interface Context {
|
||||
env?: Record<string, string>;
|
||||
@@ -16,20 +17,28 @@ export interface Context {
|
||||
page_url: string;
|
||||
site_title: string;
|
||||
author: AuthorConfig | AuthorConfig[];
|
||||
event?: {
|
||||
start: ContextTime;
|
||||
end: ContextTime;
|
||||
zone: `${string}/${string}`;
|
||||
};
|
||||
icons: Record<string, string>;
|
||||
themes: ColorTheme[];
|
||||
theme_groups: ThemeGroups;
|
||||
rss_feeds: RSSConfig[];
|
||||
calendars: CalendarConfig[];
|
||||
build_time: {
|
||||
iso: string;
|
||||
rfc2822: string;
|
||||
};
|
||||
build_time: ContextTime;
|
||||
markdown: {
|
||||
render_inline(): MustacheRenderer;
|
||||
}
|
||||
}
|
||||
|
||||
export interface ContextTime {
|
||||
iso: string;
|
||||
rfc2822: string;
|
||||
html: string;
|
||||
}
|
||||
|
||||
export interface FrontMatter {
|
||||
skip?: boolean;
|
||||
layout?: string;
|
||||
@@ -44,18 +53,19 @@ export interface FrontMatter {
|
||||
}
|
||||
|
||||
interface SitemapFrontmatter {
|
||||
skip?: boolean;
|
||||
change_freq?: ChangeFreq;
|
||||
priority?: number;
|
||||
}
|
||||
|
||||
interface EventFrontmatter {
|
||||
start_time?: string;
|
||||
end_time?: string;
|
||||
time_zone?: `${string}/${string}`;
|
||||
start?: string;
|
||||
end?: string;
|
||||
zone?: `${string}/${string}`;
|
||||
}
|
||||
|
||||
interface RSSFrontmatter {
|
||||
//
|
||||
skip?: boolean;
|
||||
}
|
||||
|
||||
export function render_template(template: string, context: Context, layout?: string, partials: Record<string, string> = { }, tags?: [ string, string ]) {
|
||||
|
Reference in New Issue
Block a user