Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
quadratz committed Dec 11, 2023
1 parent a781ea8 commit bce56d1
Show file tree
Hide file tree
Showing 21 changed files with 54 additions and 6,088 deletions.
2 changes: 1 addition & 1 deletion site/docs/.vitepress/components/NotFound.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref, onMounted } from "vue"
import { withBase, useData } from "vitepress"
import { useLangs } from "../deps/langs"
import { useLangs } from "../deps/langs.js"
const { site, theme } = useData()
const { localeLinks } = useLangs({ removeCurrent: false })
Expand Down
6 changes: 3 additions & 3 deletions site/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from "vitepress";
import * as locale from "./configs/locales";
import { markdown } from "./plugins";
import { algolia } from "./configs/algolia";
import * as locale from "./configs/locales/index.js";
import { markdown } from "./plugins/index.js";
import { algolia } from "./configs/algolia/index.js";
import plaintext from "./shared/syntaxes/plaintext.tmLanguage.json";

export default defineConfig({
Expand Down
2 changes: 1 addition & 1 deletion site/docs/.vitepress/configs/algolia/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { DefaultTheme } from "vitepress";
import * as locale from "../locales";
import * as locale from "../locales/index.js";

export const algolia: DefaultTheme.Config["search"] = {
provider: "algolia",
Expand Down
4 changes: 2 additions & 2 deletions site/docs/.vitepress/configs/locales/en.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { DocSearchProps } from "node_modules/vitepress/types/docsearch";
import type { DocSearchProps } from "node_modules/vitepress/types/docsearch.js";
import type { LocaleConfig } from "vitepress";
import { social } from "../../shared/vars";
import { social } from "../../shared/vars.js";

const learnGuide = {
text: "Guide",
Expand Down
4 changes: 2 additions & 2 deletions site/docs/.vitepress/configs/locales/es.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { DocSearchProps } from "node_modules/vitepress/types/docsearch";
import type { DocSearchProps } from "node_modules/vitepress/types/docsearch.js";
import type { LocaleConfig } from "vitepress";
import { social } from "../../shared/vars";
import { social } from "../../shared/vars.js";

const learnGuide = {
text: "Guía",
Expand Down
4 changes: 2 additions & 2 deletions site/docs/.vitepress/configs/locales/id.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { DocSearchProps } from "node_modules/vitepress/types/docsearch";
import type { DocSearchProps } from "node_modules/vitepress/types/docsearch.js";
import type { LocaleConfig } from "vitepress";
import { social } from "../../shared/vars";
import { social } from "../../shared/vars.js";

const learnGuide = {
text: "Panduan",
Expand Down
10 changes: 5 additions & 5 deletions site/docs/.vitepress/configs/locales/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { notFoundEn, searchEn, siteEn } from "./en";
export { notFoundEs, searchEs, siteEs } from "./es";
export { notFoundId, searchId, siteId } from "./id";
export { notFoundUk, searchUk, siteUk } from "./uk";
export { notFoundZh, searchZh, siteZh } from "./zh";
export { searchEn, siteEn } from "./en.js";
export { searchEs, siteEs } from "./es.js";
export { searchId, siteId } from "./id.js";
export { searchUk, siteUk } from "./uk.js";
export { searchZh, siteZh } from "./zh.js";
10 changes: 0 additions & 10 deletions site/docs/.vitepress/configs/locales/main.ts

This file was deleted.

4 changes: 2 additions & 2 deletions site/docs/.vitepress/configs/locales/uk.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { DocSearchProps } from "node_modules/vitepress/types/docsearch";
import type { DocSearchProps } from "node_modules/vitepress/types/docsearch.js";
import type { LocaleConfig } from "vitepress";
import { social } from "../../shared/vars";
import { social } from "../../shared/vars.js";

const learnGuide = {
text: "Посібник",
Expand Down
4 changes: 2 additions & 2 deletions site/docs/.vitepress/configs/locales/zh.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { DocSearchProps } from "node_modules/vitepress/types/docsearch";
import type { DocSearchProps } from "node_modules/vitepress/types/docsearch.js";
import type { LocaleConfig } from "vitepress";
import { social } from "../../shared/vars";
import { social } from "../../shared/vars.js";

const learnGuide = {
text: "指南",
Expand Down
2 changes: 1 addition & 1 deletion site/docs/.vitepress/deps/langs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { computed } from "vue";
import { useData } from "vitepress";
import { ensureStartingSlash } from "./utils";
import { ensureStartingSlash } from "./utils.js";
export function useLangs(
{ removeCurrent = true, correspondingLink = false } = {},
) {
Expand Down
2 changes: 1 addition & 1 deletion site/docs/.vitepress/deps/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { withBase } from "vitepress";
import { lookup } from "mrmime";
import { useData } from "vitepress";
import { isExternal } from "./shared";
import { isExternal } from "./shared.js";
export function throttleAndDebounce(fn: () => void, delay: number | undefined) {
let timeoutId: string | number | NodeJS.Timeout | undefined;
let called = false;
Expand Down
2 changes: 1 addition & 1 deletion site/docs/.vitepress/plugins/better-line-breaks/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { escapeHtml } from "./shared";
import { escapeHtml } from "./shared.js";
import MarkdownIt from "markdown-it";

export const betterLineBreaks = (md: MarkdownIt) => {
Expand Down
6 changes: 3 additions & 3 deletions site/docs/.vitepress/plugins/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from "./better-line-breaks/plugins";
export * from "./current-versions/plugins";
export * from "./markdown";
export * from "./better-line-breaks/plugins.js";
export * from "./current-versions/plugins.js";
export * from "./markdown.js";
2 changes: 1 addition & 1 deletion site/docs/.vitepress/plugins/markdown.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import MarkdownIt from "markdown-it";
import { betterLineBreaks, currentVersions } from ".";
import { betterLineBreaks, currentVersions } from "./index.js";

export const markdown = (md: MarkdownIt) => {
md.use(currentVersions).use(betterLineBreaks);
Expand Down
Loading

0 comments on commit bce56d1

Please sign in to comment.