Skip to content

docs: fix "Edit this page" links, and links on the rules overview page #851

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

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { defineConfig } from "vitepress";
import { rules } from "./rulesForSidebar";
import { description, version } from "../../package.json";
import { BASE_URL } from "./constants";

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "eslint-plugin-vuejs-a11y",
base: "/eslint-plugin-vuejs-accessibility/",
base: BASE_URL,
description,
head: [
[
Expand Down Expand Up @@ -66,7 +67,7 @@ export default defineConfig({

editLink: {
pattern:
"https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility/edit/master/docs/:path"
"https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility/edit/main/docs/:path"
},

socialLinks: [
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const BASE_URL = "/eslint-plugin-vuejs-accessibility/";
3 changes: 2 additions & 1 deletion docs/.vitepress/rulesForSidebar.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { join, parse } from "node:path";
import { Dirent, readdirSync } from "node:fs";
import { BASE_URL } from "./constants";

export const rules = getRulesForSideBar();

Expand Down Expand Up @@ -29,6 +30,6 @@ function fileNameWithoutExtension(file: Dirent) {
function ruleToSidebarItem(ruleName: string) {
return {
text: ruleName,
link: `/rules/${ruleName}`
link: `${BASE_URL}rules/${ruleName}`
};
}