My English is pool, so i will use Chinese to convey my original meaning with the help of translation software.
I used GitHub Page + Vuepress to build a static blog. I uploaded some files in the 'docs' folder, but they did not configure the routing information.I hope that the content will not appear in the search, because I don't want it to appear.
我使用了 Github Page + Vuepress 搭建一个静态博客,我在
docs文件夹中上传了一些文件,但是他们并未配置路由信息。我希望在搜索的时候不会出现这些内容,因为我不希望这些内容展现出来。
In fact, when I search, these pages that I have not configured routing information are also displayed, and even can be accessed.
事实上,当我搜索的时候,这些我未配置路由信息的页面也展示了出来,而且竟然能访问。
Other relevant information
npx vuepress info in my VuePress project:Just as the doc said: it automatically builds a simple search index from the title, h2 and h3 headers from all the pages. no matter whether you config it in the route. I think it is by proposing..
Obviously your 'extra' files have a header like h2, h3...
So why not push your 'extra file' to another branch? not the building one.
据我了解文按照档里写的vuepress的搜索功能会搜索所有含有 h2, h3的文件。我觉的应该是这样的设计的。 如果不想被搜索的话 为啥不把这些‘多余’的文件push到其他的分支?而不是你用来build的github page的分支
Thanks for your suggestion, actually i try to use .gitignore file to untrack some .md file, and them can't be found on my github repository, But it seems that in the process of build, vuepress has already indexed these files and generated some .js files.
I describe my usage scenarios and may help you understand my problem. I use Typora (a markdown editing software) to write my notes, some of which are not suitable for public posting, but For the sake of convenience, I also hope that they can be managed in a unified folder, so I encountered the problem raised earlier.
感谢你的建议,事实上我使用.gitignore文件进行过尝试,把一些不想提交的文件截留了下来,这些.md文件并不能在我的 Github 仓库上找到,但似乎在build的过程中,vuepress就已经将这些文件建立索引,并生成了一些.js文件。
我描述下我的使用场景,可能会有助于您理解我的问题,我使用Typora(一个markdown编辑软件)来编写我的笔记,其中有一些私密内容并不适合公开发表,但为了方便我又希望能在一个统一的文件夹下对它们进行管理,所以遇到了前面提出的问题。
Hi @learningNicolas ,
I believe that patterns is what you are looking for. (Simply click on the link before doesn't seem to nav to the correct location, you can find it under Config Reference > Basic Config > patterns)
For example, if your docs' folder structure is:
├── docs
│ ├── .vuepress
│ ├── private
│ ├── README.md
│ ├── guide
The config.js would be:
patterns: ['**/*.md', '**/*.vue', '!private'],
Then all of your docs in the private folder won't be built.
Refers:
Thank you very much, @ludanxer
It works! 👍 👍
also thanks for your help @haochenli
As @ludanxer said, pattern is what you're looking for. Thanks !
Most helpful comment
Hi @learningNicolas ,
I believe that patterns is what you are looking for. (Simply click on the link before doesn't seem to nav to the correct location, you can find it under
Config Reference > Basic Config > patterns)For example, if your docs' folder structure is:
The config.js would be:
Then all of your docs in the private folder won't be built.
Refers: