Design System Publisher Configuration
Configuration Options
Environment variables override the JSON property configuration. The website needs to be rebuilt, or restarted in development mode, in order for changes to the configuration variables to take effect.
All "path" options are relative to the content project folder.
ENV variable JSON property |
Description | Default value |
---|---|---|
| Path to configuration JSON files. |
|
| Path to theme customizations. See Site Customization. |
|
| Path to the AsciiDoc articles. |
|
| Path to the dynamically imported custom element examples |
|
| The site title. Used as the main prefix in the page |
|
| The root URL of the site (i.e. the domain without a path), for example |
|
| The root path where the website is hosted. For example, if you deploy the site to https://example.com/docs, the path prefix should be |
|
| The host name of the Vaadin project. Used for request proxying. |
|
| URL prefix from which JavaScript examples are included. |
|
| Prefix used for Vaadin Fusion endpoints. Effectively only replaces global |
|
| An absolute URL to a JSON file that defines the available versions of the documentation. See an example later on this page. |
|
| A JSON object defining the available documentation versions. See an example later on this page. |
|
| If |
|
You can prefix the environment variable names with DOCS_
(e.g., DOCS_TITLE
) if you need to avoid conflicts with other systems that use the same variable names.
The VERSIONS
variable is an exception, as it expects a JSON value, and providing that as a string through the command line would be verbose. For example:
[
{
"title": "Vaadin 23",
"shortTitle": "V23",
"url": "/docs/latest"
},
{
"title": "Vaadin 22",
"shortTitle": "V22",
"url": "/docs/v22"
},
]
The "title"
value is shown in the version drop-down, and the "shortTitle"
value, if provided, is shown as the drop-down button value when that version is selected.
Configuration JSON File
The configuration options with a JSON property can be overridden with a configuration file. The default configuration is the following:
{
"articlesPath": "articles",
"themePath": "dspublisher/theme",
"examplesImportPath": "frontend/demo",
"examplesIncludeUrlPrefix": "/vaadin/web-component/",
"vaadinConnectPrefix": "/connect",
"proxyVaadinHostname": "localhost",
"pathPrefix": "/",
"versionsUrl": "",
"versions": "",
"siteUrl": "",
"title": "Docs"
}
Create a default.json
file in the content project, in the folder defined by CONFIG_PATH
variable (dspublisher/config
by default), and override the properties you need. You don’t need to repeat the default values.
You can also define a production.json
configuration file in the same folder, to use a different configuration for your production build.
With the configuration files in place, you can use the npm run dspublisher:start
or npm run dspublisher:build
commands without extra command-line parameters.