Use same path for public and internal "about" pages
This commit is contained in:
parent
3a78b0070b
commit
66b1d4f799
5 changed files with 18 additions and 33 deletions
|
@ -2,7 +2,7 @@
|
|||
<div class="instance-info" v-if="instance">
|
||||
<h1 class="instance-title">{{ instance.title }}</h1>
|
||||
<div class="instance-description">{{ instance.short_description }}</div>
|
||||
<router-link class="btn" :to="{ name: 'about-public' }">Learn more</router-link>
|
||||
<router-link class="btn" :to="{ name: 'about' }">Learn more</router-link>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router"
|
||||
|
||||
import AboutPage from "@/views/About.vue"
|
||||
import AboutPublicPage from "@/views/AboutPublic.vue"
|
||||
import HomeTimeline from "@/views/HomeTimeline.vue"
|
||||
import LandingPage from "../views/LandingPage.vue"
|
||||
import NotificationList from "../views/NotificationList.vue"
|
||||
|
@ -43,10 +42,10 @@ const routes: Array<RouteRecordRaw> = [
|
|||
meta: { onlyGuest: true },
|
||||
},
|
||||
{
|
||||
path: "/about-public",
|
||||
name: "about-public",
|
||||
component: AboutPublicPage,
|
||||
meta: { onlyGuest: true },
|
||||
path: "/about",
|
||||
name: "about",
|
||||
component: AboutPage,
|
||||
meta: { },
|
||||
},
|
||||
{
|
||||
path: "/ethereum",
|
||||
|
@ -54,12 +53,6 @@ const routes: Array<RouteRecordRaw> = [
|
|||
component: EthereumPage,
|
||||
meta: { onlyGuest: true },
|
||||
},
|
||||
{
|
||||
path: "/about",
|
||||
name: "about",
|
||||
component: AboutPage,
|
||||
meta: { onlyAuthenticated: true },
|
||||
},
|
||||
{
|
||||
path: "/home",
|
||||
name: "home",
|
||||
|
|
|
@ -1,26 +1,36 @@
|
|||
<template>
|
||||
<sidebar-layout>
|
||||
<sidebar-layout v-if="currentUser">
|
||||
<template #content v-if="instance">
|
||||
<h1>{{ instance.title }}</h1>
|
||||
<div class="description static-text" v-html="renderMarkdown(instance.description)"></div>
|
||||
</template>
|
||||
</sidebar-layout>
|
||||
<static-page v-else-if="currentUser === null && instance" class="wide">
|
||||
<template #heading>{{ instance.title }}</template>
|
||||
<template #text>
|
||||
<div v-html="renderMarkdown(instance.description)"></div>
|
||||
</template>
|
||||
</static-page>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { $ } from "vue/macros"
|
||||
|
||||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import StaticPage from "@/components/StaticPage.vue"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { renderMarkdown } from "@/utils/markdown"
|
||||
|
||||
const { currentUser } = $(useCurrentUser())
|
||||
const { instance } = $(useInstanceInfo())
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import "../styles/layout";
|
||||
|
||||
.description {
|
||||
/* Internal page */
|
||||
.content .description {
|
||||
font-size: 18px;
|
||||
font-weight: lighter;
|
||||
line-height: 2;
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
<template>
|
||||
<static-page v-if="instance" class="wide">
|
||||
<template #heading>{{ instance.title }}</template>
|
||||
<template #text>
|
||||
<div v-html="renderMarkdown(instance.description)"></div>
|
||||
</template>
|
||||
</static-page>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { $ } from "vue/macros"
|
||||
|
||||
import StaticPage from "@/components/StaticPage.vue"
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { renderMarkdown } from "@/utils/markdown"
|
||||
|
||||
const { instance } = $(useInstanceInfo())
|
||||
</script>
|
|
@ -6,7 +6,7 @@
|
|||
<div class="instance-description">
|
||||
{{ instance.short_description }}
|
||||
<br>
|
||||
<router-link :to="{name: 'about-public'}">Learn more <span class="arrow">>></span></router-link>
|
||||
<router-link :to="{ name: 'about' }">Learn more <span class="arrow">>></span></router-link>
|
||||
</div>
|
||||
</div>
|
||||
<form v-if="instance" class="login-form">
|
||||
|
|
Loading…
Reference in a new issue