mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-01 19:27:48 +02:00
chore(v2): prettier fixes (#4005)
This commit is contained in:
parent
3ebe9cab68
commit
c4cbe8ec72
3 changed files with 6 additions and 4 deletions
|
@ -38,8 +38,8 @@
|
|||
"canary:publish": "yarn lerna publish from-package --dist-tag canary --yes --no-verify-access",
|
||||
"changelog": "lerna-changelog",
|
||||
"postinstall": "yarn lock:update && yarn build:packages",
|
||||
"prettier": "prettier --config .prettierrc --write \"**/*.{js,ts}\"",
|
||||
"prettier:diff": "prettier --config .prettierrc --list-different \"**/*.{js,ts}\"",
|
||||
"prettier": "prettier --config .prettierrc --write \"**/*.{js,jsx,ts,tsx}\"",
|
||||
"prettier:diff": "prettier --config .prettierrc --list-different \"**/*.{js,jsx,ts,tsx}\"",
|
||||
"prettier-docs": "prettier --config .prettierrc --write \"**/*.md\"",
|
||||
"lint": "yarn lint:js && yarn lint:style",
|
||||
"lint:js": "eslint --cache \"**/*.{js,jsx,ts,tsx}\"",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"dependencies": {
|
||||
"@docusaurus/core": "2.0.0-alpha.70",
|
||||
"@docusaurus/types": "2.0.0-alpha.70",
|
||||
"@docusaurus/utils": "2.0.0-alpha.70",
|
||||
"fs-extra": "^9.0.1",
|
||||
"joi": "^17.2.1",
|
||||
"sitemap": "^3.2.2"
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
import sitemap, {Sitemap, SitemapItemOptions} from 'sitemap';
|
||||
import {PluginOptions} from './types';
|
||||
import {DocusaurusConfig} from '@docusaurus/types';
|
||||
import {addTrailingSlash} from '@docusaurus/utils';
|
||||
|
||||
export default function createSitemap(
|
||||
siteConfig: DocusaurusConfig,
|
||||
|
@ -23,8 +24,8 @@ export default function createSitemap(
|
|||
const urls = routesPaths
|
||||
.filter((route) => !route.endsWith('404.html'))
|
||||
.map(
|
||||
(routesPath): SitemapItemOptions => ({
|
||||
url: `${routesPath}${trailingSlash && !routesPath.endsWith('/') ? '/' : ''}`,
|
||||
(routePath): SitemapItemOptions => ({
|
||||
url: trailingSlash ? addTrailingSlash(routePath) : routePath,
|
||||
changefreq,
|
||||
priority,
|
||||
}),
|
||||
|
|
Loading…
Add table
Reference in a new issue