Commit fc939903 authored by Ciarán Ainsworth's avatar Ciarán Ainsworth

Merge branch 'remote-pages' into 'master'

Added pages from funkwhale.audio (coc and statuts)

See merge request !3
parents 68eadf00 1c13aaec
Pipeline #5997 passed with stages
in 2 minutes and 1 second
......@@ -22,3 +22,6 @@ yarn-error.log*
src/translations
locales/**/*.po~
funkwhaleaudio
pages
......@@ -3,8 +3,8 @@
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "scripts/i18n-compile.sh && vue-cli-service serve",
"build": "scripts/i18n-compile.sh && vue-cli-service build",
"serve": "scripts/copy-pages.sh && scripts/i18n-compile.sh && vue-cli-service serve",
"build": "scripts/copy-pages.sh && scripts/i18n-compile.sh && vue-cli-service build",
"i18n-compile": "scripts/i18n-compile.sh",
"i18n-extract": "scripts/i18n-extract.sh",
"lint": "vue-cli-service lint"
......@@ -12,6 +12,7 @@
"dependencies": {
"core-js": "^2.6.5",
"fork-awesome": "^1.1.7",
"marked": "^0.7.0",
"typeface-montserrat": "^0.0.54",
"typeface-noto-sans": "^0.0.72",
"vue": "^2.6.10",
......@@ -33,6 +34,7 @@
"prerender-spa-plugin": "^3.4.0",
"prettier": "^1.18.2",
"purecss": "^1.0.0",
"raw-loader": "^3.1.0",
"sass-loader": "^7.1.0",
"vue-template-compiler": "^2.6.10"
},
......
#!/bin/bash -eux
DIRECTORY=funkwhaleaudio
if [ ! -d "$DIRECTORY" ]; then
git clone https://dev.funkwhale.audio/funkwhale/funkwhale.audio.git $DIRECTORY
fi
mkdir -p src/pages
cp -r $DIRECTORY/src/pages/* src/pages
......@@ -2,7 +2,7 @@
<div id="app">
<navigation />
<main>
<router-view />
<router-view :key="$route.path" />
</main>
<footer class="main-footer">
<div class="very wide wrapper">
......
......@@ -47,6 +47,20 @@ export default new Router({
component: () =>
import(/* webpackChunkName: "contact" */ "./views/Platforms.vue")
},
{
path: "/:locale?/code-of-conduct",
props: true,
name: "coc",
component: () =>
import(/* webpackChunkName: "pages" */ "./views/Page.vue")
},
{
path: "/:locale?/collective",
props: true,
name: "collective",
component: () =>
import(/* webpackChunkName: "pages" */ "./views/Page.vue")
},
{ path: "/:locale?/*", props: true, component: PageNotFound }
]
});
<template>
<div class="row">
<section v-html="content"></section>
</div>
</template>
<script>
import PageMixin from "../PageMixin";
export default {
mixins: [PageMixin],
data() {
return {
rawContent: null,
marked: null
};
},
computed: {
page() {
return this.$router.currentRoute.name;
},
content() {
if (this.rawContent) {
return this.marked(this.rawContent);
}
return null;
}
},
async created() {
let self = this;
this.marked = (await import("marked")).default;
await self.render();
},
methods: {
async render() {
let language = this.$language.current;
let fallback = "en_US";
let content;
try {
content = await import(
`raw-loader!../pages/${this.page}/${language}.md`
);
} catch {
content = await import(
`raw-loader!../pages/${this.page}/${fallback}.md`
);
}
this.rawContent = content.default;
}
},
watch: {
async "$language.current"() {
await this.render();
}
}
};
</script>
......@@ -6,10 +6,16 @@ module.exports = {
publicPath: process.env.VUE_APP_ROUTER_BASE_URL || "/",
chainWebpack: config => {
config.plugins.delete("prefetch");
config.module
.rule("raw")
.test("/.md$/")
.use("raw-loader")
.loader("raw-loader")
.end();
},
configureWebpack: () => {
if (process.env.NODE_ENV !== "production") return;
let baseRoutes = ["/", "/contact"];
let baseRoutes = ["/", "/contact", "/code-of-conduct"];
let finalRoutes = [];
baseRoutes.forEach(p => {
finalRoutes.push(p);
......
......@@ -5659,6 +5659,11 @@ map-visit@^1.0.0:
dependencies:
object-visit "^1.0.0"
marked@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/marked/-/marked-0.7.0.tgz#b64201f051d271b1edc10a04d1ae9b74bb8e5c0e"
integrity sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==
matcher@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/matcher/-/matcher-1.1.1.tgz#51d8301e138f840982b338b116bb0c09af62c1c2"
......@@ -7510,6 +7515,14 @@ raw-body@2.4.0:
iconv-lite "0.4.24"
unpipe "1.0.0"
raw-loader@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-3.1.0.tgz#5e9d399a5a222cc0de18f42c3bc5e49677532b3f"
integrity sha512-lzUVMuJ06HF4rYveaz9Tv0WRlUMxJ0Y1hgSkkgg+50iEdaI0TthyEDe08KIHb0XsF6rn8WYTqPCaGTZg3sX+qA==
dependencies:
loader-utils "^1.1.0"
schema-utils "^2.0.1"
rc@^1.2.7:
version "1.2.8"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
......@@ -7984,6 +7997,14 @@ schema-utils@^1.0.0:
ajv-errors "^1.0.0"
ajv-keywords "^3.1.0"
schema-utils@^2.0.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.4.1.tgz#e89ade5d056dc8bcaca377574bb4a9c4e1b8be56"
integrity sha512-RqYLpkPZX5Oc3fw/kHHHyP56fg5Y+XBpIpV8nCg0znIALfq3OH+Ea9Hfeac9BAMwG5IICltiZ0vxFvJQONfA5w==
dependencies:
ajv "^6.10.2"
ajv-keywords "^3.4.1"
scss-tokenizer@^0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz#8eb06db9a9723333824d3f5530641149847ce5d1"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment