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": {
                "promo_code": "SUMMER24",
                "text": "Reveal your discount",
                "color": "#e63946"
            }
        }
    ]
}
Field Required Default Description
promo_code yes The code to reveal on click
text no "Reveal Promo Code" Button label before reveal
color no "#4caf50" Button background (any CSS color literal)

Usage in a location pin

Add a promo_code field to the location data and include it in visible_data:

{
    "promo_code": {
        "code": "SUMMER24",
        "text": "Reveal your discount",
        "color": "#e63946"
    }
}

When the plugin is enabled, it automatically detects this field and renders it as an interactive button — no extra markup needed in the location data.

Usage in a Jinja2 template

{{ promocode_button() }}

The button uses the text, color, and promo_code values from the plugin config.

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.2.2.tar.gz (10.1 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.2.2-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: platzky_promocode-0.2.2.tar.gz
  • Upload date:
  • Size: 10.1 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.2.2.tar.gz
Algorithm Hash digest
SHA256 16726aac2f774f5297652f793aeb58088637987643168464739926ed8aa558d8
MD5 7784a83493f20b19d257c0f2f3367f99
BLAKE2b-256 5e0ab9361c71a8e042eb16ef1c8463dfbe0b92a8dc7aac4ab1831a6f9dfe1849

See more details on using hashes here.

Provenance

The following attestation bundles were made for platzky_promocode-0.2.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.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for platzky_promocode-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 729b87d008cddd8d23c2e78d24a11ae7343d0a4f9cb3643db2a08ab452d02af0
MD5 566a889810108f9f102105c34b45474b
BLAKE2b-256 dedb8bd1ea91d536a713db48e526d29e348380bf7db9a406cd1a7ccb185e97bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for platzky_promocode-0.2.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