Skip to main content

Plugin for revealing promo codes.

Project description

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

Register the plugin in your platzky config:

{
    "plugins": [
        {
            "name": "promocode",
            "config": {
                "text": "Reveal your discount",
                "color": "#e63946"
            }
        }
    ]
}
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": [
        {
            "name": "promocode",
            "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!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

platzky_promocode-0.3.2.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

platzky_promocode-0.3.2-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file platzky_promocode-0.3.2.tar.gz.

File metadata

  • Download URL: platzky_promocode-0.3.2.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for platzky_promocode-0.3.2.tar.gz
Algorithm Hash digest
SHA256 9711c4e632d3ee44f7e900af59bd0e9bc0e5c19bb752351bf4662ead7da13aca
MD5 8de4b9e5ef46748b8d67744d36d626b2
BLAKE2b-256 844406ea7dbfb2815201c9f6a3b16d2a39d991be75644fb62ed3e4a9f343cba0

See more details on using hashes here.

Provenance

The following attestation bundles were made for platzky_promocode-0.3.2.tar.gz:

Publisher: release.yml on platzky/platzky-promocode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file platzky_promocode-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for platzky_promocode-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f91ebbf9f0071da0a26de03d298eaa76ccfc86a6f1e6cc5ceb8d4a840b32c7d8
MD5 fafd215730e21e19ac2193215836dcf9
BLAKE2b-256 6dce1e951b54685ca7f381281ab20598f2057265f0c6671920aa30556ca85ddf

See more details on using hashes here.

Provenance

The following attestation bundles were made for platzky_promocode-0.3.2-py3-none-any.whl:

Publisher: release.yml on platzky/platzky-promocode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page