Skip to main content

MkDocs plugin that converts shorthand placeholders to full Uptime Kuma badge links

Project description

MkDocs Kuma Uptime Badge Plugin

A tiny MkDocs plugin that converts shorthand placeholders to full Uptime Kuma badge links during the build.

Installation

Using pip:

pip install mkdocs-kuma-uptime-badge

Using Poetry:

poetry add mkdocs-kuma-uptime-badge

For development:

# Clone the repository
git clone https://github.com/culturepulse/mkdocs-kuma-uptime-badge.git
cd mkdocs-kuma-uptime-badge

# Install with Poetry (recommended)
poetry install

# Or with pip
pip install -e .

Usage

  1. Add the plugin to your mkdocs.yml:
plugins:
  - search
  - kuma-uptime-badge:
      base_url: https://your-kuma-instance.example.com
  1. In your Markdown files, use the shorthand syntax:
{{uptime id=1}}  # Basic status badge

{{uptime id=2 type=uptime hours=24}}  # Uptime badge for the last 24 hours

{{uptime id=3 type=ping hours=720 label="30" labelSuffix="d"}}  # Ping badge with custom label

These will be converted to full Markdown image links during the build:

![status](https://your-kuma-instance.example.com/api/badge/1/status)

![uptime](https://your-kuma-instance.example.com/api/badge/2/uptime/24)

![ping](https://your-kuma-instance.example.com/api/badge/3/ping/720?label=30&labelSuffix=d)

Syntax

The general syntax for the shorthand is:

{{uptime id=<monitorID> [type=<badgeType>] [hours=<int>] [key=value ...]}}

Where:

  • id (required): The monitor ID from Uptime Kuma
  • type (optional): The badge type, one of:
    • status (default)
    • uptime
    • ping
    • avg-response
    • cert-exp
    • response
  • hours (optional): Duration in hours, only used for uptime, ping, avg-response, and response badge types
  • Additional key-value pairs: Any other parameters will be added as query string parameters to the badge URL

Examples

Status Badge

{{uptime id=1}}
{{uptime id=1 type=status}}
{{uptime id=1 upLabel="Online" downLabel="Offline"}}
{{uptime id=1 upColor="green" downColor="red"}}

Uptime Badge

{{uptime id=1 type=uptime hours=24}}
{{uptime id=1 type=uptime hours=720 label="30" labelSuffix="d"}}
{{uptime id=1 type=uptime hours=24 color="blue"}}

Ping Badge

{{uptime id=1 type=ping hours=24}}
{{uptime id=1 type=ping hours=24 labelPrefix="Average" label="Ping" labelSuffix=""}}

Certificate Expiry Badge

{{uptime id=1 type=cert-exp}}
{{uptime id=1 type=cert-exp warnDays=14 downDays=7}}

Badge Styles

{{uptime id=1 style=flat}}  # Default
{{uptime id=1 style=flat-square}}
{{uptime id=1 style=plastic}}
{{uptime id=1 style=for-the-badge}}
{{uptime id=1 style=social}}

Configuration

The plugin supports the following configuration options:

  • base_url: The base URL of your Uptime Kuma instance (default: https://kuma.intra)

Made with ❤️ and ☕️ by CulturePulse development team

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

mkdocs_kuma_uptime_badge-0.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

mkdocs_kuma_uptime_badge-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_kuma_uptime_badge-0.1.0.tar.gz.

File metadata

  • Download URL: mkdocs_kuma_uptime_badge-0.1.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mkdocs_kuma_uptime_badge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c37245015923b2c105c1c2dacaec800cc86c1b78dddf2192cbb5a9591f52e3f4
MD5 e827c42eff38e9dba9b5a9e229e47fea
BLAKE2b-256 81722e5e93846549022cac2266c4cb026fb9999b61f07fc50e200b28b9521d60

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_kuma_uptime_badge-0.1.0.tar.gz:

Publisher: publish.yml on culturepulse/mkdocs-kuma-uptime-badge

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

File details

Details for the file mkdocs_kuma_uptime_badge-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_kuma_uptime_badge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92d289fd98123b300b57fba75e4939665c9f731c891b6bd386005ea0428c80bb
MD5 220cd01c6da5080aa413dd830121842b
BLAKE2b-256 4b6deaf30fb3c4494cbdb2c1bbcadcfb25b1c36fdfb9f2b1939fa7045a127940

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_kuma_uptime_badge-0.1.0-py3-none-any.whl:

Publisher: publish.yml on culturepulse/mkdocs-kuma-uptime-badge

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