Change Prev / Next Text globally
Discussed in https://github.com/vuejs/vitepress/discussions/3240
Originally posted by Karlstens November 23, 2023 Hi all,
I've read through both;
- https://vitepress.dev/reference/default-theme-prev-next-links
- https://vitepress.dev/reference/site-config
Using frontmatter, I can update/change the prev / next text of a site like this;
---
title: My Page
description: My Page Description
next: ">"
prev: "<"
---
Which results in this;
I managed to disable the Prev / Next labels by adding docFooter to my config.mjs;
//config.mjs
import { defineConfig } from "vitepress";
export default defineConfig({
title: "Docs",
description: "Documentation",
themeConfig: {
docFooter: {
prev: " ",
next: " "
},
logo: {
dark: '/Logo_Dark.png',
light: '/Logo_Light.png'
},
...
})
Adding a space char to the docFooter prev / next cleared the labels - however, I have countless markdown.md files, and I'm needing a method to have all of them display prev "<" and next ">" instead of the default link text - but without editing their front matter because that would mean I'd need to edit countless markdown files.
Similarly to the docFooter which allowed me to remove the label, how can I overwrite all Previous Next Link texts to "<" and ">", in effect globally?
Further to this, it would still be cool to beable to override that global change by then entering in specific Prev / Next text into the frontmatter, which would allow for exceptions.
Thanks for help in advance.