Skip to content

Commit

Permalink
chore(typos): fix typos (#102)
Browse files Browse the repository at this point in the history
Co-authored-by: stavares843 <[email protected]>
  • Loading branch information
stavares843 and stavares843 authored Dec 21, 2022
1 parent 5cffe3b commit c32272e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .vitepress/theme/components/Tweet.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
A simple wrapper for embeded Tweet
A simple wrapper for embedded Tweet

Usage:

Expand Down
6 changes: 3 additions & 3 deletions .vitepress/theme/support/sideBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
isArray,
ensureSlash,
ensureStartingSlash,
removeExtention,
removeExtension,
} from '../utils'

export function isSideBarConfig(
Expand Down Expand Up @@ -33,7 +33,7 @@ export function getSideBarConfig(

// get the very first segment of the path to compare with nulti sidebar keys
// and make sure it's surrounded by slash
path = removeExtention(path)
path = removeExtension(path)
path = ensureStartingSlash(path).split('/')[1] || '/'
path = ensureSlash(path)

Expand All @@ -57,7 +57,7 @@ export function getFlatSideBarLinks(
): DefaultTheme.SideBarLink[] {
return sidebar.reduce<DefaultTheme.SideBarLink[]>((links, item) => {
if (item.link)
links.push({ text: item.text, link: removeExtention(item.link) })
links.push({ text: item.text, link: removeExtension(item.link) })

if (isSideBarGroup(item))
links = [...links, ...getFlatSideBarLinks(item.children)]
Expand Down
4 changes: 2 additions & 2 deletions .vitepress/theme/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ export function ensureEndingSlash(path: string): string {
}

/**
* Remove `.md` or `.html` extention from the given path. It also converts
* Remove `.md` or `.html` extension from the given path. It also converts
* `index` to slush.
*/
export function removeExtention(path: string): string {
export function removeExtension(path: string): string {
return path.replace(/(index)?(\.(md|html))?$/, '') || '/'
}

0 comments on commit c32272e

Please sign in to comment.