feat: ajout fiches

This commit is contained in:
Kazhnuz 2023-02-08 12:17:35 +01:00
parent ab15443607
commit 9320e0c134
6 changed files with 79 additions and 1 deletions

View file

@ -1,3 +1,3 @@
# Fiches à télécharger
Vous pourrez trouver sur cette page les différentes fiches de Pélican à télécharger.
Vous pourrez trouver sur cette page les différentes fiches de Pélican à télécharger. Elles sont disponible au format .odt et .pdf, pour permettre une utilisation à l'informatique ou en impression

View file

@ -83,5 +83,12 @@
{"title": "Jeu de plateau", "path": "rules/bases/plateau"}
]
}
],
"fiches":[
{"title":"Fiche de Personnage", "path":"personnage"},
{"title":"Fiche de PNJ", "path":"pnj"},
{"title":"Fiche de Créature", "path":"creature"},
{"title":"Fiche de Suiveur", "path":"suiveur"},
{"title":"Fiche de Véhicule", "path":"vehicule"}
]
}

View file

@ -7,6 +7,21 @@
<router-link to="/about" class="menu-item">À propos</router-link>
</li>
</ul>
<ul class="f-end">
<li>
<router-link to="/fiches" class="menu-item">Fiches</router-link>
</li>
<li>
<a
href="https://git.kobold.cafe/pelican/pelican-jdr"
class="menu-item"
>Sources</a
>
</li>
<li>
<a href="https://kazhnuz.space" class="menu-item">Retour</a>
</li>
</ul>
</div>
</header>
</template>

View file

@ -2,6 +2,7 @@ import { createRouter, createWebHashHistory } from "vue-router";
import HomeView from "../views/HomeView.vue";
import RuleView from "../views/RuleView.vue";
import JdrView from "../views/JdrView.vue";
import FichesView from "../views/FichesView.vue";
const router = createRouter({
history: createWebHashHistory(import.meta.env.BASE_URL),
@ -19,6 +20,10 @@ const router = createRouter({
path: "/jdr/:jdr/",
component: JdrView,
},
{
path: "/fiches",
component: FichesView,
},
{
path: "/about",
name: "about",

View file

@ -1,7 +1,9 @@
import type Link from "./Link";
import type LinkList from "./LinkList";
export default interface PelicanConfig {
version: string;
sidebar: LinkList[];
jdr: LinkList[];
fiches: Link[];
}

49
src/views/FichesView.vue Normal file
View file

@ -0,0 +1,49 @@
<script setup lang="ts">
import { onMounted } from "vue";
import { useTocStore } from "@/stores/toc";
import { useConfigStore } from "@/stores/config";
import MarkdownFile from "../components/MarkdownFile.vue";
import { computed } from "vue";
const config = useConfigStore();
const toc = useTocStore();
onMounted(() => {
toc.resetToc();
});
const fiches = computed(() => {
return config.config?.fiches ?? [];
});
</script>
<template>
<MarkdownFile path="pages/fiches">
<div class="card">
<div
v-for="(fiche, index) of fiches"
class="d-flex f-between"
:key="index"
:class="{ pt1: index > 0 }"
>
<div>{{ fiche.title }}</div>
<div>
<a :href="`/download/fiche-${fiche.path}.odt`" class="btn btn-primary"
>.odt</a
>
<a
:href="`/download/fiche-${fiche.path}.pdf`"
class="btn btn-secondary"
>.pdf</a
>
</div>
</div>
</div>
</MarkdownFile>
</template>
<style lang="scss">
.pt1 {
padding-top: 1.5rem;
}
</style>