Skip to content

Commit

Permalink
chore: update deps (#269)
Browse files Browse the repository at this point in the history
* chore: update deps

* refactor: default layout fix
  • Loading branch information
cwaring authored Aug 3, 2023
1 parent 218c8ea commit 6f5f053
Show file tree
Hide file tree
Showing 3 changed files with 774 additions and 743 deletions.
83 changes: 38 additions & 45 deletions layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,53 +1,46 @@
<script>
export default {
mounted() {
if (process.client && window) {
window.history.scrollRestoration = 'auto'
<script setup lang="ts">
onMounted(() => {
// !window safety
if (typeof window === 'undefined')
return
// redirect 'ipfs.io' to the new canonical domain name 'ipfs.tech'
// https://github.com/protocol/bifrost-infra/issues/178#issuecomment-1195867284
const { hostname, pathname, href: url } = window.location
// redirect 'ipfs.io' to the new canonical domain name 'ipfs.tech'
// https://github.com/protocol/bifrost-infra/issues/178#issuecomment-1195867284
const { hostname, pathname, href: url } = window.location
// regular ipfs.io
if (
hostname === 'ipfs.io'
&& !(
pathname.startsWith('/ipns/') || pathname.startsWith('/ipfs/')
)
)
window.location.replace(url.replace('//ipfs.io/', '//ipfs.tech/'))
// regular ipfs.io
if (hostname === 'ipfs.io' && !(pathname.startsWith('/ipns/') || pathname.startsWith('/ipfs/')))
window.location.replace(url.replace('//ipfs.io/', '//ipfs.tech/'))
// subdomain gateways (no tls)
if (hostname.startsWith('ipfs.io.ipns.')) {
window.location.replace(
url.replace('//ipfs.io.ipns.', '//ipfs.tech.ipns.'),
)
}
// subdomain gateways (inlined)
if (hostname.startsWith('ipfs-io.ipns.')) {
window.location.replace(
url.replace('//ipfs-io.ipns.', '//ipfs-tech.ipns.'),
)
}
// path gateways
if (pathname.startsWith('/ipns/ipfs.io/')) {
window.location.replace(
url.replace('/ipns/ipfs.io/', '/ipns/ipfs.tech/'),
)
}
// drop www. if typed in address bar for some reason
if (hostname.startsWith('www.ipfs.'))
window.location.replace(url.replace('//www.ipfs.', '//ipfs.'))
// subdomain gateways (no tls)
if (hostname.startsWith('ipfs.io.ipns.')) {
window.location.replace(
url.replace('//ipfs.io.ipns.', '//ipfs.tech.ipns.'),
)
}
// subdomain gateways (inlined)
if (hostname.startsWith('ipfs-io.ipns.')) {
window.location.replace(
url.replace('//ipfs-io.ipns.', '//ipfs-tech.ipns.'),
)
}
// path gateways
if (pathname.startsWith('/ipns/ipfs.io/')) {
window.location.replace(
url.replace('/ipns/ipfs.io/', '/ipns/ipfs.tech/'),
)
}
// drop www. if typed in address bar for some reason
if (hostname.startsWith('www.ipfs.'))
window.location.replace(url.replace('//www.ipfs.', '//ipfs.'))
// ipfs.network → ipfs.tech (we used it before we got .tech)
if (url.includes('ipfs.network'))
window.location.replace(url.replace('ipfs.network', 'ipfs.tech'))
// ipfs.network → ipfs.tech (we used it before we got .tech)
if (url.includes('ipfs.network'))
window.location.replace(url.replace('ipfs.network', 'ipfs.tech'))
if (url.includes('ipfs-network'))
window.location.replace(url.replace('ipfs-network', 'ipfs-tech'))
}
},
}
if (url.includes('ipfs-network'))
window.location.replace(url.replace('ipfs-network', 'ipfs-tech'))
})
</script>

<template>
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ipfs-website",
"version": "3.0.0",
"private": true,
"packageManager": "pnpm@8.6.10",
"packageManager": "pnpm@8.6.11",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
Expand All @@ -13,21 +13,21 @@
"lint:fix": "eslint . --fix"
},
"dependencies": {
"@vueuse/core": "^10.2.1",
"@vueuse/core": "^10.3.0",
"@vueuse/motion": "2.0.0",
"vue3-carousel": "^0.3.1"
},
"devDependencies": {
"@antfu/eslint-config": "^0.39.8",
"@antfu/eslint-config": "^0.40.0",
"@iconify-json/carbon": "^1.1.18",
"@nuxt/content": "^2.7.2",
"@nuxt/devtools": "^0.7.1",
"@nuxt/devtools": "^0.7.4",
"@nuxtjs/plausible": "^0.2.1",
"@unocss/eslint-config": "^0.53.6",
"@unocss/nuxt": "^0.53.6",
"@unocss/preset-icons": "^0.53.6",
"@vueuse/nuxt": "^10.2.1",
"eslint": "^8.45.0",
"@unocss/eslint-config": "^0.54.1",
"@unocss/nuxt": "^0.54.1",
"@unocss/preset-icons": "^0.54.1",
"@vueuse/nuxt": "^10.3.0",
"eslint": "^8.46.0",
"nuxt": "^3.6.5",
"nuxt-seo-kit": "^1.3.9",
"typescript": "^5.1.6"
Expand Down
Loading

0 comments on commit 6f5f053

Please sign in to comment.