about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2023-09-09 19:10:40 +0200
committerAlan Pearce2023-09-09 19:10:40 +0200
commitf51202d961e6d2337a96ef3552c4efced1fe2beb (patch)
treec51891d5f1d6c54208ac0ff3afc32c047638b16d
parent093ac10f7e5c9bd40e9def573c654069e4cba1a9 (diff)
downloadzola-bearblog-f51202d961e6d2337a96ef3552c4efced1fe2beb.tar.lz
zola-bearblog-f51202d961e6d2337a96ef3552c4efced1fe2beb.tar.zst
zola-bearblog-f51202d961e6d2337a96ef3552c4efced1fe2beb.zip
Allow end-user to disable CSP header meta tags without editing theme
-rw-r--r--config.toml1
-rw-r--r--templates/base.html8
-rw-r--r--theme.toml1
3 files changed, 8 insertions, 2 deletions
diff --git a/config.toml b/config.toml
index d2a8833..78e9f9a 100644
--- a/config.toml
+++ b/config.toml
@@ -20,6 +20,7 @@ highlight_code = true
 
 [extra]
 date_format="%d %b, %Y"
+webserver_sends_csp_headers=true
 
 [[extra.main_menu]]
 name = "Bear"
diff --git a/templates/base.html b/templates/base.html
index 02fdfe6..ee206b3 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -1,7 +1,9 @@
 <!DOCTYPE html>
 <html lang="{{ lang | default(value="en-US" ) }}">
 <head>
-  {% include "security_tags.html" ignore missing %}
+  {%- if config.webserver_sends_csp_headers %}
+  {%- include "security_tags.html" ignore missing %}
+  {%- endif %}
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   {% include "favicon.html" ignore missing -%}
@@ -13,7 +15,9 @@
   <link rel="alternate" type={% if config.feed_filename == "atom.xml" %}"application/atom+xml"{% else %}"application/rss+xml"{% endif %} title="{{ config.title }}" href="{{ get_url(path=config.feed_filename) | safe }}">
   {%- endblock -%}
   {%- endif %}
-  {% include "style.html" ignore missing -%}
+  <style>
+  {%- include "style.css.html" ignore missing -%}
+  </style>
   {% include "custom_head.html" ignore missing -%}
 </head>
 <body>
diff --git a/theme.toml b/theme.toml
index 1bba50d..902c8ec 100644
--- a/theme.toml
+++ b/theme.toml
@@ -13,6 +13,7 @@ demo = "https://zola-bearblog.netlify.app/"
 # Use snake_casing to be consistent with the rest of Zola
 [extra]
 date_format="%d %b, %Y"
+webserver_sends_csp_headers=false
 
 [author]
 name = "Alan Pearce"