Comments (4)
+1
We got this reported to the main Docusaurus repo too: facebook/docusaurus#5267
If that helps, here's the logic we use to emit HTML files:
https://github.com/slorber/static-site-generator-webpack-plugin/blob/master/index.js#L167
function pathToAssetName(outputPath, preferFoldersOutput) {
var outputFileName = outputPath.replace(/^(\/|\\)/, ''); // Remove leading slashes for webpack-dev-server
// Paths ending with .html are left untouched
if (/\.(html?)$/i.test(outputFileName)) {
return outputFileName;
}
// Legacy retro-compatible behavior
if (typeof preferFoldersOutput === 'undefined') {
return path.join(outputFileName, 'index.html');
}
// New behavior: we can say if we prefer file/folder output
// Useful resource: https://github.com/slorber/trailing-slash-guide
if ( outputPath === "" || outputPath.endsWith("/") || preferFoldersOutput ) {
return path.join(outputFileName, 'index.html');
}
else {
return `${outputFileName}.html`;
}
}
You can consider preferFoldersOutput === siteConfig.trailingSlash
Eventually, it may be safer (probably also less performant :s) to test for the file to exist here: https://github.com/easyops-cn/docusaurus-search-local/blob/a7b1b3a98bda9c72859ebc762efa5eb874dbd7e9/src/server/utils/processDocInfos.ts
Not used to this plugin but I can help if needed.
BTW, I'd like to have a docusaurus-community org (still waiting for FB approval), and move existing popular community plugins to it so that they can be more easily maintained, let me know if you would be ok with that. Having admin access on Github/NPM would allow me to keep the code in sync with Docusaurus core and ensure there's no such issues (or at least I'll be able to fix them rapidly)
from docusaurus-search-local.
@slorber Thanks, that seems would help a lot, I will look into it later.
BTW, I'd like to have a docusaurus-community org (still waiting for FB approval), and move existing popular community plugins to it so that they can be more easily maintained, let me know if you would be ok with that. Having admin access on Github/NPM would allow me to keep the code in sync with Docusaurus core and ensure there's no such issues (or at least I'll be able to fix them rapidly)
This sounds good, and I am personally ok with that. Although this plugin is maintained by myself, but the ownership of this project belongs to my company, so it needs approval. Let me know when the docusaurus-community gets progressed, I'd like to help.
from docusaurus-search-local.
@sdirix try "@easyops-cn/docusaurus-search-local": "^0.19.0"
from docusaurus-search-local.
Thanks :) will try to get this org setup but it's not my decision and it may take some additional time. Will ping plugin authors once we have it
from docusaurus-search-local.
Related Issues (20)
- Question: is it possible to ignore a folder? HOT 2
- [Question] Independent extract search feature into another website
- pnpm build: Docusaurus server-side rendering could not render static page with path
- How to solve the type checking error in vscode? HOT 2
- I'm not able to swizzle the Search component. HOT 1
- Option to use custom icon for search HOT 3
- build fail when add slug: filename.html
- Search icon doesn't change color between light/dark mode HOT 1
- Allow Search to open details html tag
- Japanese search problem
- Add theme option to set the search bar placeholder message
- Docusaurus `tags` make search results incorrect and unreadable
- [Bug] - CI Fails when Used with Docusaurus 2.4.0
- `blogDir` allows `[]`
- No index entry generated for custom categories specified in sidebars.js
- Should search find documents based on front-matter keywords? HOT 1
- Support for Docusaurus 3.0 HOT 6
- Add support for newer languages
- Enable prebuild indexing
- HTML indexes, but not deep linking
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docusaurus-search-local.