From 75402b673c0f630b620904ce3153f8645d89d700 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 20 Nov 2022 21:42:50 +0900 Subject: implement cache busting for stylesheets --- lib/parser.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/parser.rb') diff --git a/lib/parser.rb b/lib/parser.rb index 8ae3303..e644dc6 100644 --- a/lib/parser.rb +++ b/lib/parser.rb @@ -6,7 +6,7 @@ module NulDoc @template_dir = template_dir end - def parse_file(file_path) + def parse_file(file_path, document_type) Asciidoctor.load_file( file_path, backend: :html5, @@ -15,9 +15,11 @@ module NulDoc safe: :unsafe, template_dirs: [@template_dir], template_engine: 'erb', + template_engine_options: { erb: { trim: '<>' } }, attributes: @common_attributes.merge({ 'source-file-path' => file_path, 'href' => file_path.sub(@content_dir, '').sub('.adoc', '/'), + 'document-type' => document_type, }), extension_registry: Asciidoctor::Extensions.create do tree_processor Nuldoc::Extensions::RevisionHistoryProcessor -- cgit v1.2.3-70-g09d2