mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-17 16:02:16 +00:00
Add donate & script page badges to descriptions
Update LXC and VM description blocks to include donation and script page badges. Introduces script_slug, script_url and donate_url variables (derived from SCRIPT_SLUG or NSAPP/APP, normalized to lowercase and dashed) and uses them to build links. Replaces the old Ko-fi "Buy us a coffee" badge with a generic donate badge and adds an "Open Script Page" badge linking to the script detail page.
This commit is contained in:
@@ -5906,6 +5906,12 @@ create_lxc_container() {
|
||||
# ------------------------------------------------------------------------------
|
||||
description() {
|
||||
IP=$(pct exec "$CTID" ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
|
||||
local script_slug script_url donate_url
|
||||
|
||||
script_slug="${SCRIPT_SLUG:-${NSAPP}}"
|
||||
script_slug="$(echo "$script_slug" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')"
|
||||
script_url="https://community-scripts.org/scripts/${script_slug}"
|
||||
donate_url="https://community-scripts.org/donate"
|
||||
|
||||
# Generate LXC Description
|
||||
DESCRIPTION=$(
|
||||
@@ -5918,8 +5924,14 @@ description() {
|
||||
<h2 style='font-size: 24px; margin: 20px 0;'>${APP} LXC</h2>
|
||||
|
||||
<p style='margin: 16px 0;'>
|
||||
<a href='https://ko-fi.com/community_scripts' target='_blank' rel='noopener noreferrer'>
|
||||
<img src='https://img.shields.io/badge/☕-Buy us a coffee-blue' alt='spend Coffee' />
|
||||
<a href='${donate_url}' target='_blank' rel='noopener noreferrer'>
|
||||
<img src='https://img.shields.io/badge/❤️-Sponsoring%20%26%20Donations-FF5E5B' alt='Sponsoring and donations' />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p style='margin: 12px 0;'>
|
||||
<a href='${script_url}' target='_blank' rel='noopener noreferrer'>
|
||||
<img src='https://img.shields.io/badge/📦-Open%20Script%20Page-00617f' alt='Open script page' />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -577,6 +577,13 @@ check_hostname_conflict() {
|
||||
}
|
||||
|
||||
set_description() {
|
||||
local app_name script_slug script_url donate_url
|
||||
app_name=$(echo "${APP,,}" | tr ' ' '-')
|
||||
script_slug="${SCRIPT_SLUG:-${app_name}}"
|
||||
script_slug="$(echo "$script_slug" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')"
|
||||
script_url="https://community-scripts.org/scripts/${script_slug}"
|
||||
donate_url="https://community-scripts.org/donate"
|
||||
|
||||
DESCRIPTION=$(
|
||||
cat <<EOF
|
||||
<div align='center'>
|
||||
@@ -587,8 +594,14 @@ set_description() {
|
||||
<h2 style='font-size: 24px; margin: 20px 0;'>${NSAPP} VM</h2>
|
||||
|
||||
<p style='margin: 16px 0;'>
|
||||
<a href='https://ko-fi.com/community_scripts' target='_blank' rel='noopener noreferrer'>
|
||||
<img src='https://img.shields.io/badge/☕-Buy us a coffee-blue' alt='spend Coffee' />
|
||||
<a href='${donate_url}' target='_blank' rel='noopener noreferrer'>
|
||||
<img src='https://img.shields.io/badge/❤️-Sponsoring%20%26%20Donations-FF5E5B' alt='Sponsoring and donations' />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p style='margin: 12px 0;'>
|
||||
<a href='${script_url}' target='_blank' rel='noopener noreferrer'>
|
||||
<img src='https://img.shields.io/badge/📦-Open%20Script%20Page-00617f' alt='Open script page' />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user