Skip to content

Commit 506a048

Browse files
committed
add option IndexHeadInsert for directory
1 parent e273907 commit 506a048

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

spec/defines/vhost_spec.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@
150150
'directoryindex' => 'disabled',
151151
'options' => ['Indexes', 'FollowSymLinks', 'MultiViews'],
152152
'index_options' => ['FancyIndexing'],
153-
'index_style_sheet' => '/styles/style.css' },
153+
'index_style_sheet' => '/styles/style.css',
154+
'index_head_insert' => ['<base target=_blank>'] },
154155
{ 'path' => '/var/www/files/output_filtered',
155156
'set_output_filter' => 'output_filter' },
156157
{ 'path' => '/var/www/files/input_filtered',
@@ -671,6 +672,7 @@
671672
.with_content(%r{^\s+Options\sIndexes\sFollowSymLinks\sMultiViews$})
672673
.with_content(%r{^\s+IndexOptions\sFancyIndexing$})
673674
.with_content(%r{^\s+IndexStyleSheet\s'/styles/style\.css'$})
675+
.with_content(%r{^\s+IndexHeadInsert\s'<base target=_blank>'$})
674676
.with_content(%r{^\s+DirectoryIndex\sdisabled$})
675677
.with_content(%r{^\s+SetOutputFilter\soutput_filter$})
676678
.with_content(%r{^\s+SetInputFilter\sinput_filter$})

templates/vhost/_directories.erb

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
<%- end -%>
4343
<%- if directory['index_style_sheet'] -%>
4444
IndexStyleSheet '<%= directory['index_style_sheet'] %>'
45+
<%- end -%>
46+
<%- if directory['index_head_insert'] -%>
47+
IndexHeadInsert '<%= Array(directory['index_head_insert']).join(' ') %>'
4548
<%- end -%>
4649
<%- if directory['allow_override'] -%>
4750
AllowOverride <%= Array(directory['allow_override']).join(' ') %>

0 commit comments

Comments
 (0)