1.0.1 • Published 12 months ago

vuepress-plugin-custom-authors v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

vuepress-plugin-custom-authors

Add custom authors to the VuePress.

Install

yarn add vuepress-plugin-custom-authors

Config

Add it to your Vuepress configuration's plugin list:

// .vuepress/config.ts
import { defineUserConfig } from 'vuepress';
import { customAuthorsPlugin } from 'vuepress-plugin-custom-authors';

export default defineUserConfig({
  plugins: [
    customAuthorsPlugin({
      label: 'Your Custom Label', // Custom label text, default: Authors
    }),
  ],
});

Usage

Add authors at the frontmatter of the markdown document:

---
authors: AuthorA, AuthorB
---

Display anywhere in the component:

<script setup lang="ts">
import { computed } from 'vue';
import { usePageData } from '@vuepress/client';

const page = usePageData();

const authors = computed(() => ({
  label: page.value.authorLabel,
  name: page.value.authors,
}));
</script>

<template>
  <p>
    <span>{{ authors.label }}: </span>
    <span>{{ authors.name }}</span>
  </p>
</template>
1.0.1

12 months ago

1.0.0

12 months ago