support for rss/calendar

This commit is contained in:
2023-05-20 19:08:43 -07:00
parent 5689c64c4e
commit e5f7af48cb
14 changed files with 782 additions and 90 deletions

View File

@@ -2,7 +2,7 @@
import { glob } from 'glob';
import { read_text } from '../fs';
import { BuildState } from './state';
import { build_partials, file_hash_matches, map_input_file_to_output_file, map_output_file_to_url, render_page, skip_file, update_metadata } from './helpers';
import { build_partials, copy_metadata, file_hash_matches, map_input_file_to_output_file, map_output_file_to_url, render_page, skip_file, update_metadata } from './helpers';
export async function render_text_file_templates(state: BuildState) {
const promises: Promise<any>[] = [ ];
@@ -39,10 +39,11 @@ export async function render_text_file_template(state: BuildState, in_file: stri
return;
}
await render_page(state, in_file, out_file, out_url, text, false, frontmatter);
if (file_hash_matches(state, in_file, hash)) {
return skip_file(state, in_file, out_file, out_url, frontmatter);
return copy_metadata(state, in_file);
}
await render_page(state, out_file, out_url, text, false, frontmatter);
update_metadata(state, in_file, hash);
}