jam-my-stack youtube implementation executed

This commit is contained in:
Wouter Groeneveld 2021-06-15 13:26:07 +02:00
parent ea873bd61d
commit 7992700632
29 changed files with 839 additions and 14 deletions

Binary file not shown.

View File

@ -21,9 +21,7 @@ Who doesn't like cookies? I'm [a baker](https://redzuurdesem.be/) - I would know
I achieved this by ditching Google Analytics and hosting third-party libraries myself. So _rest assured_, Google does not know you were here! Instead, I use [GoatCounter](https://www.goatcounter.com), a simple and privacy-focused analytics system that is self-hosted. It does _not_ require any cookie and it's hosted on my own SSL-verified domain.
When a YouTube video is embedded into one of these pages, it will run in "no cookie" mode. That means content will be served from youtube-nocookie.com, preventing Google from tracking my visitors.
The commenting system I self-host is [Commento](https://www.commento.io), a fast, privacy-focused commenting platform. It does come with cookies if you decide to login, but again: it's on my own SSL-verified domain.
When a YouTube video _seems_ to be embedded into one of these pages, in reality, it is not. Thumbnails are processed and self-hosted. Only by clicking on the image, you will be redirected to the youtube.com domain, preventing Google from tracking my visitors.
### Material used on this site
@ -31,6 +29,8 @@ All screenshots and images related to games are of course still copyrighted by t
The Jefklak's Codex theme icons come from the game **[Gobliins 2](/articles/gobliins2-review)**, an old DOS point-and-click adventure game made by [Coktel Vision](https://en.wikipedia.org/wiki/Coktel_Vision). The French studio has been bought by Vivendi and parts of it gone bankrupt in 2004, so I have no idea if I'm free to use their sprites. The legal "abandonware" rights have always been a bit shady.
This site has [Webmentions](https://indieweb.org/webmention) and Pingbacks enabled. Therefore, some content, including author photographs, originates from other sources. If you would like to have yours removed, please contact me.
This site was built using [Hugo](http://gohugo.io/). Heavily modified template by <a href="https://bootstrapious.com/free-templates" class="external">Bootstrapious.com</a>
<!-- Not removing this link is part of the licence conditions of the template. Thanks for understanding :) -->
&amp; ported to Hugo by <a href="https://github.com/kishaningithub">Kishan B</a>.

View File

@ -1,21 +1,30 @@
const { howlongtobeat, webmention } = require('jam-my-stack');
const { howlongtobeat, webmention, youtube } = require('jam-my-stack');
const fsp = require('fs').promises;
(async function() {
// 1. get how long to beat times
console.log("1. adding Howlongtobeat info...")
await howlongtobeat.howlong(`${__dirname}/content/articles`)
// 4. get webmentions
// 2. get webmentions
console.log("2. Fetching webmentions...")
const mentions = await webmention.getWebmentions("jefklakscodex.com")
const json = JSON.stringify(mentions, null, 4)
await fsp.writeFile(`${__dirname}/data/webmentions.json`, json, 'utf-8')
// 5. send webmentions
// 3. send webmentions
console.log("3. Sending webmentions...")
await webmention.send("jefklakscodex.com")
// 4. generate youtube thumbnails.
console.log("4. Generating YouTube thumbnails...")
await youtube.thumbify({
postDir: `${__dirname}/content/articles`,
downloadDir: `${__dirname}/static/img/yt`,
overlayImg: `${__dirname}/play.png`
})
console.log("-- all done!")
})()

View File

@ -0,0 +1,5 @@
<figure>
<a href="https://www.youtube.com/watch?v={{ index .Params 0 }}" class="lbox">
<img loading="lazy" class="img-responsive" src="/img/yt/{{ index .Params 0 }}.jpg" alt="YouTube video {{ index .Params 0 }}">
</a>
</figure>

View File

@ -20,6 +20,6 @@
},
"homepage": "https://jefklakscodex.com",
"dependencies": {
"jam-my-stack": "^1.0.16"
"jam-my-stack": "^1.0.19"
}
}

BIN
play.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

825
yarn.lock

File diff suppressed because it is too large Load Diff