This is a fork of the facebook/docusaurus.git project, with several enhancements for blogs with historical content.
The updated code is in the development
branch, while the original code remains in the main
branch.
The changes, mainly enhancements, are enabled via configuration options, and the defaults should not affect the functionality of the standard Docusaurus project.
The enhancements are listed below.
For blogs with multiple authors, it is useful to view the pages contributed by each author.
Similarly to the Tags grouping pages, pages to group posts by authors can now be generated.
Links to authors are also added at the bottom of the posts, after the links to tags:
A new configuration option generateAuthorsPages
was added; when set to true, the authors pages are generated as blog/authors
and blog/authors/${name}
.
Note: Docusaurus allows to define authors identified by a picture, without having to enter the name; these nameless authors are filtered out and not indexed in the Authors pages.
In some cases, for example sites with research data, the content of the posts is expected to be updated from time to time, as new data is discovered.
To help users identify the updated content, it is useful to know the last updated time and provide a way to order post by it.
The mechanism of computing the last updated time is based on the latest git commit time, similarly to the mechanism used for docs; it is enabled by the same configuration options, showLastUpdateTime
and showLastUpdateAuthor
.
When enabled, the last update time is displayed below the post and also used when sorting the posts in the feed files.
When posts are edited and the retrieving the date of the last update is enabled, it also makes sense to show the updated posts in the top of the sidebar list.
A new configuration option sortSidebarByLastUpdate
was added; when set to true, the sidebar list is sorted by the last update time, when available.
In the Archive page, when listing the the post titles grouped by years, there is not need to show the year again, since it is redundant.
For aesthetic reasons, a new configuration option hidePostYearInArchive
was added; when set to true, the date format is adjusted to no longer show the year.
The common use case for blogs is to document recent events; in other words, the post date and the event date are more or less the same.
For blogs documenting historical events, the post date remains in the present, as for regular posts, but the event date is in the past, and should be entered as a separate frontMatter string property.
Since some historical events do not have an exact date, this property can be incomplete, without day or even without month, for example:
event_date: '1994'
event_date: '1994-11'
event_date: '1994-11-07'
For events that lasted more than one day, it is possible to also define the end date, as a string with the similar incomplete syntax:
event_end_date: '1995'
event_end_date: '1994-12'
event_end_date: '1994-11-08'
To enable this feature, a new configuration option sortPostsByEventDate
was added; when set to true, the event dates are parsed and used when sorting the posts in the Archive page, so the years of past events are located at the end.
In Docusaurus, the URL parts used to compose the pages paths are configurable via options like routeBasePath
, tagsBasePath
, etc, but in the path used for multi-page lists, a part of the URL is hard-coded as page
.
For consistency reasons, a new configuration option was added, pageBasePath
, allowing to also configure this path, a feature useful for example when all paths are translated to local languages.
The trailingSlash
configuration is available to customize the presence/absence of a trailing slash at the end of URLs; unfortunately this setting does not apply to the links generated in the feed files, and tools like Algolia that use the files may behave unusual.
Thus, the applyTrailingSlash
function is called to conditionally adjust the URLs generated in the feed files.
The original README content follows:
Docusaurus is a project for building, deploying, and maintaining open source project websites easily.
Short on time? Check out our 5-minute tutorial ⏱️!
Tip: use docusaurus.new to test Docusaurus immediately in a playground.
- Simple to Start
Docusaurus is built in a way so that it can get running in as little time as possible. We've built Docusaurus to handle the website build process so you can focus on your project.
- Localizable
Docusaurus ships with localization support via CrowdIn. Empower and grow your international community by translating your documentation.
- Customizable
While Docusaurus ships with the key pages and sections you need to get started, including a home page, a docs section, a blog, and additional support pages, it is also customizable as well to ensure you have a site that is uniquely yours.
Use the initialization CLI to create your site:
npm init docusaurus@latest
Read the docs for any further information.
We've released Docusaurus because it helps us better scale and supports the many OSS projects at Facebook. We hope that other organizations can benefit from the project. We are thankful for any contributions from the community.
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.
Read our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Docusaurus.
To help you get your feet wet and get you familiar with our contribution process, we have a list of beginner-friendly bugs that might contain smaller issues to tackle first. This is a great place to get started.
We have a few channels for contact:
- Discord:
#general
for those using Docusaurus.#contributors
for those wanting to contribute to the Docusaurus core.
- @docusaurus on Twitter
- GitHub Issues
This project exists thanks to all the people who contribute. [Contribute].
Thank you to all our backers! 🙏 Become a backer
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. Become a sponsor
Docusaurus is MIT licensed.
The Docusaurus documentation (e.g., .md
files in the /docs
folder) is Creative Commons licensed.
BrowserStack supports us with free access for open source.
Rocket Validator helps us find HTML markup or accessibility issues.