Skip to content

Commit

Permalink
add option IndexHeadInsert for directory
Browse files Browse the repository at this point in the history
  • Loading branch information
trefzer committed Apr 20, 2024
1 parent c26ca5d commit d906070
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec/defines/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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' => ['<base target=_blank>'] },
{ 'path' => '/var/www/files/output_filtered',
'set_output_filter' => 'output_filter' },
{ 'path' => '/var/www/files/input_filtered',
Expand Down Expand Up @@ -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'<base target=_blank>'$})
.with_content(%r{^\s+DirectoryIndex\sdisabled$})
.with_content(%r{^\s+SetOutputFilter\soutput_filter$})
.with_content(%r{^\s+SetInputFilter\sinput_filter$})
Expand Down
3 changes: 3 additions & 0 deletions templates/vhost/_directories.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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(' ') %>
Expand Down

0 comments on commit d906070

Please sign in to comment.