diff options
author | John, Sing Dao, Siu <john.sd.siu@gmail.com> | 2022-05-15 10:47:41 +0300 |
---|---|---|
committer | John, Sing Dao, Siu <john.sd.siu@gmail.com> | 2022-05-15 10:47:41 +0300 |
commit | 7ea04698cb857acd9c12aa5f16d3fdbba8092554 (patch) | |
tree | 3c6eb7c17d37ba68527ce23466f0cfd67a889f25 | |
parent | da0b3f61693da1ea678967f55b3f26b8fe73765a (diff) |
v2.1.0 - paypal donation button
-rw-r--r-- | README.md | 22 | ||||
-rw-r--r-- | config.demo.toml | 10 | ||||
-rw-r--r-- | config.sample.toml | 6 | ||||
-rw-r--r-- | layouts/partials/paypal.html | 6 | ||||
-rw-r--r-- | layouts/partials/social-share-ext.html | 1 | ||||
-rw-r--r-- | layouts/partials/social-share-int.html | 38 |
6 files changed, 64 insertions, 19 deletions
@@ -23,6 +23,7 @@ Full feature Hugo theme build on top of [hugo-theme-sk2](//github.com/J-Siu/hugo - [Custom Javascript](#custom-javascript) - [Favicon](#favicon) - [Google](#google) + - [Paypal Donation](#paypal-donation) - [Per Page Settings](#per-page-settings) - [Sample Config](#sample-config) - [Font Awesome](#font-awesome) @@ -283,6 +284,19 @@ AdsenseId|text|""|AdSense ID/Tag. enablePageLevelAd|bool|false|Enable/Disable page level ads. enableUA|bool|false|Set this to 'true' if using Google Analytics UA. +#### Paypal Button + +**[Params.paypal]** Enable Paypal donation button along side share buttons. + +Field|Type|Default Value|Description +---|---|---|--- +amount|text|"0"|Default amount. +businessId|text|""|Paypal business Id. Button will only show if this is set. +currency|text|""|Currency code, eg. "CAD", "USD". +enableRecurring|bool|false|Show recurring check-box. + +Information can be obtain by going through [Paypal Donate Button](https://www.paypal.com/donate/buttons?type=C&fromManage=true). You need your own Paypal account to go through the button creation process. + ### Per Page Settings - Disable Disqus @@ -338,6 +352,12 @@ enableOpenGraph = true enableTwitterCard = true title = "SK3" + [Params.paypal] + amount = "" + businessId = "" + currency = "" + enableRecurring = true + [Params.google] AdsenseId = "" enablePageLevelAd = false @@ -498,6 +518,8 @@ Social buttons provided by [Font Awesome](//github.com/FortAwesome/Font-Awesome) - Params names changes - Google param section +- v2.1.0 + - Support Paypal donation button ### License The MIT License (MIT) diff --git a/config.demo.toml b/config.demo.toml index da90ae3..df48a1b 100644 --- a/config.demo.toml +++ b/config.demo.toml @@ -10,11 +10,11 @@ DefaultContentLanguage = "en" enableGitInfo = true enableInlineShortcodes = true languageCode = "en" -paginate = 3 +paginate = 12 relativeURLs = true [Params] -enableExternalSvg = true +# enableExternalSvg = true enableInfoBox = true enableListLastModify = true enableOpenToc = true @@ -31,6 +31,12 @@ enableOpenGraph = true enableTwitterCard = true title = "Hugo Theme SK3 Demo Site(params)" + [Params.paypal] + # amount = "5" + businessId = "HZF49NM9D35SJ" + currency = "CAD" + enableRecurring = true + [Params.card] date = true summary = true diff --git a/config.sample.toml b/config.sample.toml index 7f6a1ed..0cac526 100644 --- a/config.sample.toml +++ b/config.sample.toml @@ -37,6 +37,12 @@ title = "SK3" enablePageLevelAd = false enableUA = false + [Params.paypal] + # amount = "5" + businessId = "" + currency = "CAD" + enableRecurring = true + [Params.card] date = true summary = true diff --git a/layouts/partials/paypal.html b/layouts/partials/paypal.html new file mode 100644 index 0000000..32658f1 --- /dev/null +++ b/layouts/partials/paypal.html @@ -0,0 +1,6 @@ +{{if site.Params.paypal.businessId}} +<a style="all:initial;" + href="https://www.paypal.com/donate/?business={{site.Params.paypal.businessId}}&amount={{site.Params.paypal.amount|default 0}}&no_recurring={{if site.Params.paypal.enableRecurring}}0{{else}}1{{end}}¤cy_code={{site.Params.paypal.currency}}"> + <img style="all:initial;height:24px" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" /> +</a> +{{end}}
\ No newline at end of file diff --git a/layouts/partials/social-share-ext.html b/layouts/partials/social-share-ext.html index 0ab5e04..e634d03 100644 --- a/layouts/partials/social-share-ext.html +++ b/layouts/partials/social-share-ext.html @@ -1,4 +1,5 @@ <sk3-social> + {{partial "paypal.html" .}} {{if site.Params.socialshare.facebook}} <a target="_blank" rel="noopener noreferrer" class="fab fa-facebook" href="//www.facebook.com/sharer/sharer.php?u={{.Permalink}}" diff --git a/layouts/partials/social-share-int.html b/layouts/partials/social-share-int.html index 39bdf1f..c48f5ac 100644 --- a/layouts/partials/social-share-int.html +++ b/layouts/partials/social-share-int.html @@ -1,7 +1,9 @@ <sk3-social> + {{partial "paypal.html" .}} {{if site.Params.socialshare.facebook}} <a target="_blank" rel="noopener noreferrer" href="//www.facebook.com/sharer/sharer.php?u={{.Permalink}}" - onclick="window.open(this.href, 'Facebook', 'width=800,height=600,toolbar=0,status=0'); return false"><svg class="sk3-social-fab"> + onclick="window.open(this.href, 'Facebook', 'width=800,height=600,toolbar=0,status=0'); return false"><svg + class="sk3-social-fab"> <use xlink:href="#facebook"></use> </svg> </a> @@ -9,7 +11,8 @@ {{if site.Params.socialshare.linkedin}} <a target="_blank" rel="noopener noreferrer" href="//www.linkedin.com/shareArticle?mini=true&url={{.Permalink}}&title={{.Title}}" - onclick="window.open(this.href, 'LinkedIn', 'width=640,height=480,toolbar=0,status=0'); return false"><svg class="sk3-social-fab"> + onclick="window.open(this.href, 'LinkedIn', 'width=640,height=480,toolbar=0,status=0'); return false"><svg + class="sk3-social-fab"> <use xlink:href="#linkedin"></use> </svg> </a> @@ -17,44 +20,48 @@ {{if site.Params.socialshare.pinterest}} <a target="_blank" rel="noopener noreferrer" href="//pinterest.com/pin/create/button/?url={{.Permalink}}&description={{.Title}}" - onclick="window.open(this.href, 'Pinterest', 'width=800,height=720,toolbar=0,status=0'); return false"><svg class="sk3-social-fab"> + onclick="window.open(this.href, 'Pinterest', 'width=800,height=720,toolbar=0,status=0'); return false"><svg + class="sk3-social-fab"> <use xlink:href="#pinterest"></use> </svg> </a> {{end}} {{if site.Params.socialshare.pocket}} <a target="_blank" rel="noopener noreferrer" href="//getpocket.com/edit?url={{.Permalink}}&title={{.Title}}" - onclick="window.open(this.href, 'Pocket', 'width=480,height=320,toolbar=0,status=0'); return false"><svg class="sk3-social-fab"> + onclick="window.open(this.href, 'Pocket', 'width=480,height=320,toolbar=0,status=0'); return false"><svg + class="sk3-social-fab"> <use xlink:href="#pocket"></use> </svg> </a> {{end}} {{if site.Params.socialshare.reddit}} - <a target="_blank" rel="noopener noreferrer" - href="//www.reddit.com/submit?url={{.Permalink}}&title={{.Title}}" - onclick="window.open(this.href, 'Reddit', 'width=832,height=624,toolbar=0,status=0'); return false"><svg class="sk3-social-fab"> + <a target="_blank" rel="noopener noreferrer" href="//www.reddit.com/submit?url={{.Permalink}}&title={{.Title}}" + onclick="window.open(this.href, 'Reddit', 'width=832,height=624,toolbar=0,status=0'); return false"><svg + class="sk3-social-fab"> <use xlink:href="#reddit"></use> </svg> </a> {{end}} {{if site.Params.socialshare.telegram}} <a target="_blank" rel="noopener noreferrer" href="//t.me/share/url?url={{.Permalink}}&title={{.Title}}" - onclick="window.open(this.href, 'Telegram', 'width=800,height=600,toolbar=0,status=0'); return false"><svg class="sk3-social-fab"> + onclick="window.open(this.href, 'Telegram', 'width=800,height=600,toolbar=0,status=0'); return false"><svg + class="sk3-social-fab"> <use xlink:href="#telegram"></use> </svg> </a> {{end}} {{if site.Params.socialshare.twitter}} - <a target="_blank" rel="noopener noreferrer" - href="//twitter.com/intent/tweet/?url={{.Permalink}}&text={{.Title}}" - onclick="window.open(this.href, 'Twitter', 'width=800,height=450,resizable=yes,toolbar=0,status=0'); return false"><svg class="sk3-social-fab"> + <a target="_blank" rel="noopener noreferrer" href="//twitter.com/intent/tweet/?url={{.Permalink}}&text={{.Title}}" + onclick="window.open(this.href, 'Twitter', 'width=800,height=450,resizable=yes,toolbar=0,status=0'); return false"><svg + class="sk3-social-fab"> <use xlink:href="#twitter"></use> </svg> </a> {{end}} {{if site.Params.socialshare.vk}} <a target="_blank" rel="noopener noreferrer" href="//vk.com/share.php?url={{.Permalink}}" - onclick="window.open(this.href, 'VK', 'width=640,height=480,toolbar=0,status=0'); return false"><svg class="sk3-social-fab"> + onclick="window.open(this.href, 'VK', 'width=640,height=480,toolbar=0,status=0'); return false"><svg + class="sk3-social-fab"> <use xlink:href="#vk"></use> </svg> </a> @@ -64,13 +71,10 @@ {{if site.Params.socialshare.qzone}} <a target="_blank" rel="noopener noreferrer" href="//sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url={{.Permalink}}&sharesource=qzone&title={{.Title}}&summary={{default .Title .Description}}" - onclick="window.open(this.href, 'QZone', 'width=800,height=720,toolbar=0,status=0'); return false"><svg class="sk3-social-fab"> + onclick="window.open(this.href, 'QZone', 'width=800,height=720,toolbar=0,status=0'); return false"><svg + class="sk3-social-fab"> <use xlink:href="#qzone"></use> </svg> </a> {{end}} - - - - </sk3-social>
\ No newline at end of file |