Msgbar Plugin
Overview
The msgbar plugin displays a message bar above the whole page with support for Markdown formatting and built-in XSS protection.
Installation
pip install platzky-msgbar
Usage
"plugins": [
{
"name": "msgbar",
"config": {
"message": "Your custom message goes here"
}
}
]
Markdown Support
The message field supports Markdown formatting including links:
{
"message": "Visit [our website](https://example.com) for more info!"
}
You can also use link attributes:
{
"message": "[Click here](https://example.com){:target=\"_blank\" rel=\"noopener\"}"
}
The message field is required. If you don't provide it, the plugin configuration will fail validation.
Configuration Options
All styling fields are optional. If not provided, the plugin will use fallback values from your Platzky theme configuration or built-in defaults.
Optional Styling Fields
-
background_color(string): CSS color value for the bar background- Falls back to Platzky's
primary_colorfrom database - Default:
#245466 - Accepts: hex (#RGB, #RRGGBB), rgb/rgba, hsl/hsla, named colors
- Falls back to Platzky's
-
text_color(string): CSS color value for the text- Falls back to Platzky's
secondary_colorfrom database - Default:
white - Accepts: hex, rgb/rgba, hsl/hsla, named colors
- Falls back to Platzky's
-
font_family(string): CSS font-family value- Falls back to Platzky's
fontfrom database - Default:
'Arial', sans-serif - Max length: 200 characters
- Falls back to Platzky's
-
font_size(string): CSS font-size value- Default:
14px - Accepts: number + unit (px, em, rem, %, vh, vw)
- Default:
-
bar_height(string): Height of the message bar- Default:
30px - Accepts: number + unit (px, em, rem, %, vh, vw)
- Default:
Complete Configuration Example
"plugins": [
{
"name": "msgbar",
"config": {
"message": "Visit [our website](https://example.com) for more info!",
"background_color": "#ff5733",
"text_color": "#ffffff",
"font_family": "'Courier New', monospace",
"font_size": "16px",
"bar_height": "40px"
}
}
]
Platzky Theme Integration
If your Platzky configuration includes theme settings in site_content, the plugin will automatically use them:
{
"site_content": {
"primary_color": "#123456",
"secondary_color": "#abcdef",
"font": "Roboto"
}
}
This allows the message bar to match your site's overall theme without additional configuration.
Security
The plugin implements comprehensive security measures to protect against injection attacks:
XSS Protection
- Only safe HTML tags are allowed:
a,strong,em,b,i,code,br,span - Dangerous content like
<script>tags,javascript:URLs, and event handlers are stripped - Links are restricted to safe protocols:
http,https,mailto
CSS Injection Protection
- All CSS configuration values (colors, sizes, fonts) are validated using Pydantic
- Colors must be valid hex, rgb/rgba, hsl/hsla, or named colors
- Sizes must follow the pattern:
number + unit(px, em, rem, %, vh, vw) - Font families cannot contain dangerous characters or CSS functions like
url() - Invalid values are automatically rejected and replaced with safe defaults
All security protections are always active and cannot be disabled.
Release files for platzky-msgbar 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| platzky_msgbar-2.0.0.tar.gz | 6.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| platzky_msgbar-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.8 kB
Release files / platzky_msgbar-2.0.0.tar.gz
| Download URL | platzky_msgbar-2.0.0.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
434a1068b166f5aa5ecc34ed6dbb288a96ee90edd234eec0317419c34a43cd60
|
|
BLAKE2b-256 checksum How to use checksums |
4873da1ecbfbce057d5668fae7085a7cb9e4a0e664a7215885a43446a570285b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 7, 2026.
Transparency logRelease files / platzky_msgbar-2.0.0-py3-none-any.whl
| Download URL | platzky_msgbar-2.0.0-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87f1de6403dbf5391861cef98718aa71832ce59d06b9a2034fbcb68a23bb2c44
|
|
BLAKE2b-256 checksum How to use checksums |
e135b077f19c7af466e13b1517a76b6e54f40144c1011d7dd1c3a0751df31ed2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 7, 2026.
Transparency log