vuepress-plugin-custom-authors
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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>

Package Sidebar

Install

npm i vuepress-plugin-custom-authors

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

5.61 kB

Total Files

9

Last publish

Collaborators

  • gookyn