updates for events

This commit is contained in:
2023-05-21 14:35:55 -07:00
parent 17a406e546
commit 2dd300f4dc
8 changed files with 81 additions and 66 deletions

View File

@@ -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 ]) {