Skip to content

Commit

Permalink
chore(v2): prettier fixes (#4005)
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber authored Jan 6, 2021
1 parent 3ebe9ca commit c4cbe8e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}\"",
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-sitemap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions packages/docusaurus-plugin-sitemap/src/createSitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
}),
Expand Down

0 comments on commit c4cbe8e

Please sign in to comment.