vitepress icon indicating copy to clipboard operation
vitepress copied to clipboard

Change Prev / Next Text globally

Open brc-dd opened this issue 2 years ago • 0 comments

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; image

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.

brc-dd avatar Nov 23 '23 07:11 brc-dd