Skip to main content

platzky-promocode

A platzky plugin that adds a click-to-reveal promo code button.

The promo code is never present as plain text in the page — it is base64-encoded and decoded client-side only on click.

Installation

pip install platzky_promocode

Configuration

Plugins are configured in platzky's database, under a top-level plugins object keyed by plugin name (for the JSON database that is inside DB.DATA; the GraphQL and MongoDB backends store the same structure):

{
    "plugins": {
        "promocode": {
            "is_active": true,
            "allowed_content_types": ["post", "page", "field"],
            "config": {
                "text": "Reveal your discount",
                "color": "#e63946"
            }
        }
    }
}

The key (promocode) must match the plugin's entry-point name.

Field Required Default Description
is_active yes false The plugin is skipped entirely unless this is true
allowed_content_types yes [] Content types the plugin may transform — any of post, page, comment, field. Empty means the plugin loads but transforms nothing
config no {} Plugin settings, see below

allowed_content_types is enforced by the engine and intersected with the content types the plugin supports (post, page, field), so it can only narrow them, never widen them.

Plugin settings (config)

Field Required Default Description
text no "Reveal Promo Code" Button label before reveal — a plain string, or a {locale: label} map for per-language labels
color no "#4caf50" Button background (any CSS color literal)

Translated button labels

text can be a map of locale codes to labels instead of a single string. The label matching the visitor's active locale is used, falling back to the first entry in the map when there is no match:

{
    "plugins": {
        "promocode": {
            "is_active": true,
            "allowed_content_types": ["post", "page", "field"],
            "config": {
                "text": {
                    "en": "Reveal Promo Code",
                    "pl": "Pokaż kod promocyjny",
                    "uk": "Показати промокод"
                }
            }
        }
    }
}

Usage in blog content

Embed the promo code directly in post content using the shortcode:

Get 20% off with code [promocode]SUMMER24[/promocode] — don't miss out!

An optional color attribute overrides the configured button colour:

Grab your [promocode color="#e91e63"]SAVE20[/promocode] before it expires!

Release files for platzky-promocode 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for platzky-promocode 0.4.0
File Size Uploaded
platzky_promocode-0.4.0.tar.gz 12.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for platzky-promocode 0.4.0
File Interpreter ABI Platform
platzky_promocode-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 30.3 kB

Release files / platzky_promocode-0.4.0.tar.gz

Download URL platzky_promocode-0.4.0.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4ab35a66c3e43daaad2fc99d09099b84bc66b945a49ac1616fde7fe76a7dfc79
BLAKE2b-256 checksum
How to use checksums
0ae96b131feea439bd8503520120aee1cd33b69a2120391df9629dd00b996eda
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 Aug 25, 2026.

Transparency log

Release files / platzky_promocode-0.4.0-py3-none-any.whl

Download URL platzky_promocode-0.4.0-py3-none-any.whl
Size 17.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8721a76fe7daaab5460ec65d2e2ac786d32009b3412bc2abc4da78feeceaff09
BLAKE2b-256 checksum
How to use checksums
eaa33289c70b1b56714c976a6b85705e1a6b65a42dc2fdf55a546a1922f38d3b
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 Aug 25, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.2

2 release files

0.5.1

2 release files

This release

0.4.0 This release

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page