2020-04-09 15:27:03 +02:00
|
|
|
<template>
|
|
|
|
|
<main class="page content">
|
|
|
|
|
|
|
|
|
|
<div class="theme-default-content">
|
2020-04-22 11:17:05 +02:00
|
|
|
<template v-if="!hideTitle">
|
|
|
|
|
<h1 v-if="!isList">{{ magicItem.title }}</h1>
|
|
|
|
|
<h2 v-else>{{ magicItem.title }}</h2>
|
|
|
|
|
</template>
|
|
|
|
|
<div class="magic-item-details title">
|
2020-04-10 16:37:48 +02:00
|
|
|
{{displayItemMeta()}}
|
2020-04-09 15:27:03 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2020-04-22 11:17:05 +02:00
|
|
|
<Content v-if="!magicItem.custom" :pageKey="magicItem.key" class="mt-4" />
|
|
|
|
|
<div v-else v-html="md.render(magicItem.content)" class="mt-4"></div>
|
2020-04-09 15:27:03 +02:00
|
|
|
|
2021-02-06 15:39:30 +01:00
|
|
|
<!-- <p v-if="$page.frontmatter.source" class="source">Source : <em>{{ $page.frontmatter.source }}</em></p> -->
|
2020-06-10 19:14:34 +02:00
|
|
|
<p v-if="magicItem.author" class="source">Auteur : <em>{{ magicItem.author }}</em></p>
|
2020-04-09 15:27:03 +02:00
|
|
|
|
|
|
|
|
</main>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2020-04-10 16:37:48 +02:00
|
|
|
import {displayItemMeta} from '@theme/util/magicItemHelpers'
|
2020-04-22 11:17:05 +02:00
|
|
|
import MarkdownIt from 'markdown-it'
|
2021-03-12 19:28:30 +01:00
|
|
|
import { handleTooltips } from '@theme/util'
|
2020-04-09 15:27:03 +02:00
|
|
|
|
2020-04-10 16:37:48 +02:00
|
|
|
export default {
|
2020-04-22 11:17:05 +02:00
|
|
|
name: 'MagicItem',
|
|
|
|
|
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
md: new MarkdownIt()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
props: ['magicItem', 'isList', 'hideTitle'],
|
|
|
|
|
|
2020-04-10 16:37:48 +02:00
|
|
|
methods : {
|
|
|
|
|
displayItemMeta () {
|
2020-04-22 11:17:05 +02:00
|
|
|
return displayItemMeta(this.magicItem.frontmatter)
|
2020-04-10 16:37:48 +02:00
|
|
|
}
|
2021-03-12 19:28:30 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
mounted () {
|
2021-03-13 16:05:08 +01:00
|
|
|
let self = this
|
2021-03-12 19:28:30 +01:00
|
|
|
setTimeout(function () {
|
2021-03-13 16:05:08 +01:00
|
|
|
handleTooltips({pages:self.$site.pages})
|
2021-03-12 19:28:30 +01:00
|
|
|
}, 100);
|
|
|
|
|
this.$router.afterEach(() => {
|
|
|
|
|
setTimeout(function () {
|
2021-03-13 16:05:08 +01:00
|
|
|
handleTooltips({pages:self.$site.pages})
|
2021-03-12 19:28:30 +01:00
|
|
|
}, 100)
|
|
|
|
|
})
|
2020-04-10 16:37:48 +02:00
|
|
|
}
|
2020-04-09 15:27:03 +02:00
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
</style>
|