This commit is contained in:
syuilo 2020-12-27 21:36:36 +09:00
parent 7b738deabf
commit 698fbdf88b
2 changed files with 85 additions and 62 deletions

View file

@ -1,19 +1,15 @@
<template> <template>
<div> <div class="qyqbqfal" v-size="{ max: [500] }">
<main class="_section"> <div class="title">{{ title }}</div>
<div class="_title"><Fa :icon="faFileAlt"/> {{ title }}</div> <div class="body" v-html="body"></div>
<div class="_content"> <div class="footer">
<div v-html="body" class="qyqbqfal"></div>
</div>
<div class="_footer">
<MkLink :url="`https://github.com/syuilo/misskey/blob/master/src/docs/${doc}.ja-JP.md`" class="at">{{ $ts.docSource }}</MkLink> <MkLink :url="`https://github.com/syuilo/misskey/blob/master/src/docs/${doc}.ja-JP.md`" class="at">{{ $ts.docSource }}</MkLink>
</div> </div>
</main>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { computed, defineComponent } from 'vue';
import { faFileAlt } from '@fortawesome/free-solid-svg-icons' import { faFileAlt } from '@fortawesome/free-solid-svg-icons'
import MarkdownIt from 'markdown-it'; import MarkdownIt from 'markdown-it';
import MarkdownItAnchor from 'markdown-it-anchor'; import MarkdownItAnchor from 'markdown-it-anchor';
@ -42,14 +38,14 @@ export default defineComponent({
data() { data() {
return { return {
INFO: { INFO: computed(() => this.title ? {
title: this.title, title: this.title,
icon: faFileAlt icon: faFileAlt,
}, } : null),
faFileAlt, faFileAlt,
title: '', title: null,
body: '', body: null,
markdown: '', markdown: null,
} }
}, },
@ -108,6 +104,21 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
.qyqbqfal { .qyqbqfal {
padding: 32px;
&.max-width_500px {
padding: 16px;
}
> .title {
font-size: 1.5em;
font-weight: bold;
padding: 0 0 0.75em 0;
margin: 0 0 0.75em 0;
border-bottom: solid 1px var(--divider);
}
> .body {
> *:first-child { > *:first-child {
margin-top: 0; margin-top: 0;
} }
@ -160,5 +171,17 @@ export default defineComponent({
border-radius: 4px; border-radius: 4px;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
} }
::v-deep(code) {
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
tab-size: 2;
}
}
> .footer {
padding: 1.5em 0 0 0;
margin: 1.5em 0 0 0;
border-top: solid 1px var(--divider);
}
} }
</style> </style>

View file

@ -29,7 +29,7 @@ export const router = createRouter({
{ path: '/featured', component: page('featured') }, { path: '/featured', component: page('featured') },
{ path: '/docs', component: page('docs') }, { path: '/docs', component: page('docs') },
{ path: '/theme-editor', component: page('theme-editor') }, { path: '/theme-editor', component: page('theme-editor') },
{ path: '/docs/:doc', component: page('doc'), props: true }, { path: '/docs/:doc', component: page('doc'), props: route => ({ doc: route.params.doc }) },
{ path: '/explore', component: page('explore') }, { path: '/explore', component: page('explore') },
{ path: '/explore/tags/:tag', props: true, component: page('explore') }, { path: '/explore/tags/:tag', props: true, component: page('explore') },
{ path: '/search', component: page('search') }, { path: '/search', component: page('search') },