You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c0f944a
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,8 @@ It documents BinaryNoir's open-source VitePress plugins, Vite plugins and comman
16
16
|[`markdown-it-glossary`](https://github.com/binarynoir/markdown-it-glossary)| Hover definitions from `docs/reference/glossary.md`|
17
17
|[`@binarynoir/vitepress-html-escape`](https://github.com/binarynoir/vitepress-html-escape)| Stray tags like `Array<string>` and `{{ }}` render as text; hints underline them in `docs:dev`|
18
18
|[`@binarynoir/vitepress-broken-links`](https://github.com/binarynoir/vitepress-broken-links)| Dead links render as text with a fix-it popover instead of failing the build |
19
+
|[`@binarynoir/vitepress-exclude`](https://github.com/binarynoir/vitepress-exclude)|`.exclude` files keep pages out of the build (a draft in `docs/plugins/exclude/` on purpose) |
20
+
|[`@binarynoir/vitepress-readme-index`](https://github.com/binarynoir/vitepress-readme-index)|`README.md` served as a folder's index page, for VuePress migrations |
19
21
|[`@binarynoir/vite-plugin-optimize-images`](https://github.com/binarynoir/vite-plugin-optimize-images)| Re-compresses images in the build output |
20
22
|[`@binarynoir/vite-plugin-image-fallback`](https://github.com/binarynoir/vite-plugin-image-fallback)| Placeholder for missing images (one is missing on purpose) |
Copy file name to clipboardExpand all lines: docs/guide/how-this-site-works.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ title: How this site works
6
6
7
7
[[readingTime]]
8
8
9
-
This site is plain VitePress 2 plus ten plugins. There is no hand-written navigation anywhere: add a Markdown file in the right folder and it shows up in the sidebar, the navbar, search and the sitemap.
9
+
This site is plain VitePress 2 plus twelve plugins. There is no hand-written navigation anywhere: add a Markdown file in the right folder and it shows up in the sidebar, the navbar, search and the sitemap.
10
10
11
11
## Folder layout
12
12
@@ -19,6 +19,8 @@ docs/
19
19
plugins/ developer docs for each plugin
20
20
.sidebar order and titles for this section
21
21
downloads/ files the Downloads demo publishes as-is
22
+
exclude/ a .exclude file and the draft it keeps out of the build
23
+
readme-index/ pages served from README.md, as in VuePress
22
24
apps/ user docs for the CLI apps
23
25
guide/ this section
24
26
reference/ glossary terms and the generated list of every tag
@@ -41,6 +43,8 @@ docs/
41
43
| File download links |[Downloads](/plugins/downloads)|`markdown.config` and `vite.plugins`|
42
44
| Stray `<tags>` shown as text |[HTML Escape](/plugins/html-escape/)|`markdown.config`, plus the theme |
43
45
| Dead links shown as text |[Broken Links](/plugins/broken-links)|`markdown.config`, plus the theme |
46
+
| Pages left out by `.exclude`|[Exclude](/plugins/exclude/)|`srcExclude` and `vite.plugins`|
47
+
|`README.md` as a folder's index |[README Index](/plugins/readme-index/)|`rewrites` and `markdown.config`|
Copy file name to clipboardExpand all lines: docs/index.md
+24-65Lines changed: 24 additions & 65 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,73 +25,46 @@ features:
25
25
dark: /icons/layout-dark.svg
26
26
width: 28
27
27
height: 28
28
-
title: Auto Sidebar & Navbar
29
-
details: Menus built from your folder structure, ordered and titled by tiny plain-text files.
30
-
link: /plugins/auto-sidebar
31
-
linkText: See the sidebar plugin
28
+
title: Navigation from your folders
29
+
details: Auto Sidebar and Auto Navbar build the menus from your folder tree, ordered and titled by small plain-text files.
30
+
link: /plugins/#navigation
31
+
linkText: Navigation plugins
32
32
- icon:
33
33
light: /icons/tag-light.svg
34
34
dark: /icons/tag-dark.svg
35
35
width: 28
36
36
height: 28
37
-
title: Markdown Tags
38
-
details: Inline status badges for VitePress, VS Code and Obsidian, plus site-wide pages that list every tag.
39
-
link: /plugins/markdown-tags/
40
-
linkText: See the tags plugin
37
+
title: Richer pages
38
+
details: Markdown Tags, Glossary Tooltips and Reading Time add status badges, hover definitions and reading-time estimates.
39
+
link: /plugins/#pages
40
+
linkText: Page plugins
41
41
- icon:
42
-
light: /icons/book-light.svg
43
-
dark: /icons/book-dark.svg
42
+
light: /icons/folder-light.svg
43
+
dark: /icons/folder-dark.svg
44
44
width: 28
45
45
height: 28
46
-
title: Glossary Tooltips
47
-
details: Define a term once and every mention in your docs gets a hover definition.
48
-
link: /plugins/glossary
49
-
linkText: See the glossary plugin
50
-
- icon:
51
-
light: /icons/clock-light.svg
52
-
dark: /icons/clock-dark.svg
53
-
width: 28
54
-
height: 28
55
-
title: Reading Time
56
-
details: One line in a page gets an estimated reading time, computed at build time.
57
-
link: /plugins/reading-time-tag
58
-
linkText: See the reading-time plugin
59
-
- icon:
60
-
light: /icons/download-light.svg
61
-
dark: /icons/download-dark.svg
62
-
width: 28
63
-
height: 28
64
-
title: Downloads
65
-
details: Keep a .sql, .zip or .xlsx next to the page that links to it, and the link downloads the file.
66
-
link: /plugins/downloads
67
-
linkText: See the downloads plugin
46
+
title: Content where it lives
47
+
details: Downloads next to the page that links them, drafts left out with a .exclude file, and README.md index pages for VuePress migrations.
48
+
link: /plugins/#content
49
+
linkText: Content plugins
68
50
- icon:
69
51
light: /icons/escape-light.svg
70
52
dark: /icons/escape-dark.svg
71
53
width: 28
72
54
height: 28
73
-
title: HTML Escape
74
-
details: A stray Array<string> or {{ }} in your Markdown shows up as text instead of breaking the build.
75
-
link: /plugins/html-escape/
76
-
linkText: See the HTML Escape plugin
77
-
- icon:
78
-
light: /icons/link-light.svg
79
-
dark: /icons/link-dark.svg
80
-
width: 28
81
-
height: 28
82
-
title: Broken Links
83
-
details: A link to a page that doesn't exist shows up as text with a fix-it hint instead of failing the build.
84
-
link: /plugins/broken-links
85
-
linkText: See the Broken Links plugin
55
+
title: Builds that don't break
56
+
details: HTML Escape and Broken Links turn a stray Array<string> or a dead link into a fix-it hint instead of a failed build.
57
+
link: /plugins/#builds
58
+
linkText: Build plugins
86
59
- icon:
87
60
light: /icons/image-light.svg
88
61
dark: /icons/image-dark.svg
89
62
width: 28
90
63
height: 28
91
-
title: Image Optimization & Fallback
92
-
details: Smaller images in the build output, and a placeholder instead of a failed build when one goes missing.
93
-
link: /plugins/optimize-images
94
-
linkText: See the image plugins
64
+
title: Images handled
65
+
details: Optimize Images shrinks every image in the build output, and Image Fallback stands in for one that goes missing.
66
+
link: /plugins/#images
67
+
linkText: Image plugins
95
68
- icon:
96
69
light: /icons/terminal-light.svg
97
70
dark: /icons/terminal-dark.svg
@@ -109,23 +82,9 @@ features:
109
82
-**Want a tool for your terminal?** Pick one on the [apps page](/apps/). Each installs with one Homebrew command.
110
83
-**Building a site like this one?** Read [how this site works](/guide/how-this-site-works) and copy what is useful.
111
84
112
-
## Install the whole VitePress toolkit
113
-
114
-
```sh
115
-
npm install --save-dev \
116
-
@binarynoir/vitepress-auto-sidebar \
117
-
@binarynoir/vitepress-auto-navbar \
118
-
@binarynoir/vitepress-markdown-tags \
119
-
@binarynoir/vitepress-reading-time-tag \
120
-
@binarynoir/vitepress-downloads \
121
-
@binarynoir/vitepress-html-escape \
122
-
@binarynoir/vitepress-broken-links \
123
-
@binarynoir/vite-plugin-optimize-images \
124
-
@binarynoir/vite-plugin-image-fallback \
125
-
markdown-it-glossary
126
-
```
85
+
## Install the VitePress toolkit
127
86
128
-
Every plugin is optional and independent. Take one, or take them all. Each plugin's page shows how to register it, and the VitePress plugins need Node 22 or newer.
87
+
Every plugin is optional and independent: take one, or take them all. The [plugins overview](/plugins/#install-them-all) has the one-line install for the whole set, and each plugin's page shows how to register it. The VitePress plugins need Node 22 or newer.
This page is the live demo for [Exclude](./index.md). It is listed in this folder's `.exclude` file, so it is never built: if you are reading this on the site, the plugin is not working.
`@binarynoir/vitepress-exclude` keeps pages out of the build with a `.exclude` file in the folder that holds them. VitePress's own `srcExclude` is one list of globs in `config.mts`, far from the pages it hides. With this plugin, each folder says what to leave out, next to the files themselves.
12
+
13
+
```txt
14
+
docs/guide/
15
+
.exclude
16
+
index.md
17
+
draft.md
18
+
internal-notes.md
19
+
drafts/
20
+
```
21
+
22
+
```txt
23
+
# docs/guide/.exclude
24
+
draft.md
25
+
internal-*.md
26
+
drafts/
27
+
```
28
+
29
+
Those pages are not built, not in search and not in the sitemap. The files stay where they are.
30
+
31
+
## See it live
32
+
33
+
This page's folder has a [`draft.md`](https://github.com/binarynoir/binarynoir.github.io/blob/main/docs/plugins/exclude/draft.md) next to it, and an [`.exclude`](https://github.com/binarynoir/binarynoir.github.io/blob/main/docs/plugins/exclude/.exclude) file that lists it. The draft is in the repository, but it is not on this site: it is missing from the sidebar, from search and from the build.
34
+
35
+
[Auto Sidebar](/plugins/auto-sidebar) and [Auto Navbar](/plugins/auto-navbar) read the same `.exclude` files, so one line hides a page from the menus and keeps it out of the build.
One rule per line. Blank lines and lines starting with `#` are ignored. Rules are relative to the folder the `.exclude` file is in, and a `.exclude` file in the docs root works too.
|`excludeFilenames`|`[".exclude"]`| Filenames read in each folder. |
100
+
|`verbose`|`false`| Log each `.exclude` file, its rules and the globs it made. |
101
+
102
+
`withExclude(config, srcDir, options)` and `excludeSrc(srcDir, options)` take both. `excludeVitePlugin(options)` takes `excludeFilenames`; pass it the same list.
103
+
104
+
## Good to know
105
+
106
+
-**Live in `vitepress dev`.** Add, change or delete a `.exclude` file and the dev server restarts with the new rules. The rules are read when the config loads, so the plugin registers each `.exclude` file as part of the config.
107
+
-**Hidden folders are skipped.**`.vitepress`, `node_modules` and other folders whose names start with `.` are not searched. VitePress never builds pages from them.
108
+
-**Excluded is not secret.** An excluded file is not published, but it is still in your repository.
109
+
110
+
[Source and full README on GitHub](https://github.com/binarynoir/vitepress-exclude)
0 commit comments