From cc4e8aca1e895b40e4109c61d65aaa8bc6c7d603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Peixoto?= Date: Wed, 7 Apr 2021 17:55:45 +0100 Subject: [PATCH] fix: update ascii iframe --- src/.vuepress/theme/layouts/BlogPost.vue | 19 ++++++++++++++++-- src/_blog/001-run-ipfs-on-docker.md | 2 +- .../public => assets}/128-nft-header.png | Bin 3 files changed, 18 insertions(+), 3 deletions(-) rename src/{.vuepress/public => assets}/128-nft-header.png (100%) diff --git a/src/.vuepress/theme/layouts/BlogPost.vue b/src/.vuepress/theme/layouts/BlogPost.vue index a3e3c4fb..552787f0 100644 --- a/src/.vuepress/theme/layouts/BlogPost.vue +++ b/src/.vuepress/theme/layouts/BlogPost.vue @@ -47,14 +47,29 @@ export default { showComments: null, }), mounted() { + const ipfsPathRegExp = /^(\/(?:ipfs|ipns)\/[^/]+)/ + const ipfsPathPrefix = + (window.location.pathname.match(ipfsPathRegExp) || [])[1] || '' + + if (ipfsPathPrefix) { + Array.from(document.querySelectorAll('iframe')).forEach((iframe) => { + const src = iframe.getAttribute('src') + if (src.startsWith('/')) { + iframe.setAttribute('src', ipfsPathPrefix + src) + } + }) + } + this.showComments = window.location.hostname === 'blog.ipfs.io' || window.location.hostname === 'blog.ipfs.io.ipns.localhost:8080' || window.location.hostname === '127.0.0.1:8080/ipns/blog.ipfs.io/' || window.location.hostname === 'ipfs-blog.on.fleek.co' || - window.location.hostname === 'ipfs-blog.on.fleek.co.ipns.localhost:8080' || + window.location.hostname === + 'ipfs-blog.on.fleek.co.ipns.localhost:8080' || window.location.hostname === 'ipfs-blog-staging.on.fleek.co' || - window.location.hostname === 'ipfs-blog-staging.on.fleek.co.ipns.localhost:8080' + window.location.hostname === + 'ipfs-blog-staging.on.fleek.co.ipns.localhost:8080' }, } diff --git a/src/_blog/001-run-ipfs-on-docker.md b/src/_blog/001-run-ipfs-on-docker.md index bfdc069f..59f6bbe7 100644 --- a/src/_blog/001-run-ipfs-on-docker.md +++ b/src/_blog/001-run-ipfs-on-docker.md @@ -61,5 +61,5 @@ hello from dockerized ipfs [Kubernetes 1.0](http://kuberneteslaunch.com) comes out next week, so after that, we'll try using it to build a cluster of IPFS nodes that can store any kind of data and be able to retreive it from any other IPFS node. Not just with IPFS nodes in your cluster, but with everyone! - +

asciicast powered by asciinema

diff --git a/src/.vuepress/public/128-nft-header.png b/src/assets/128-nft-header.png similarity index 100% rename from src/.vuepress/public/128-nft-header.png rename to src/assets/128-nft-header.png