feat(plugins/sponsors): add plugin_sponsors_title support (#1128)

This commit is contained in:
Alicia Sykes
2022-07-11 23:51:25 +01:00
committed by GitHub
parent 8e4d0e55f3
commit e75e00ef58
3 changed files with 11 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ export default async function({login, q, imports, data, graphql, queries, accoun
return null return null
//Load inputs //Load inputs
let {size, sections, past} = await imports.metadata.plugins.sponsors.inputs({data, account, q}) let {size, sections, past, title} = await imports.metadata.plugins.sponsors.inputs({data, account, q})
//Query description and goal //Query description and goal
console.debug(`metrics/compute/${login}/plugins > sponsors > querying sponsors and goal`) console.debug(`metrics/compute/${login}/plugins > sponsors > querying sponsors and goal`)
@@ -81,7 +81,7 @@ export default async function({login, q, imports, data, graphql, queries, accoun
//Results //Results
list = list.sort((a, b) => a.private === b.private ? a.past === b.past ? b.amount - a.amount : a.past - b.past : a.private - b.private) list = list.sort((a, b) => a.private === b.private ? a.past === b.past ? b.amount - a.amount : a.past - b.past : a.private - b.private)
return {sections, about, list, count, goal, size, past} return {sections, about, list, count, goal, size, past, title}
} }
//Handle errors //Handle errors
catch (error) { catch (error) {

View File

@@ -54,3 +54,9 @@ inputs:
default: 24 default: 24
min: 8 min: 8
max: 64 max: 64
plugin_sponsors_title:
description: |
Title caption
type: string
default: Sponsor Me!

View File

@@ -2,7 +2,7 @@
<section> <section>
<h2 class="field"> <h2 class="field">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.565 20.565 0 008 13.393a20.561 20.561 0 003.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.75.75 0 01-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5zM8 14.25l-.345.666-.002-.001-.006-.003-.018-.01a7.643 7.643 0 01-.31-.17 22.075 22.075 0 01-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.08 22.08 0 01-3.744 2.584l-.018.01-.006.003h-.002L8 14.25zm0 0l.345.666a.752.752 0 01-.69 0L8 14.25z"></path></svg> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.565 20.565 0 008 13.393a20.561 20.561 0 003.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.75.75 0 01-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5zM8 14.25l-.345.666-.002-.001-.006-.003-.018-.01a7.643 7.643 0 01-.31-.17 22.075 22.075 0 01-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.08 22.08 0 01-3.744 2.584l-.018.01-.006.003h-.002L8 14.25zm0 0l.345.666a.752.752 0 01-.69 0L8 14.25z"></path></svg>
Sponsor me! <%= plugins.sponsors.title %>
</h2> </h2>
<% if (plugins.sponsors.error) { %> <% if (plugins.sponsors.error) { %>
<div class="row fill-width"> <div class="row fill-width">