Fix duplicate version nums + etc (#831)

* Fix duplicate version nums + etc

* Update link info

* Remove useless loading conditions

* Update pages/legal/privacy.vue

Co-authored-by: triphora <emmaffle@modrinth.com>

* Update plugins/xss.js

Co-authored-by: triphora <emmaffle@modrinth.com>

Co-authored-by: triphora <emmaffle@modrinth.com>
This commit is contained in:
Geometrically
2023-01-03 19:06:30 -07:00
committed by GitHub
parent d2b1404907
commit b4236b9a95
21 changed files with 243 additions and 263 deletions

View File

@@ -6,7 +6,7 @@
<div class="ea-text">
<a
href="https://exaroton.com/?utm_source=modrinth&utm_medium=text&utm_campaign=host&utm_content=top"
rel="nofollow noopener"
rel="noopener noreferrer nofollow sponsored"
target="_blank"
>
<LightIcon
@@ -25,7 +25,11 @@
</div>
</div>
<div class="ea-callout">
<a rel="nofollow noopener" target="_blank" href="https://adrinth.com">
<a
rel="noopener noreferrer nofollow sponsored"
target="_blank"
href="https://adrinth.com"
>
Ads via Adrinth
</a>
</div>

View File

@@ -22,13 +22,6 @@
<div class="title">
<nuxt-link :to="`/${$getProjectTypeForUrl(type, categories)}/${id}`">
<h2 class="name">
<IssuesIcon
v-if="hasModMessage"
v-tooltip="
'Project has a message from the moderators. View the project to see more.'
"
aria-label="Project has a message from the moderators. View the project to see more."
/>
{{ name }}
</h2>
</nuxt-link>
@@ -162,7 +155,6 @@ import InfoIcon from '~/assets/images/utils/info.svg?inline'
import ClientIcon from '~/assets/images/utils/client.svg?inline'
import GlobeIcon from '~/assets/images/utils/globe.svg?inline'
import ServerIcon from '~/assets/images/utils/server.svg?inline'
import IssuesIcon from '~/assets/images/utils/issues.svg?inline'
import CalendarIcon from '~/assets/images/utils/calendar.svg?inline'
import EditIcon from '~/assets/images/utils/updated.svg?inline'
import DownloadIcon from '~/assets/images/utils/download.svg?inline'
@@ -179,7 +171,6 @@ export default {
ClientIcon,
ServerIcon,
GlobeIcon,
IssuesIcon,
CalendarIcon,
EditIcon,
DownloadIcon,

View File

@@ -153,6 +153,7 @@
<a
:href="authUrl"
class="log-in-button header-button brand-button"
rel="noopener noreferrer nofollow"
>
<GitHubIcon aria-hidden="true" />
Sign in with GitHub</a
@@ -348,6 +349,7 @@
:target="$external()"
href="https://github.com/modrinth"
class="text-link"
rel="noopener noreferrer nofollow"
>
open source</a
>.
@@ -357,6 +359,7 @@
:target="$external()"
:href="'https://github.com/' + owner + '/' + slug + '/tree/' + hash"
class="text-link"
rel="noopener noreferrer nofollow"
>{{ hash.substring(0, 7) }}</a
>
</p>
@@ -374,16 +377,41 @@
<a :target="$external()" href="https://blog.modrinth.com">Blog</a>
<a :target="$external()" href="https://docs.modrinth.com">Docs</a>
<a :target="$external()" href="https://status.modrinth.com">Status</a>
<a :target="$external()" href="https://github.com/modrinth">GitHub</a>
<a
rel="noopener noreferrer nofollow"
:target="$external()"
href="https://github.com/modrinth"
>GitHub</a
>
</div>
<div class="links links-3" role="region" aria-label="Interact">
<h4 aria-hidden="true">Interact</h4>
<a :target="$external()" href="https://discord.gg/EUHuJHt">Discord</a>
<a :target="$external()" href="https://twitter.com/modrinth">Twitter</a>
<a :target="$external()" rel="me" href="https://floss.social/@modrinth">
<a
rel="noopener noreferrer nofollow"
:target="$external()"
href="https://discord.gg/EUHuJHt"
>
Discord
</a>
<a
rel="noopener noreferrer nofollow"
:target="$external()"
href="https://twitter.com/modrinth"
>
Twitter
</a>
<a
rel="noopener noreferrer nofollow"
:target="$external()"
href="https://floss.social/@modrinth"
>
Mastodon
</a>
<a :target="$external()" href="https://crowdin.com/project/modrinth">
<a
rel="noopener noreferrer nofollow"
:target="$external()"
href="https://crowdin.com/project/modrinth"
>
Crowdin
</a>
</div>

View File

@@ -11,6 +11,7 @@
<a
href="https://discord.gg/EUHuJHt"
class="iconified-button raised-button"
rel="noopener noreferrer nofollow"
>
Get help on Discord
</a>

View File

@@ -196,6 +196,7 @@ export default {
'~/plugins/xss.js',
'~/plugins/vue-syntax.js',
'~/plugins/shorthands.js',
'~/plugins/markdown.js',
],
/*
** Auto import components
@@ -218,9 +219,7 @@ export default {
// Doc: https://axios.nuxtjs.org/usage
'@nuxtjs/dayjs',
'@nuxtjs/axios',
'@nuxtjs/robots',
'@nuxtjs/style-resources',
'@nuxtjs/markdownit',
'cookie-universal-nuxt',
],
ads: {
@@ -271,12 +270,6 @@ export default {
],
},
},
markdownit: {
preset: 'default',
html: true,
linkify: true,
breaks: false,
},
loading: {
color: '#1bd96a',
height: '2px',

135
package-lock.json generated
View File

@@ -11,14 +11,13 @@
"@iarna/toml": "^2.2.5",
"@nuxtjs/axios": "^5.13.1",
"@nuxtjs/dayjs": "^1.2.0",
"@nuxtjs/markdownit": "^2.0.0",
"@nuxtjs/robots": "^2.4.2",
"@nuxtjs/style-resources": "^1.0.0",
"cookie-universal-nuxt": "^2.1.5",
"core-js": "^3.9.1",
"highlight.js": "^10.3.2",
"js-yaml": "^4.1.0",
"jszip": "^3.10.1",
"markdown-it": "^13.0.1",
"nuxt": "^2.15.3",
"sass": "^1.32.12",
"v-tooltip": "^2.0.3",
@@ -2966,31 +2965,6 @@
"integrity": "sha512-t2MZGLf1V2rV4VBZbWIaXKdX/mUcYW0n2znQZoADBkGGxYL8EWqCuCZBmJPJ/Yy9fofJkyuuSuo5GSwo0XdEgw==",
"dev": true
},
"node_modules/@nuxtjs/markdownit": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@nuxtjs/markdownit/-/markdownit-2.0.0.tgz",
"integrity": "sha512-YAEK/s0IzdWK1L74WKTQSMcvNhGgOW0xIWdu5VMxDo1NkNpm/0CbJZgSPt1JYAnT8r8r6wVQ5SY1v/1MZanPlQ==",
"dependencies": {
"@nuxtjs/markdownit-loader": "^1.1.1",
"defu": "^3.2.2",
"raw-loader": "^4.0.2"
}
},
"node_modules/@nuxtjs/markdownit-loader": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@nuxtjs/markdownit-loader/-/markdownit-loader-1.2.0.tgz",
"integrity": "sha512-D6m4578NavamwD03nOU3H3NkS2zYfFJSMChUczlCGDx05DgAoenY4GdCmML1CnAEH/Cv6Bf230RIwDnD926oyQ==",
"dependencies": {
"highlight.js": "^10.5.0",
"loader-utils": "^1.1.0",
"markdown-it": "^8.3.1"
}
},
"node_modules/@nuxtjs/markdownit/node_modules/defu": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/defu/-/defu-3.2.2.tgz",
"integrity": "sha512-8UWj5lNv7HD+kB0e9w77Z7TdQlbUYDVWqITLHNqFIn6khrNHv5WQo38Dcm1f6HeNyZf0U7UbPf6WeZDSdCzGDQ=="
},
"node_modules/@nuxtjs/proxy": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@nuxtjs/proxy/-/proxy-2.1.0.tgz",
@@ -2999,11 +2973,6 @@
"http-proxy-middleware": "^1.0.6"
}
},
"node_modules/@nuxtjs/robots": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/@nuxtjs/robots/-/robots-2.5.0.tgz",
"integrity": "sha512-z1F3HXb05NiZga8Cuq6k5bbowfJOScPtbSOakip0nege+1aI9pGoajzap8eR5s1qwLXAk9Ts+NcgetoUn5lwrQ=="
},
"node_modules/@nuxtjs/style-resources": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@nuxtjs/style-resources/-/style-resources-1.2.1.tgz",
@@ -6195,9 +6164,15 @@
}
},
"node_modules/entities": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
"integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w=="
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz",
"integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==",
"engines": {
"node": ">=0.12"
},
"funding": {
"url": "https://github.com/fb55/entities?sponsor=1"
}
},
"node_modules/errno": {
"version": "0.1.8",
@@ -9286,9 +9261,9 @@
"dev": true
},
"node_modules/linkify-it": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz",
"integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-4.0.1.tgz",
"integrity": "sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==",
"dependencies": {
"uc.micro": "^1.0.1"
}
@@ -9464,13 +9439,13 @@
}
},
"node_modules/markdown-it": {
"version": "8.4.2",
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz",
"integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==",
"version": "13.0.1",
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-13.0.1.tgz",
"integrity": "sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q==",
"dependencies": {
"argparse": "^1.0.7",
"entities": "~1.1.1",
"linkify-it": "^2.0.0",
"argparse": "^2.0.1",
"entities": "~3.0.1",
"linkify-it": "^4.0.1",
"mdurl": "^1.0.1",
"uc.micro": "^1.0.5"
},
@@ -9478,6 +9453,11 @@
"markdown-it": "bin/markdown-it.js"
}
},
"node_modules/markdown-it/node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
},
"node_modules/md5.js": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
@@ -12194,6 +12174,7 @@
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-4.0.2.tgz",
"integrity": "sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==",
"dev": true,
"dependencies": {
"loader-utils": "^2.0.0",
"schema-utils": "^3.0.0"
@@ -12213,6 +12194,7 @@
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
"integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
"dev": true,
"dependencies": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
@@ -18830,33 +18812,6 @@
}
}
},
"@nuxtjs/markdownit": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@nuxtjs/markdownit/-/markdownit-2.0.0.tgz",
"integrity": "sha512-YAEK/s0IzdWK1L74WKTQSMcvNhGgOW0xIWdu5VMxDo1NkNpm/0CbJZgSPt1JYAnT8r8r6wVQ5SY1v/1MZanPlQ==",
"requires": {
"@nuxtjs/markdownit-loader": "^1.1.1",
"defu": "^3.2.2",
"raw-loader": "^4.0.2"
},
"dependencies": {
"defu": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/defu/-/defu-3.2.2.tgz",
"integrity": "sha512-8UWj5lNv7HD+kB0e9w77Z7TdQlbUYDVWqITLHNqFIn6khrNHv5WQo38Dcm1f6HeNyZf0U7UbPf6WeZDSdCzGDQ=="
}
}
},
"@nuxtjs/markdownit-loader": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@nuxtjs/markdownit-loader/-/markdownit-loader-1.2.0.tgz",
"integrity": "sha512-D6m4578NavamwD03nOU3H3NkS2zYfFJSMChUczlCGDx05DgAoenY4GdCmML1CnAEH/Cv6Bf230RIwDnD926oyQ==",
"requires": {
"highlight.js": "^10.5.0",
"loader-utils": "^1.1.0",
"markdown-it": "^8.3.1"
}
},
"@nuxtjs/proxy": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@nuxtjs/proxy/-/proxy-2.1.0.tgz",
@@ -18865,11 +18820,6 @@
"http-proxy-middleware": "^1.0.6"
}
},
"@nuxtjs/robots": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/@nuxtjs/robots/-/robots-2.5.0.tgz",
"integrity": "sha512-z1F3HXb05NiZga8Cuq6k5bbowfJOScPtbSOakip0nege+1aI9pGoajzap8eR5s1qwLXAk9Ts+NcgetoUn5lwrQ=="
},
"@nuxtjs/style-resources": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@nuxtjs/style-resources/-/style-resources-1.2.1.tgz",
@@ -21384,9 +21334,9 @@
}
},
"entities": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
"integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w=="
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz",
"integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q=="
},
"errno": {
"version": "0.1.8",
@@ -23667,9 +23617,9 @@
"dev": true
},
"linkify-it": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz",
"integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-4.0.1.tgz",
"integrity": "sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==",
"requires": {
"uc.micro": "^1.0.1"
}
@@ -23819,15 +23769,22 @@
}
},
"markdown-it": {
"version": "8.4.2",
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz",
"integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==",
"version": "13.0.1",
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-13.0.1.tgz",
"integrity": "sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q==",
"requires": {
"argparse": "^1.0.7",
"entities": "~1.1.1",
"linkify-it": "^2.0.0",
"argparse": "^2.0.1",
"entities": "~3.0.1",
"linkify-it": "^4.0.1",
"mdurl": "^1.0.1",
"uc.micro": "^1.0.5"
},
"dependencies": {
"argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
}
}
},
"md5.js": {
@@ -26005,6 +25962,7 @@
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-4.0.2.tgz",
"integrity": "sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==",
"dev": true,
"requires": {
"loader-utils": "^2.0.0",
"schema-utils": "^3.0.0"
@@ -26014,6 +25972,7 @@
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
"integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",

View File

@@ -16,14 +16,13 @@
"@iarna/toml": "^2.2.5",
"@nuxtjs/axios": "^5.13.1",
"@nuxtjs/dayjs": "^1.2.0",
"@nuxtjs/markdownit": "^2.0.0",
"@nuxtjs/robots": "^2.4.2",
"@nuxtjs/style-resources": "^1.0.0",
"cookie-universal-nuxt": "^2.1.5",
"core-js": "^3.9.1",
"highlight.js": "^10.3.2",
"js-yaml": "^4.1.0",
"jszip": "^3.10.1",
"markdown-it": "^13.0.1",
"nuxt": "^2.15.3",
"sass": "^1.32.12",
"v-tooltip": "^2.0.3",

View File

@@ -165,11 +165,19 @@
</button>
</template>
<template v-else>
<a class="iconified-button" :href="authUrl">
<a
class="iconified-button"
:href="authUrl"
rel="noopener noreferrer nofollow"
>
<ReportIcon aria-hidden="true" />
Report
</a>
<a class="iconified-button" :href="authUrl">
<a
class="iconified-button"
:href="authUrl"
rel="noopener noreferrer nofollow"
>
<HeartIcon aria-hidden="true" />
Follow
</a>
@@ -307,6 +315,7 @@
:href="project.issues_url"
class="title"
:target="$external()"
rel="noopener noreferrer nofollow ugc"
>
<IssuesIcon aria-hidden="true" />
<span>Issues</span>
@@ -316,6 +325,7 @@
:href="project.source_url"
class="title"
:target="$external()"
rel="noopener noreferrer nofollow ugc"
>
<CodeIcon aria-hidden="true" />
<span>Source</span>
@@ -325,6 +335,7 @@
:href="project.wiki_url"
class="title"
:target="$external()"
rel="noopener noreferrer nofollow ugc"
>
<WikiIcon aria-hidden="true" />
<span>Wiki</span>
@@ -333,6 +344,7 @@
v-if="project.discord_url"
:href="project.discord_url"
:target="$external()"
rel="noopener noreferrer nofollow ugc"
>
<DiscordIcon class="shrink" aria-hidden="true" />
<span>Discord</span>
@@ -342,6 +354,7 @@
:key="index"
:href="donation.url"
:target="$external()"
rel="noopener noreferrer nofollow ugc"
>
<BuyMeACoffeeLogo
v-if="donation.id === 'bmac'"
@@ -579,11 +592,24 @@
>our documentation</a
>
which provides instructions on using
<a href="https://atlauncher.com/about" :target="$external()">
<a
href="https://atlauncher.com/about"
:target="$external()"
rel="noopener noreferrer nofollow"
>
ATLauncher</a
>, <a href="https://multimc.org/" :target="$external()">MultiMC</a>,
and
<a href="https://prismlauncher.org" :target="$external()">
>,
<a
href="https://multimc.org/"
:target="$external()"
rel="noopener noreferrer nofollow"
>MultiMC</a
>, and
<a
href="https://prismlauncher.org"
:target="$external()"
rel="noopener noreferrer nofollow"
>
Prism Launcher</a
>.
</div>

View File

@@ -105,19 +105,6 @@ export default {
fetch() {
if (this.$route.query.page)
this.currentPage = parseInt(this.$route.query.page)
this.filteredVersions = this.versions.map((version, index) => {
const nextVersion = this.versions[index + 1]
if (
nextVersion &&
version.changelog &&
nextVersion.changelog === version.changelog
) {
return { duplicate: true, ...version }
} else {
return { duplicate: false, ...version }
}
})
},
head() {
const title = `${this.project.title} - Changelog`

View File

@@ -16,7 +16,6 @@
<button
title="Save"
class="iconified-button brand-button column"
:disabled="!$nuxt.$loading"
@click="saveProject"
>
<SaveIcon />
@@ -275,7 +274,7 @@
class="text-link"
href="https://guides.github.com/features/mastering-markdown/"
target="_blank"
rel="noopener noreferrer"
rel="noopener noreferrer nofollow"
>Markdown</a
>. HTML can also be used inside your description, not including styles,
scripts, and iframes (though YouTube iframes are allowed).
@@ -385,7 +384,7 @@
<a
href="https://spdx.org/licenses/"
target="_blank"
rel="noopener noreferrer"
rel="noopener noreferrer nofollow"
class="text-link"
>SPDX license identifier</a
>
@@ -399,7 +398,7 @@
<a
href="https://blog.modrinth.com/licensing-guide/"
target="_blank"
rel="noopener noreferrer"
rel="noopener noreferrer nofollow"
class="text-link"
>
licensing guide</a

View File

@@ -104,7 +104,6 @@
<button
v-if="editIndex === -1"
class="iconified-button brand-button"
:disabled="!$nuxt.$loading"
@click="createGalleryItem"
>
<PlusIcon />
@@ -113,7 +112,6 @@
<button
v-else
class="iconified-button brand-button"
:disabled="!$nuxt.$loading"
@click="editGalleryItem"
>
<SaveIcon />

View File

@@ -58,7 +58,6 @@
</button>
<button
class="iconified-button brand-button"
:disabled="!$nuxt.$loading"
@click="createDataPackVersion"
>
<RightArrowIcon />
@@ -120,11 +119,7 @@
</ul>
</div>
<div v-if="isCreating" class="input-group">
<button
class="iconified-button brand-button"
:disabled="!$nuxt.$loading"
@click="createVersion"
>
<button class="iconified-button brand-button" @click="createVersion">
<PlusIcon aria-hidden="true" />
Create
</button>
@@ -142,7 +137,6 @@
<div v-else-if="isEditing" class="input-group">
<button
class="iconified-button brand-button"
:disabled="!$nuxt.$loading"
@click="saveEditedVersion"
>
<SaveIcon aria-hidden="true" />
@@ -249,7 +243,7 @@
class="text-link"
href="https://guides.github.com/features/mastering-markdown/"
target="_blank"
rel="noopener noreferrer"
rel="noopener noreferrer nofollow"
>Markdown</a
>. HTML can also be used inside your changelog, not including styles,
scripts, and iframes.
@@ -1081,6 +1075,22 @@ export default {
(x) => x.displayUrlEnding === this.$route.params.version
)
// LEGACY- to support old duplicate version URLs
const dashIndex = this.$route.params.version.indexOf('-')
if (!this.version && dashIndex !== -1) {
const version = this.versions.find(
(x) =>
x.displayUrlEnding ===
this.$route.params.version.substring(0, dashIndex)
)
this.$nuxt.context.redirect(
301,
`/${this.project.project_type}/${this.project.slug}/version/${version.version_number}`
)
return
}
if (!this.version) {
this.$nuxt.context.error({
statusCode: 404,

View File

@@ -12,12 +12,18 @@
<h1>Discover, Play, and Create Minecraft content</h1>
<h3>
Find enjoyable, quality content through our
<a href="https://github.com/modrinth" :target="$external()"
<a
href="https://github.com/modrinth"
:target="$external()"
rel="noopener noreferrer nofollow"
>open-source</a
>
modding platform built for the community. Create stuff, get paid, and
deploy your project with our
<a href="https://docs.modrinth.com" :target="$external()"
<a
href="https://docs.modrinth.com"
:target="$external()"
rel="noopener noreferrer nofollow"
>fully documented</a
>
API!
@@ -82,7 +88,11 @@
working on giving creators more analytics, adding new types of
projects, our launcher, and much more! If you have any more
feature ideas, feel free to join our
<a href="https://discord.gg/EUHuJHt" :target="$external()">
<a
rel="noopener noreferrer nofollow"
href="https://discord.gg/EUHuJHt"
:target="$external()"
>
Discord</a
>!
</p>
@@ -90,7 +100,11 @@
<div class="feature completed">
<CheckIcon />
<p>
<a href="https://github.com/modrinth" :target="$external()">
<a
rel="noopener noreferrer nofollow"
href="https://github.com/modrinth"
:target="$external()"
>
100% open source
</a>
</p>

View File

@@ -44,7 +44,9 @@
certain data protection rights. If you wish to be informed what Personal
Information we hold about you and if you want it to be removed from our
systems, please contact us by email at
<a href="mailto:gdpr@modrinth.com">gdpr@modrinth.com</a>.
<a href="mailto:gdpr@modrinth.com" rel="noopener noreferrer nofollow">
gdpr@modrinth.com</a
>.
</p>
<p>

View File

@@ -240,10 +240,23 @@
>playing modpacks</a
>
with
<a href="https://atlauncher.com/about" :target="$external()"
<a
rel="noopener noreferrer nofollow"
href="https://atlauncher.com/about"
:target="$external()"
>ATLauncher</a
>, <a href="https://multimc.org/" :target="$external()">MultiMC</a>, and
<a href="https://prismlauncher.org" :target="$external()">
>,
<a
rel="noopener noreferrer nofollow"
href="https://multimc.org/"
:target="$external()"
>MultiMC</a
>, and
<a
rel="noopener noreferrer nofollow"
href="https://prismlauncher.org"
:target="$external()"
>
Prism Launcher</a
>. Pack creators can reference our documentation on
<a
@@ -251,7 +264,12 @@
:target="$external()"
>creating modpacks</a
>. Join us on
<a href="https://discord.gg/EUHuJHt" :target="$external()">Discord</a>
<a
rel="noopener noreferrer nofollow"
href="https://discord.gg/EUHuJHt"
:target="$external()"
>Discord</a
>
for support.
</div>
<Advertisement type="banner" small-screen="square" />
@@ -365,7 +383,7 @@
:id="result.slug ? result.slug : result.project_id"
:key="result.project_id"
:display="$cosmetics.searchDisplayMode[projectType.id]"
:gallery-images="
:featured-image="
result.featured_gallery
? result.featured_gallery
: result.gallery[0]

View File

@@ -33,6 +33,7 @@
<a
href="https://github.com/settings/connections/applications/3acffb2e808d16d4b226"
target="_blank"
rel="noopener noreferrer nofollow"
>
Head to the Modrinth Application page on GitHub.
</a>

View File

@@ -45,7 +45,12 @@
<ReportIcon aria-hidden="true" />
Report
</button>
<a v-else class="iconified-button" :href="authUrl">
<a
v-else
class="iconified-button"
:href="authUrl"
rel="noopener noreferrer nofollow"
>
<ReportIcon aria-hidden="true" />
Report
</a>
@@ -140,6 +145,7 @@
v-if="githubUrl"
:href="githubUrl"
:target="$external()"
rel="noopener noreferrer nofollow"
class="sidebar__item github-button iconified-button"
>
<GitHubIcon aria-hidden="true" />
@@ -209,7 +215,7 @@
:key="project.id"
:name="project.title"
:display="$cosmetics.searchDisplayMode.user"
:gallery-images="
:featured-image="
project.gallery
.slice()
.sort((a, b) => b.featured - a.featured)

23
plugins/markdown.js Normal file
View File

@@ -0,0 +1,23 @@
import MarkdownIt from 'markdown-it'
export default (ctx, inject) => {
const md = new MarkdownIt('default', {
html: true,
linkify: true,
breaks: false,
})
const defaultRender =
md.renderer.rules.link_open ||
function (tokens, idx, options, env, self) {
return self.renderToken(tokens, idx, options)
}
md.renderer.rules.link_open = function (tokens, idx, options, env, self) {
tokens[idx].attrJoin('rel', 'noopener noreferrer ugc')
return defaultRender(tokens, idx, options, env, self)
}
inject('md', md)
}

View File

@@ -32,116 +32,33 @@ export default (ctx, inject) => {
inject('formatCategory', formatCategory)
inject('formatCategoryHeader', formatCategoryHeader)
inject('computeVersions', (versions) => {
const versionsMap = {}
for (const version of versions.sort(
(a, b) => ctx.$dayjs(a.date_published) - ctx.$dayjs(b.date_published)
)) {
if (versionsMap[version.version_number]) {
versionsMap[version.version_number].push(version)
} else {
versionsMap[version.version_number] = [version]
}
}
const visitedVersions = []
const returnVersions = []
for (const id in versionsMap) {
const versions = versionsMap[id]
if (versions.length === 1) {
versions[0].displayUrlEnding = versions[0].version_number
returnVersions.push(versions[0])
for (const version of versions.reverse()) {
if (visitedVersions.includes(version.version_number)) {
visitedVersions.push(version.version_number)
version.displayUrlEnding = version.id
} else {
const reservedNames = {}
const seenLoaders = {}
const duplicateLoaderIndexes = []
for (let i = 0; i < versions.length; i++) {
const version = versions[i]
const value = version.loaders.join('+')
if (seenLoaders[value]) {
duplicateLoaderIndexes.push(i)
} else {
if (i !== 0) {
version.displayUrlEnding = `${version.version_number}-${value}`
} else {
version.displayUrlEnding = version.version_number
}
reservedNames[version.displayUrlEnding] = true
version.displayName = version.loaders
.map((x) => x.charAt(0).toUpperCase() + x.slice(1))
.join(', ')
returnVersions.push(version)
seenLoaders[value] = true
}
}
const seenGameVersions = {}
const duplicateGameVersionIndexes = []
for (const i of duplicateLoaderIndexes) {
const version = versions[i]
const value = version.game_versions.join('+')
if (seenGameVersions[value]) {
duplicateGameVersionIndexes.push(i)
} else {
if (i !== 0) {
let setDisplayUrl = false
for (const gameVersion in version.game_versions) {
const displayUrlEnding = `${version.version_number}-${gameVersion}`
if (!reservedNames[version.version_number]) {
version.displayUrlEnding = displayUrlEnding
reservedNames[displayUrlEnding] = true
setDisplayUrl = true
break
}
}
if (!setDisplayUrl) {
version.displayUrlEnding = `${version.version_number}-${value}`
}
} else if (!reservedNames[version.version_number]) {
version.displayUrlEnding = version.version_number
reservedNames[version.version_number] = true
}
version.displayName = formatVersions(
version.game_versions,
ctx.store
)
returnVersions.push(version)
seenGameVersions[value] = true
}
}
for (const i in duplicateGameVersionIndexes) {
const version = versions[i]
version.displayUrlEnding = version.id
version.displayName = version.id
returnVersions.push(version)
}
visitedVersions.push(version.version_number)
version.displayUrlEnding = version.version_number
}
returnVersions.push(version)
}
return returnVersions.sort(
(a, b) => ctx.$dayjs(b.date_published) - ctx.$dayjs(a.date_published)
)
return returnVersions.reverse().map((version, index) => {
const nextVersion = returnVersions[index + 1]
if (
nextVersion &&
version.changelog &&
nextVersion.changelog === version.changelog
) {
return { duplicate: true, ...version }
} else {
return { duplicate: false, ...version }
}
})
})
inject('getProjectTypeForDisplay', (type, categories) => {
if (type === 'mod') {

View File

@@ -17,6 +17,7 @@ const options = {
input: ['checked', 'disabled', 'type'],
iframe: ['width', 'height', 'allowfullscreen', 'frameborder'],
img: [...xss.whiteList.img, 'style'],
a: [...xss.whiteList.a, 'rel'],
},
css: {
whiteList: {

3
static/robots.txt Normal file
View File

@@ -0,0 +1,3 @@
User-agent: *
Disallow:
Sitemap: https://modrinth.com/sitemap.xml