Local override for configuration...

Look for a local .yml file and apply it if present.
This commit is contained in:
barnold 2022-10-09 14:22:40 +01:00
parent a7b8116ff7
commit dde8343978
4 changed files with 15 additions and 2 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
local-override.yml

View File

@ -75,6 +75,10 @@ sub startup ($self) {
# Set a "secret" for signing cookies, preventing "Your secret
# passphrase needs to be changed" in the log, using my_app.yml.
my $config = $self->plugin('NotYAMLConfig');
# Apply local overrides, if any.
if (-e $self->home->child('local-override.yml')) {
$config = $self->plugin('NotYAMLConfig', { file => 'local-override.yml' });
}
$self->secrets([ $config->{secrets} ]);
# Add home-made helper(s).

View File

@ -3,3 +3,9 @@ secrets:
- 197b9b0060f3285c0909d83598e54f9ec0602151
default-rows-per-page: 12
maximum-rows-per-page: 100
# Copy these to local-override.yml, uncomment and set to your liking,
# then the about page will invite email.
#email-address: webmaster@example.com?Subject=Awesome site!
#email-name: webmaster@example.com

View File

@ -43,9 +43,11 @@ or "Name like" on the authors page). Other non-authors are
"Anonymous" and "Unknown".
</p>
% if (config->{'email-address'}) {
<p>
Comments and questions welcome
at <a href="mailto:barnold@tilde.club?Subject=Awesome%20project!">barnold@tilde.club</a>.
Comments and questions are welcome at
<a href="mailto:<%= config->{'email-address'} %>"><%= config->{'email-name'} %></a>.
</p>
% }
</div>