summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2023-09-09 19:23:38 +0200
committerAlan Pearce2023-09-09 19:23:38 +0200
commitc8d206442c65eaf999445db6c104ee55a07dd931 (patch)
tree753a4e6d1c69753d3bc7b396a80465950ff66ecd
parentb2c15923b33fa65bffe8a5eaef869e6b66d70078 (diff)
parenta961bc284bb130e44468c07aaaa028652c151e08 (diff)
downloadwebsite-c8d206442c65eaf999445db6c104ee55a07dd931.tar.lz
website-c8d206442c65eaf999445db6c104ee55a07dd931.tar.zst
website-c8d206442c65eaf999445db6c104ee55a07dd931.zip
Merge commit 'a961bc284bb130e44468c07aaaa028652c151e08'
-rw-r--r--themes/bear/README.md21
-rw-r--r--themes/bear/config.toml5
-rw-r--r--themes/bear/netlify.toml25
-rw-r--r--themes/bear/screenshot-dark.pngbin319272 -> 0 bytes
-rw-r--r--themes/bear/screenshot.pngbin317002 -> 262700 bytes
-rw-r--r--themes/bear/templates/base.html5
-rw-r--r--themes/bear/templates/security_tags.html2
-rw-r--r--themes/bear/templates/seo_tags.html2
-rw-r--r--themes/bear/templates/style.css1
l---------themes/bear/templates/style.css.html (renamed from themes/bear/templates/style.html)0
-rw-r--r--themes/bear/theme.toml5
11 files changed, 51 insertions, 15 deletions
diff --git a/themes/bear/README.md b/themes/bear/README.md
index 5396a5b..db77233 100644
--- a/themes/bear/README.md
+++ b/themes/bear/README.md
@@ -1,20 +1,18 @@
 # Zola ʕ•ᴥ•ʔ Bear Blog
 
+[![Netlify Status](https://api.netlify.com/api/v1/badges/121b53ce-c913-4604-9179-eb3cca31cd2c/deploy-status)](https://app.netlify.com/sites/zola-bearblog/deploys)
+
 🧸 A [Zola](https://www.getzola.org/)-theme based on [Bear Blog](https://bearblog.dev).
 
 > Free, no-nonsense, super-fast blogging.
 
 ## Demo
 
-For a current & working demo of this theme, please check out https://alanpearce.codeberg.page/zola-bearblog/ 🎯.
-
-## Screenshots
+For a current & working demo of this theme, please check out <https://zola-bearblog.netlify.app/> 🎯.
 
-⬜️ [Light][light-screenshot]
-![light mode screenshot][light-screenshot]
+## Screenshot
 
-⬛️ [Dark][dark-screenshot]
-![dark mode screenshot][dark-screenshot]
+![Screenshot][screenshot]
 
 When the user's browser is running »dark mode«, the dark color scheme will be used automatically. The default is the light/white color scheme. Check out the [`style.html`](https://codeberg.org/alanpearce/zola-bearblog/src/branch/main/templates/style.html)-file for the implementation.
 
@@ -30,6 +28,12 @@ Then, adjust the `config.toml` as detailed below.
 
 For more information, read the official [setup guide][zola-setup-guide] of Zola.
 
+Alternatively, you can quickly deploy a copy of the theme site to Netlify using this button:
+
+[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://gitlab.com/alanpearce/zola-bearblog)
+
+(Note that this method makes it harder to keep up-to-date with theme updates, which might be necessary for newer versions of Zola.)
+
 ## Adjust configuration / config.toml
 
 Please check out the included [config.toml](https://codeberg.org/alanpearce/zola-bearblog/src/branch/main/config.toml)
@@ -76,5 +80,4 @@ A special thank you goes out to [Herman](https://herman.bearblog.dev), for creat
 [MIT License](http://en.wikipedia.org/wiki/MIT_License) © [Alan Pearce](https://www.alanpearce.eu/)
 
 [zola-setup-guide]: https://www.getzola.org/documentation/getting-started/installation/
-[light-screenshot]: https://codeberg.org/alanpearce/zola-bearblog/raw/branch/main/screenshot.png
-[dark-screenshot]: https://codeberg.org/alanpearce/zola-bearblog/raw/branch/main/screenshot-dark.png
+[screenshot]: https://codeberg.org/alanpearce/zola-bearblog/raw/branch/main/screenshot.png
diff --git a/themes/bear/config.toml b/themes/bear/config.toml
index ca8d27a..78e9f9a 100644
--- a/themes/bear/config.toml
+++ b/themes/bear/config.toml
@@ -1,6 +1,6 @@
 title = "Zola ʕ•ᴥ•ʔ Bear Blog"
-base_url = "https://alanpearce.codeberg.page/zola-bearblog"
-description = ""
+base_url = "https://zola-bearblog.netlify.app/"
+description = "A Zola-theme based on Bear Blog."
 
 # Whether to automatically compile all Sass files in the sass directory
 compile_sass = false
@@ -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/themes/bear/netlify.toml b/themes/bear/netlify.toml
new file mode 100644
index 0000000..6be8468
--- /dev/null
+++ b/themes/bear/netlify.toml
@@ -0,0 +1,25 @@
+[build]
+publish = "public"
+command = "zola build"
+
+[build.environment]
+# Set the version name that you want to use and Netlify will automatically use it.
+ZOLA_VERSION = "0.17.2"
+
+# The magic for deploying previews of branches.
+# We need to override the base url with whatever url Netlify assigns to our
+# preview site.  We do this using the Netlify environment variable
+# `$DEPLOY_PRIME_URL`.
+
+[context.deploy-preview]
+command = "zola build --base-url $DEPLOY_PRIME_URL"
+
+[[headers]]
+  for = "/*"
+  [headers.values]
+    X-Frame-Options = "DENY"
+    X-Content-Type-Options = "nosniff"
+    X-XSS-Protection = "1; mode=block"
+    Referrer-Policy = "strict-origin-when-cross-origin"
+    Strict-Transport-Security = "max-age=63072000; includeSubdomains"
+    Content-Security-Policy = "default-src 'none'; img-src 'self'; object-src 'none'; script-src 'none'; style-src 'sha256-2Sbht7dvdhJX00j84akXy9AejYUf6sOM3OpwMxNiDXQ='; form-action 'none'; base-uri 'self'; frame-ancestors 'none'"
diff --git a/themes/bear/screenshot-dark.png b/themes/bear/screenshot-dark.png
deleted file mode 100644
index 266f883..0000000
--- a/themes/bear/screenshot-dark.png
+++ /dev/null
Binary files differdiff --git a/themes/bear/screenshot.png b/themes/bear/screenshot.png
index 4013a5c..273266a 100644
--- a/themes/bear/screenshot.png
+++ b/themes/bear/screenshot.png
Binary files differdiff --git a/themes/bear/templates/base.html b/themes/bear/templates/base.html
index e3e68b4..3a2d565 100644
--- a/themes/bear/templates/base.html
+++ b/themes/bear/templates/base.html
@@ -1,6 +1,9 @@
 <!DOCTYPE html>
 <html lang="{{ lang | default(value="en-US" ) }}">
 <head>
+  {%- 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">
   <link rel="shortcut icon" href="{{ config.extra.favicon | default(value="data:,") }}">
@@ -12,7 +15,7 @@
   {%- endblock -%}
   {%- endif %}
   <style>
-  {% include "style.html" ignore missing -%}
+  {%- include "style.css.html" ignore missing -%}
   </style>
   {% include "custom_head.html" ignore missing -%}
 </head>
diff --git a/themes/bear/templates/security_tags.html b/themes/bear/templates/security_tags.html
new file mode 100644
index 0000000..0f922ea
--- /dev/null
+++ b/themes/bear/templates/security_tags.html
@@ -0,0 +1,2 @@
+<!-- These tags are here for demostration. It's recommended to send them via HTTP headers instead. -->
+<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self'; object-src 'none'; script-src 'none'; style-src 'unsafe-inline'">
diff --git a/themes/bear/templates/seo_tags.html b/themes/bear/templates/seo_tags.html
new file mode 100644
index 0000000..4eb2bc8
--- /dev/null
+++ b/themes/bear/templates/seo_tags.html
@@ -0,0 +1,2 @@
+<meta name="title" content="{% if page.title %}{{ page.title }}{% else %}{{ config.title }}{% endif %}">
+<meta name="description" content="{{ config.description }}" />
diff --git a/themes/bear/templates/style.css b/themes/bear/templates/style.css
index 49b3680..e1e12aa 100644
--- a/themes/bear/templates/style.css
+++ b/themes/bear/templates/style.css
@@ -1,4 +1,3 @@
-/* -*- mode: css; -*- */
 body {
   font-family: Verdana, sans-serif;
   margin: auto;
diff --git a/themes/bear/templates/style.html b/themes/bear/templates/style.css.html
index f6b71cc..f6b71cc 120000
--- a/themes/bear/templates/style.html
+++ b/themes/bear/templates/style.css.html
diff --git a/themes/bear/theme.toml b/themes/bear/theme.toml
index ed137c8..902c8ec 100644
--- a/themes/bear/theme.toml
+++ b/themes/bear/theme.toml
@@ -1,11 +1,11 @@
 name = "Bear"
 description = "Bear blog theme"
 license = "MIT"
-homepage = "https://codeberg.org/alanpearce/zola/bearblog"
+homepage = "https://codeberg.org/alanpearce/zola-bearblog"
 # The minimum version of Zola required
 min_version = "0.4.0"
 # An optional live demo URL
-demo = "https://alanpearce.codeberg.page/zola-bearblog"
+demo = "https://zola-bearblog.netlify.app/"
 
 # Any variable there can be overridden in the end user `config.toml`
 # You don't need to prefix variables by the theme name but as this will
@@ -13,6 +13,7 @@ demo = "https://alanpearce.codeberg.page/zola-bearblog"
 # 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"