Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 83d880f

Browse files
authored
Merge pull request #61 from kodadot/prerender
Prerender
2 parents 64f9356 + 9a9c0a9 commit 83d880f

File tree

13 files changed

+106
-21
lines changed

13 files changed

+106
-21
lines changed

dashboard/netlify.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[[redirects]]
2+
from = "/robots.txt"
3+
to = "/static/robots.txt"
4+
status = 200
5+
force = true
6+
7+
[[redirects]]
8+
from = "/*"
9+
to = "/index.html"
10+
status = 200

dashboard/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"vue": "2.6.11",
4242
"vue-class-component": "^7.2.2",
4343
"vue-clipboard2": "^0.3.1",
44+
"vue-meta": "^2.4.0",
4445
"vue-property-decorator": "^8.4.0",
4546
"vue-router": "^3.1.5",
4647
"vuex": "^3.1.2",

dashboard/public/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="utf-8" />
55
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
66
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
7+
<meta name="fragment" content="!">
78
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
89
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
910
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
@@ -12,7 +13,7 @@
1213
<link rel="manifest" href="./manifest.webmanifest">
1314
<meta name="msapplication-TileColor" content="#da532c">
1415
<meta name="theme-color" content="#000000">
15-
<title>KodaDot - NFT Explorer</title>
16+
<title>KodaDot - Polkadot NFT Explorer</title>
1617
<style>
1718
html,
1819
body,
@@ -63,7 +64,7 @@
6364
<div class="preloader-container">
6465
<h1 class="preloader">
6566
<img src="/kodadot_logo_v1_transparent_400px.jpg"/> <br/>
66-
🔌 Charging 🖼 NFT Explorer</h1>
67+
🔌 Charging 🖼 NFT Market Explorer</h1>
6768
</div>
6869
</div>
6970
<!-- built files will be auto injected -->

dashboard/root/_redirects

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/sitemap.xml /sitemap.xml 200!
2+
/robots.txt /robots.txt 200!
3+
/* /index.html 200

dashboard/src/App.vue

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,29 @@ import keyring from '@polkadot/ui-keyring';
1212
import Navbar from './components/Navbar.vue';
1313
import Connector from '@vue-polkadot/vue-api';
1414
15-
@Component({
15+
@Component<Dashboard>({
16+
metaInfo() {
17+
return {
18+
title: 'KodaDot 🖼👀 First Polkadot/Kusama NFT Market Explorer',
19+
titleTemplate: '%s | KodaDot',
20+
meta: [{
21+
vmid: 'description',
22+
name: 'description',
23+
content: 'KodaDot 🖼👀 First Polkadot/Kusama NFT Market Explorer'
24+
},
25+
{ property: 'og:title', content: 'KodaDot 🖼👀 First Polkadot/Kusama NFT Market Explorer' },
26+
{ property: 'og:type', content: 'website'},
27+
{ property: 'og:url', content: 'https://kodadot.xyz'},
28+
{ property: 'og:description', content: 'KodaDot 🖼👀 First Polkadot/Kusama NFT Market Explorer' },
29+
{ property: 'og:site_name', content: 'KodaDot 🖼👀 First Polkadot/Kusama NFT Market Explorer'},
30+
{ property: 'og:locale', content: 'en_US'},
31+
// { property: 'og:image', content: '/img/icons/android-chrome-256x256.png'}
32+
]
33+
}
34+
},
1635
components: {
1736
Navbar,
18-
},
37+
}
1938
})
2039
export default class Dashboard extends Vue {
2140
get chainProperties() {

dashboard/src/components/rmrk/Create/CreateCollection.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
<p class="title">
3131
Content
3232
</p>
33-
<b-switch v-model="uploadMode" passive-type="is-dark">
33+
<b-switch v-model="uploadMode"
34+
passive-type="is-dark"
35+
:rounded="false">
3436
{{ uploadMode ? 'Upload through KodaDot' : 'IPFS hash of your content' }}
3537
</b-switch>
3638
<template v-if="uploadMode">

dashboard/src/components/rmrk/Create/CreateItem.vue

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,18 @@
1919
<Tooltip :label="tooltip.instance" />
2020
</b-field>
2121
<b-field>
22-
<b-switch :true-value="1" :false-value="0"
22+
<!-- <b-switch :true-value="1" :false-value="0"
2323
v-model="view.transferable" disabled>
2424
Transferable is by default
25-
</b-switch>
25+
</b-switch> -->
2626
</b-field>
2727
<!-- <b-field v-if="view.transferable" label="Price">
2828
<b-input v-model="view.price" ></b-input>
2929
</b-field> -->
3030
<b-field>
31-
<b-switch v-model="uploadMode" passive-type="is-dark" type="is-info">
31+
<b-switch v-model="uploadMode"
32+
passive-type="is-dark"
33+
:rounded="false">
3234
{{ uploadMode ? 'Upload through KodaDot' : 'IPFS hash' }}
3335
</b-switch>
3436
</b-field>
@@ -40,9 +42,16 @@
4042
type="textarea"
4143
></b-input>
4244
</b-field>
43-
<MetadataUpload v-model="image" label="Click to add image" />
44-
<div>If your artwork is animated (audio/video/3d model) add animated</div>
45-
<MetadataUpload v-model="animatimated" label="Add animated file" />
45+
<b-field>
46+
<b-switch v-model="isImage"
47+
passive-type="is-dark"
48+
:rounded="false">
49+
{{ isImage ? 'Static Image' : 'Animated multimedia' }}
50+
</b-switch>
51+
</b-field>
52+
<MetadataUpload v-if="isImage" v-model="image" label="Click to add image" />
53+
<!-- <div>If your artwork is animated (audio/video/3d model) add animated</div> -->
54+
<MetadataUpload v-if="!isImage" v-model="animated" label="Add animated file" />
4655
<b-field label="Image data">
4756
<b-input v-model="view.meta.image_data"></b-input>
4857
</b-field>
@@ -78,14 +87,15 @@ export default class CreateItem extends Vue {
7887
@Prop() public index!: number;
7988
@Prop() public alreadyMinted!: number;
8089
@Prop() public view!: NFTAndMeta;
90+
private isImage: boolean = true;
8191
private tooltip: object = {
8292
name: 'Name of your token',
8393
instance: 'Instance is like the identifier of an NFT, like a marketplace ticker. It\'s a "short computer-friendly name"',
8494
image: 'Upload will upload your image of the NFT',
8595
}
8696
private uploadMode: boolean = true;
8797
private image: Blob | null = null;
88-
private animatimated: Blob | null = null;
98+
private animated: Blob | null = null;
8999
90100
get nftId(): string {
91101
const {collection, instance, sn} = this.view
@@ -108,7 +118,7 @@ export default class CreateItem extends Vue {
108118
} }
109119
}
110120
111-
@Watch('animatimated')
121+
@Watch('animated')
112122
private animatedUpload(val: Blob, oldVal: Blob | null) {
113123
if (val && !oldVal) {
114124
this.$emit('animated', { image: val, index: this.index })

dashboard/src/components/rmrk/Gallery/GalleryItem.vue

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
</p>
136136
<p class="card-footer-item">
137137
<span>
138-
<a :href="realworldFullPathShare"
138+
<a
139139
v-clipboard:copy="realworldFullPathShare"
140140
@click="toast('URL copied to clipboard')">
141141
<b-icon
@@ -202,16 +202,36 @@ import Appreciation from './Appreciation.vue';
202202
import api from '@/fetch';
203203
import { resolveMedia } from '../utils';
204204
import { MediaType } from '../types';
205+
import { MetaInfo } from 'vue-meta';
205206
206-
type NFTType = NFT | NFTWithMeta;
207+
type NFTType = NFTWithMeta;
207208
208-
@Component({
209+
@Component<GalleryItem>({
210+
metaInfo() {
211+
return {
212+
meta: [
213+
{
214+
vmid: 'description',
215+
name: 'description',
216+
content: 'KodaDot 🖼👀 First Polkadot/Kusama NFT Market Explorer'
217+
},
218+
{ property: 'og:title', content: (this.nft.name as string) },
219+
{ property: 'og:type', content: 'website'},
220+
{ property: 'og:description', content: (this.nft.description as string) },
221+
{ property: 'og:image', content: (this.nft.image as string) }
222+
// { property: 'og:title', content: this.nft.name || 'Artists Mint Title' },
223+
// { property: 'og:type', content: 'website'},
224+
// { property: 'og:description', content: this.nft.description || 'Artist Mint Description' },
225+
// { property: 'og:image', content: this.nft.image || require('@/assets/kodadot_logo_v1_transparent_400px.png') }
226+
]
227+
}
228+
},
209229
components: {
210230
AccountSelect,
211231
AvailableActions,
212232
Money,
213233
Appreciation,
214-
MediaResolver: () => import('../Media/MediaResolver.vue')
234+
MediaResolver: () => import('../Media/MediaResolver.vue'),
215235
}
216236
})
217237
export default class GalleryItem extends Vue {
@@ -278,11 +298,11 @@ export default class GalleryItem extends Vue {
278298
}
279299
280300
get realworldFullPath() {
281-
return `${window.location.origin}/%23${this.$route.fullPath}`;
301+
return `${window.location.origin}${this.$route.fullPath}`;
282302
}
283303
284304
get realworldFullPathShare() {
285-
return `${window.location.origin}/#${this.$route.fullPath}`;
305+
return `${window.location.origin}${this.$route.fullPath}`;
286306
}
287307
288308
get telegramUri() {

dashboard/src/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ import './registerServiceWorker'
1212
import App from './App.vue';
1313
import store from './store';
1414
import router from './router';
15+
16+
import MetaInfo from 'vue-meta';
17+
Vue.use(MetaInfo)
1518
import Connector from '@vue-polkadot/vue-api';
1619
import { client, keyInfo } from '@/textile'
1720
import { createInstance, getInstance } from '@/components/rmrk/service/RmrkService'

dashboard/src/router/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const FourZeroFour = () => import('@/components/FourZeroFour.vue')
1515
// const Toolbox = () => import('@/components/toolbox/Toolbox.vue');
1616

1717
export default new Router({
18+
mode: 'history',
1819
routes: [
1920
{
2021
path: '/',

0 commit comments

Comments
 (0)