Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move each plugin index page from Markdown to model-based doc #1510

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions components/layout/Container.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@
:value="page"
data-bs-spy="scroll"
data-bs-target="#nav-toc"
v-if="!pluginData"
/>
<div class="bd-markdown" v-else>
<ContentParentPlugin
:pageIcon="page.icon"
:pageTitle="page.title"
:pluginData="pluginData"
v-if="pluginData"
/>
</div>
<HelpfulVote />
<PrevNext v-if="prevNext" :navigation="navigation" />
</div>
Expand All @@ -46,13 +55,24 @@
import Breadcrumb from "~/components/layout/Breadcrumb.vue";
import NavToc from "~/components/docs/NavToc.vue";
import HelpfulVote from "~/components/docs/HelpfulVote.vue";
import {ContentParentPlugin} from '@kestra-io/ui-libs'
const config = useRuntimeConfig();
const pluginData = ref(null);
import {hash} from "ohash";
import {recursivePages, generatePageNames} from "~/utils/navigation.js";

const isDoc = computed(() => props.type === 'docs');

const route = useRoute()
const slug = computed(() => `/${props.type}/${route.params.slug instanceof Array ? route.params.slug.join('/') : route.params.slug}`);
const plugins = computed(async () => await $fetch(`${config.public.apiUrl}/plugins`));

const pluginsData = await plugins.value;

if (pluginsData && pluginsData.length && route.params.slug.length === 1) {
pluginData.value = pluginsData.find((item) => item.name === route.params.slug[0]);
}

let page;

const fetchNavigation = async () => {
Expand Down Expand Up @@ -242,6 +262,7 @@
border-top: 1px solid $black-6;
padding-top: calc($spacer * 3.125);
margin-bottom: 2rem;
text-transform: capitalize;

a {
border-left: 5px solid $purple-36;
Expand Down