glob - 试图从 metalsmith-simple-search 中排除特定文件
问题描述
我正在尝试使用 match 属性从 metalsmith-simple-search 中排除 2 个特定页面。例子:
.use(simpleSearch({
"destinationJs": "./assets/js/simple-search.min.js",
"destinationJson": "./assets/js/search.json",
"index": {
"title": true,
"keywords": true,
"description": true,
"contents": "html"
},
//"match": "**/*.{htm,html}",
"match": "!(error-404|search)**/*.{htm,html}",
"matchOptions": {},
"skipSearchJs": false
}))
默认"**/*.{htm,html}"
匹配网站上的每个页面,但我不想包含自定义 404 页面或搜索页面本身。
// example file directory
index.html // homepage should include
error-404/index.html // exclude
our-services/index.html // include
our-services/business/index.html // include
search/index.html // exclude
我的修改"!(error-404|search)**/*.{htm,html}"
删除了不需要的页面,但也删除了网站的主页。我所有恢复主页的尝试都没有添加错误 404 和搜索,但都失败了。
有没有人足够熟悉这里的模式如何匹配来帮助我?
解决方案
推荐阅读
- unit-testing - 在 Golang 中编组/解组时间对象意外失败
- r - 双 y 轴 - 右 y 轴的标签和背景网格线
- php - Laravel 5.6 API 资源集合 - 未获取条件关系
- javascript - 页面加载时在元素上方禁用 mouseenter
- sql - SQL:使用不同的子句获取列表两次
- python - 如何处理列表然后清除列表,同时将数据解压缩到数据帧以释放内存?
- perl - 在 sunOS 中使用 find 命令比较两个目录中的所有文件
- javascript - 如何在两种情况下有效地调用 setState - 成功和错误?
- php - Oracle SQL 和 strtotime - 更新记录
- android - 重新启动我的应用程序时,firebase 替换了我的数据