aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/parser.rb
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2022-11-20 21:42:50 +0900
committernsfisis <nsfisis@gmail.com>2022-11-20 22:20:42 +0900
commit75402b673c0f630b620904ce3153f8645d89d700 (patch)
tree18dc3e091765267fbd59c4f76702a827c69c1eed /lib/parser.rb
parenta0738cdd46d6e52463687b903b1e7d09a541aaa1 (diff)
downloadblog.nsfisis.dev-75402b673c0f630b620904ce3153f8645d89d700.tar.gz
blog.nsfisis.dev-75402b673c0f630b620904ce3153f8645d89d700.tar.zst
blog.nsfisis.dev-75402b673c0f630b620904ce3153f8645d89d700.zip
implement cache busting for stylesheets
Diffstat (limited to 'lib/parser.rb')
-rw-r--r--lib/parser.rb4
1 files changed, 3 insertions, 1 deletions
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