Skip to content

Commit 838d771

Browse files
committed
Adding QR Codes for Support Crypto Addresses.
1 parent 6934bb0 commit 838d771

18 files changed

+194
-68
lines changed

.eleventy.js

+24-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ module.exports = (config) => {
9696
return [...uniqueTags];
9797
})
9898

99-
10099
let md = markdownIt({
101100
html: true,
102101
breaks: true,
@@ -149,7 +148,29 @@ module.exports = (config) => {
149148
md.use(markdownItResponsive, {
150149
responsive: {
151150
srcset: {
152-
"*": [
151+
"*.jpg": [
152+
{
153+
width: 320,
154+
rename: { suffix: "-320w" },
155+
},
156+
{
157+
width: 640,
158+
rename: { suffix: "-640w" },
159+
},
160+
{
161+
width: 1280,
162+
rename: { suffix: "-1280w" },
163+
},
164+
{
165+
width: 1920,
166+
rename: { suffix: "-1920w" },
167+
},
168+
// {
169+
// width: 3840,
170+
// rename: { suffix: "-3840w" },
171+
// },
172+
],
173+
"*.png": [
153174
{
154175
width: 320,
155176
rename: { suffix: "-320w" },
@@ -172,6 +193,7 @@ module.exports = (config) => {
172193
// },
173194
],
174195
},
196+
175197
sizes: {
176198
// "*": "(max-width: 320px), (max-width: 640px), (max-width: 1280px), 1920px",
177199
},

_data/git.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
const git = require('async-git');
22

33
module.exports = async function() {
4-
5-
let ret = {
4+
return {
65
commitsha: await git.short,
76
curbranch: await git.branch,
87
commitdate: await git.date,
98
repo: "ChrisSpiegl.com"
10-
}
11-
12-
return ret
13-
}
9+
}
10+
}

_data/qrcode.js

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
const QRCode = require('qrcode')
2+
const mkdirp = require("mkdirp")
3+
4+
module.exports = async () => {
5+
const coins = {
6+
'btc': {
7+
name: 'Bitcoin',
8+
addr: `bc1qcnjmuyr3a0ysejqnzwtu0dylsyt3w7hggwa49x`,
9+
link: `bitcoin:bc1qcnjmuyr3a0ysejqnzwtu0dylsyt3w7hggwa49x?label=Donation&message=Thank%20You%21`,
10+
},
11+
'ltc': {
12+
name: 'Litecoin',
13+
addr: `ltc1q2d3gqjn9y5evh0uvfesgqnqxwguwky78448aw7`,
14+
link: `litecoin:ltc1q2d3gqjn9y5evh0uvfesgqnqxwguwky78448aw7?label=Donation&message=Thank%20You%21`,
15+
},
16+
'doge': {
17+
name: 'Dogecoin',
18+
addr: `DRZVXSnWM9BEL9FFLdE2qmUDBpbWLQC4Cp`,
19+
link: `DRZVXSnWM9BEL9FFLdE2qmUDBpbWLQC4Cp?label=Donation&message=Thank%20You%21`,
20+
},
21+
'xlm': {
22+
name: 'Stellar Lumens',
23+
addr: `GADRZ6G2BXHUJGJQUNR4L6KK3RUPLT3AIV2CP6JQ37ICODJP4FMW7T5T`,
24+
link: `GADRZ6G2BXHUJGJQUNR4L6KK3RUPLT3AIV2CP6JQ37ICODJP4FMW7T5T?label=Donation&message=Thank%20You%21`,
25+
},
26+
'bat': {
27+
name: 'Basic Attention Token',
28+
addr: `0x5696005CA7F60F86F69bdBd897987c410D34398F`,
29+
link: `0x5696005CA7F60F86F69bdBd897987c410D34398F?label=Donation&message=Thank%20You%21`,
30+
},
31+
}
32+
33+
for (const coin of Object.keys(coins)) {
34+
const exportPath = `_site_${process.env.NODE_ENV}`
35+
const folderPath = `/assets/images/qrcodes`
36+
mkdirp.sync(exportPath + folderPath)
37+
coins[coin].filepath = `${folderPath}/${coin}-${coins[coin].addr}.svg`
38+
await QRCode.toFile(`${exportPath}${coins[coin].filepath}`, coins[coin].link)
39+
coins[coin].rendered = `!!! ${coins[coin].name} — $${coin.toUpperCase()}: \`${coins[coin].addr}\`
40+
![QR Code for $${coin.toUpperCase()} address](${coins[coin].filepath})
41+
!!!`
42+
}
43+
44+
return coins
45+
}

_data/redirects.json

+4
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@
297297
"destination": "https://buymeacoff.ee/chrisspiegl",
298298
"slug": "tea"
299299
},
300+
{
301+
"destination": "https://liberapay.com/ChrisSpiegl/donate",
302+
"slug": "liberapay"
303+
},
300304
{
301305
"destination": "https://ChrisSpiegl.com/protheme",
302306
"slug": "themeco"
Loading

_site_production/build.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
LAST BUILD: 2021-05-26T08:03:57.463
1+
LAST BUILD: 2021-05-26T12:26:21.981
22
ENV:

0 commit comments

Comments
 (0)