-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update static site docs #2323
Update static site docs #2323
Conversation
│ └── getting-started.md | ||
└── index.html | ||
└── _docs | ||
└── getting-started.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add back the index.html
file, for consistency with the previous examples?
└── _docs | ||
└── getting-started.md | ||
``` | ||
To reference the asset in a page, one need to create link relative to the `_assets` directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To reference the asset in a page, one need to create link relative to the `_assets` directory | |
To reference the asset on a page, one needs to create a link relative to the `_assets` directory |
``` | ||
|
||
## Sidebar | ||
|
||
Scaladoc by default uses layout of files in `docs` directory to create table of content. There is also ability to override it by providing a `sidebar.yml` file in the site root: | ||
Scaladoc by default uses layout of files in `_docs` directory to render static site. There is also ability to override it by providing a `sidebar.yml` file in the site root. The YAML configuration file describes the structure of rendered static site and the table of content: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scaladoc by default uses layout of files in `_docs` directory to render static site. There is also ability to override it by providing a `sidebar.yml` file in the site root. The YAML configuration file describes the structure of rendered static site and the table of content: | |
By default, Scaladoc uses the layout of the files in the `_docs` directory to render the static site. There is also the ability to override it by providing a `sidebar.yml` file in the site root directory. The YAML configuration file describes the structure of the rendered static site and the table of content: |
hidden: false | ||
``` | ||
The `rootIndex` property defines the root page of a static site: `_docs/index.html` | ||
The `pages` key is mandatory. Its value should be array of `subsection` or `page`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The `pages` key is mandatory. Its value should be array of `subsection` or `page`. | |
The `pages` key is mandatory. Its value should be an array of `subsection` or `page`. |
- `title` - Optional string - A default title of the subsection. | ||
Front-matter titles have higher priorities. | ||
- `index` - Optional string - A path to index page of a subsection. | ||
- `directory` - Optional string - A name of the directory that will contain the subsection. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `directory` - Optional string - A name of the directory that will contain the subsection. | |
- `directory` - Optional string - A name of the directory that will contain the subsection in the generated site. |
- `page` - String - A path to the page | ||
- `hidden` - Optional boolean - A flag that indicates whether the page should be visible in navigation. By default, it is set to `false`. | ||
|
||
**Note**: All paths in YAML configuration file are relative to `<static-root>/_docs`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**Note**: All paths in YAML configuration file are relative to `<static-root>/_docs`. | |
**Note**: All the paths in the YAML configuration file are relative to `<static-root>/_docs`. |
``` | ||
It results in static site containing documents as well as blog. It also contains custom layouts and assets. The structure of rendered documentation can be based on file system but it can also be overriden by YAML configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It results in static site containing documents as well as blog. It also contains custom layouts and assets. The structure of rendered documentation can be based on file system but it can also be overriden by YAML configuration. | |
It results in a static site containing documents as well as a blog. It also contains custom layouts and assets. The structure of the rendered documentation can be based on the file system but it can also be overridden by YAML configuration. |
|
||
``` | ||
This is my blog post. Here is the image ![](my_image.png) and here is my [pdf](my_file.pdf)``` | ||
Using YAML configuration file, we can define how the source directory structure should be transformed in target directory structure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using YAML configuration file, we can define how the source directory structure should be transformed in target directory structure. | |
Using the YAML configuration file, we can define how the source directory structure should be transformed into an output directory structure. |
This is my blog post. Here is the image ![](my_image.png) and here is my [pdf](my_file.pdf)``` | ||
Using YAML configuration file, we can define how the source directory structure should be transformed in target directory structure. | ||
|
||
Take a look at following subsection definition: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look at following subsection definition: | |
Take a look at the following subsection definition: |
- page: foo/page2.md | ||
``` | ||
This subsection shows the ability of YAML configuration to map the directory structure. | ||
Even though the index page and all defined children are in different directories, they will be rendered in `custom-directory`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though the index page and all defined children are in different directories, they will be rendered in `custom-directory`. | |
Even though the index page and all defined children are in different directories, they will be rendered in `custom-directory`. The source page `abc/index.html` will generate a page `custom-directory/index.html`, the source page `abc2/page1.md` will generate a page `custom-directory/page1.html`, and the source page `foo/page2.md` will generate a page `custom-directory/page2.html`. |
Is this ready for review? |
57dbc50
to
9097144
Compare
Now it's ready :) |
I see several comments/suggestions not taken into account. Could you please address them? |
No description provided.