From d9060704c03149357a2e423ae81e72bfc4d6771d Mon Sep 17 00:00:00 2001 From: Benedikt Trefzer Date: Sat, 20 Apr 2024 17:33:32 +0200 Subject: [PATCH] add option IndexHeadInsert for directory --- spec/defines/vhost_spec.rb | 4 +++- templates/vhost/_directories.erb | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/defines/vhost_spec.rb b/spec/defines/vhost_spec.rb index f86569262d..34a525af17 100644 --- a/spec/defines/vhost_spec.rb +++ b/spec/defines/vhost_spec.rb @@ -149,7 +149,8 @@ 'directoryindex' => 'disabled', 'options' => ['Indexes', 'FollowSymLinks', 'MultiViews'], 'index_options' => ['FancyIndexing'], - 'index_style_sheet' => '/styles/style.css' }, + 'index_style_sheet' => '/styles/style.css', + 'index_head_insert' => [''] }, { 'path' => '/var/www/files/output_filtered', 'set_output_filter' => 'output_filter' }, { 'path' => '/var/www/files/input_filtered', @@ -648,6 +649,7 @@ .with_content(%r{^\s+Options\sIndexes\sFollowSymLinks\sMultiViews$}) .with_content(%r{^\s+IndexOptions\sFancyIndexing$}) .with_content(%r{^\s+IndexStyleSheet\s'/styles/style\.css'$}) + .with_content(%r{^\s+IndexHeadInsert\s''$}) .with_content(%r{^\s+DirectoryIndex\sdisabled$}) .with_content(%r{^\s+SetOutputFilter\soutput_filter$}) .with_content(%r{^\s+SetInputFilter\sinput_filter$}) diff --git a/templates/vhost/_directories.erb b/templates/vhost/_directories.erb index ba072523fc..5ddd54cc2a 100644 --- a/templates/vhost/_directories.erb +++ b/templates/vhost/_directories.erb @@ -39,6 +39,9 @@ <%- end -%> <%- if directory['index_style_sheet'] -%> IndexStyleSheet '<%= directory['index_style_sheet'] %>' + <%- end -%> + <%- if directory['index_head_insert'] -%> + IndexHeadInsert '<%= Array(directory['index_head_insert']).join(' ') %>' <%- end -%> <%- if directory['allow_override'] -%> AllowOverride <%= Array(directory['allow_override']).join(' ') %>