Page generation with docusaurus - docusaurus

I wonder if it is possible to generate static pages from data(e.g. JSON) in docusaurus. Is there any open source project made with docusaurus that does same thing?

Related

Is there a way to use Docusaurus just for the /docs directory?

I have an existing website, and just want to use docusaurus to manage the /docs directory (e.g. published as a static site into there). When I follow all the documentation it creates both the docs directory and separate website directory, how can I just have it render /docs when testing locally and only publish that sub-directory when doing a build of the static site?
found the answer in the docs 🤣
https://v2.docusaurus.io/docs/docs-introduction#docs-only-mode

Does Docusaurus support renaming the 'docs' output folder?

I am currently evaluating using Docusaurus to generate a static web site. The site itself is not documentation focused, in fact, the site is not even computer or technology related. But as a techie myself, I want a CI and Git-powered publishing strategy for this web site.
Docusaurus uses Markdown for its page content (outside of custom React-based pages). However, when these Markdown pages are built, they are all placed in a top-level folder in the static site called docs. This folder naming doesn't really fit with the web site I want to produce.
There is a configuration setting for customDocsPath but this only changes where the build looks for Markdown files, not the output path in the created site content.
I'm not a React developer, but aside from hacking away at the JavaScript in the build engine to search/replace instances of docs, is there a better way to do this?
In docusaurus 2 changing main docs folder is quite straightforward:
rename docs/ to whatever/
add following to docusaurus.config.js
presets: [
[
'#docusaurus/preset-classic', // should be already there
{
docs: {
path: 'whatever',
routeBasePath: 'whatever',
// ...
We don't currently support routes other than /docs - yet. There is a pull request that started back in August, but has been recently resurrected again. The PR is being reviewed and updated to allow more customizable routes.
As of Docusaurus 1.6, this is now implemented. The pull request has been merged.
More details about this are found in the site configuration.
Simply add the following to the siteConfig section in siteConfig.js:
const siteConfig = {
title: 'My Awesome Site',
docsUrl: '',
// ...
};

What's the difference between static and templates folder under resources in a springboot & thymeleaf project?

I'm new to thymeleaf and springboot.
I create a springboot project with thymeleaf in IntelliJ IDEA with "New Project"->"Spring Initalizr".
Then I get a project whose structure looks like below.
demo
|+-src/main
| +-java
| +-resources
| static
| templates
| application.properties
|-pom.xml
The question is what should I put in static and templates under resources? What's the difference between them?
I guess the .html files that have thymeleaf attributes should be put in templates. How about static html, css and js?
Thanks.
templates folder is a place where you put all the thymeleaf templates. It is a default directory (by default spring will look inside for any templates).
static folder is used for serving web static content, all the css, js, html etc. (also default folder search by spring)
http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-web-applications.html#boot-features-spring-mvc-static-content
These folders are a way of organizing your files. These static and templates folders have special meaning in a case that it know has become common understanding for organizing your frontend files such as css, js, html etc among developers. In my understanding we should place files like css, js, images that supports your web pages which are not going to change through out your application at runtime. For eg: your design is not going to change which is done in your css file. In templates we should place html files. If you add both html and other files together, it becomes hard to organize your files.

Testing WebOdf Collaborative editor on localServer

I am trying to add document editor support in my website. I found Opensource WebODF and tried to test it on my local server. The git repository ReadMe gives instructions on how to add Odf viewer support.
I was able to test the localeditor. Can some one explain how to setup the collaborative editor on local server.
The brief steps are as follows :
Download the Wodo-TextEditor library from here.(It has the webodf library included as dependency).Put the library in your server or root directry of application,so you can access it from html page.
Then include the editor scripts in your html as done in sample html below.
Make sure you have a odt document on your server or you can use welcome.odt sample document included in Wodo-TextEditor library.
And load the editor as in sample or you can just pick the whole html as it is ,just make sure all your include paths are valid.
And that should be it !
You can refer this answer by me to setup a local webodf editor for your web application.
For simply using webodf editor you can use this html page sample .Make sure you have a odt document on your server directory which can be loaded in the editor.

How to include jQuery from Global Libraries into my page in Intellij IDEA?

I cannot understand what is the advantages of having jQuery in "Global Libraries" list?
Can I somehow include any javascript Global Library into my html page or should I just copy/paste content of this library to new file in my project and include it manually to html page?
Global libraries are needed for code completion in the web applications when there are no explicit includes in all the pages or when you are editing JS files that have access to other libraries, but there is no way to specify it directly in the script.
Of course you need to have a copy of the library in your project or reference its URL in HTML pages.