Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@easyops-cn/docusaurus-search-local

Package Overview
Dependencies
Maintainers
1
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@easyops-cn/docusaurus-search-local - npm Package Compare versions

Comparing version 0.7.1 to 0.8.0

18

CHANGELOG.md

@@ -5,2 +5,20 @@ # Changelog

## [0.8.0](https://github.com/easyops-cn/docusaurus-search-local/compare/v0.6.0...v0.8.0) (2020-10-21)
### ⚠ BREAKING CHANGES
- renamed `docsBasePath` and `blogBasePath` to `docsRouteBasePath` and `blogRouteBasePath`, to keep them the same as cmfcmf/docusaurus-search-local.
- users need to install `nodejieba` if using language of zh.
### Features
- make nodejieba as a peer dependency ([956b3b5](https://github.com/easyops-cn/docusaurus-search-local/commit/956b3b563c8662c8d8cb867ef174548221865754))
- rename option of \*BasePath ([978846a](https://github.com/easyops-cn/docusaurus-search-local/commit/978846a13c303c321b154eca8847e2eab33baa5b))
### Bug Fixes
- fix nodejieba is still required ([78e4d67](https://github.com/easyops-cn/docusaurus-search-local/commit/78e4d677a5bccb0ae3aff0fc16c43ac031b911a3))
- fix styles on mobile screen ([1cc6850](https://github.com/easyops-cn/docusaurus-search-local/commit/1cc6850402cd7eced043736d4b826f97bd2498f0))
- languages of non-en require stemmer support ([bc8e451](https://github.com/easyops-cn/docusaurus-search-local/commit/bc8e451cfd65024d48f08c481f2cd4850c2d0dbd))
### [0.7.1](https://github.com/easyops-cn/docusaurus-search-local/compare/v0.7.0...v0.7.1) (2020-10-21)

@@ -7,0 +25,0 @@

10

dist/server/server/utils/processDocInfos.js

@@ -6,3 +6,3 @@ "use strict";

const path_1 = tslib_1.__importDefault(require("path"));
function processDocInfos({ routesPaths, outDir, baseUrl }, { indexDocs, indexBlog, indexPages, docsBasePath, blogBasePath, }) {
function processDocInfos({ routesPaths, outDir, baseUrl }, { indexDocs, indexBlog, indexPages, docsRouteBasePath, blogRouteBasePath, }) {
return routesPaths

@@ -18,5 +18,5 @@ .map((url) => {

}
if (indexBlog && urlMatchesPrefix(route, blogBasePath)) {
if (route === blogBasePath ||
urlMatchesPrefix(route, `${blogBasePath}/tags`)) {
if (indexBlog && urlMatchesPrefix(route, blogRouteBasePath)) {
if (route === blogRouteBasePath ||
urlMatchesPrefix(route, `${blogRouteBasePath}/tags`)) {
// Do not index list of blog posts and tags filter pages

@@ -27,3 +27,3 @@ return;

}
if (indexDocs && urlMatchesPrefix(route, docsBasePath)) {
if (indexDocs && urlMatchesPrefix(route, docsRouteBasePath)) {
return { route, url, type: "docs" };

@@ -30,0 +30,0 @@ }

@@ -11,22 +11,14 @@ "use strict";

indexPages: false,
docsBasePath: "/docs",
blogBasePath: "/blog",
docsRouteBasePath: "/docs",
blogRouteBasePath: "/blog",
language: "en",
hashed: false,
docsDir: "docs",
blogDir: "blog",
removeDefaultStopWordFilter: false,
}, options);
config.docsBasePath = config.docsBasePath.replace(/^\//, "");
config.blogBasePath = config.blogBasePath.replace(/^\//, "");
if (config.docsDir) {
config.docsDir = path_1.default.resolve(siteDir, config.docsDir);
}
else {
config.docsDir = path_1.default.resolve(siteDir, config.docsBasePath);
}
if (config.blogDir) {
config.blogDir = path_1.default.resolve(siteDir, config.blogDir);
}
else {
config.blogDir = path_1.default.resolve(siteDir, config.blogBasePath);
}
config.docsRouteBasePath = config.docsRouteBasePath.replace(/^\//, "");
config.blogRouteBasePath = config.blogRouteBasePath.replace(/^\//, "");
config.docsDir = path_1.default.resolve(siteDir, config.docsDir);
config.blogDir = path_1.default.resolve(siteDir, config.blogDir);
if (!Array.isArray(config.language)) {

@@ -33,0 +25,0 @@ config.language = [config.language];

{
"name": "@easyops-cn/docusaurus-search-local",
"version": "0.7.1",
"version": "0.8.0",
"scripts": {

@@ -5,0 +5,0 @@ "test": "jest",

@@ -72,8 +72,8 @@ # @easyops-cn/docusaurus-search-local

| indexPages | boolean | `false` | Whether to index pages. |
| docsBasePath | string | `"/docs"` | Base route path of docs. Slash at beginning is not required. |
| blogBasePath | string | `"/blog"` | Base route path of blog. Slash at beginning is not required. |
| docsRouteBasePath | string | `"/docs"` | Base route path of docs. Slash at beginning is not required. |
| blogRouteBasePath | string | `"/blog"` | Base route path of blog. Slash at beginning is not required. |
| language | string \| string[] | `"en"` | All [lunr-languages](https://github.com/MihaiValentin/lunr-languages) supported languages, + `zh` 🔥. |
| hashed | boolean | `false` | Whether to add a hashed query when fetching index (based on the content hash of all `*.md`) |
| docsDir | string | - | The dir of docs to get the content hash, it's relative to the siteDir of Docusaurus, defaults to `docsBasePath`. |
| blogDir | string | - | Just like the `docsDir` but applied to blog. |
| docsDir | string | `"docs"` | The dir of docs to get the content hash, it's relative to the dir of your project. |
| blogDir | string | `"blog"` | Just like the `docsDir` but applied to blog. |
| removeDefaultStopWordFilter | boolean | `false` | Sometimes people (E.g., us) want to keep the English stop words as indexed, since they maybe are relevant in programming docs. |

@@ -80,0 +80,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc