diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/docs/.gitignore b/docs/.gitignore index 48b7417..00cf027 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -24,4 +24,4 @@ dist .temp cache -docs/.vitepress/cache \ No newline at end of file +.vitepress/cache \ No newline at end of file diff --git a/docs/_tmp.ts b/docs/_tmp.ts deleted file mode 100644 index 0872af4..0000000 --- a/docs/_tmp.ts +++ /dev/null @@ -1,166 +0,0 @@ -import * as Preset from "@docusaurus/preset-classic"; -import type { Config } from "@docusaurus/types"; -import { themes as prismThemes } from "prism-react-renderer"; - -const config: Config = { - title: "Gouse", - tagline: - "A modern essential Golang utility package delivering consistency, modularity, performance, & extras presets", - favicon: "img/favicon.ico", - - // Set the production url of your site here - url: "https://gouse.vercel.app", - // For GitHub pages deployment, it is often '//' - baseUrl: "/", - baseUrlIssueBanner: true, - - organizationName: "thuongtruong109", - projectName: "gouse", - - onBrokenLinks: "throw", - onBrokenMarkdownLinks: "warn", - - i18n: { - defaultLocale: "en", - locales: ["en"], - }, - - presets: [ - [ - "classic", - { - docs: { - sidebarPath: "./sidebars.ts", - editUrl: - "https://github.com/thuongtruong109/gouse/tree/main/docs/main", - }, - blog: { - showReadingTime: true, - editUrl: - "https://github.com/thuongtruong109/gouse/tree/main/docs/main", - }, - theme: { - customCss: "./src/css/custom.css", - }, - } satisfies Preset.Options, - ], - ], - - themeConfig: { - // Replace with your project's social card - image: "img/docusaurus-social-card.jpg", - liveCodeBlock: { - playgroundPosition: "bottom", - }, - docs: { - sidebar: { - hideable: true, - autoCollapseCategories: true, - }, - }, - navbar: { - title: "Gouse", - hideOnScroll: true, - logo: { - alt: "Gouse Logo", - src: "img/logo.svg", - }, - items: [ - { - type: "docSidebar", - sidebarId: "docSidebar", - position: "left", - label: "Docs", - }, - { to: "/blog", label: "Blog", position: "left" }, - { - href: "https://github.com/thuongtruong109/gouse", - position: "right", - className: "header-github-link", - "aria-label": "GitHub repository", - }, - ], - }, - footer: { - style: "dark", - links: [ - { - title: "References", - items: [ - { - label: "Introduction", - to: "/docs/intro", - }, - { - label: "Receipts", - to: "/receipts", - }, - { - label: "Examples", - to: "/examples", - }, - ], - }, - { - title: "Links", - items: [ - { - label: "GitHub", - href: "https://github.com/thuongtruong109/gouse", - }, - { - label: "Dev.to", - href: "https://dev.to/thuongtruong109", - }, - { - label: "LinkedIn", - href: "https://www.linkedin.com/in/thuongtruong109/", - }, - ], - }, - { - title: "More", - items: [ - { - label: "License", - href: "https://github.com/thuongtruong109/gouse/blob/main/LICENSE", - }, - { - label: "Change Log", - href: "https://github.com/thuontruong1009/gouse/blob/main/CHANGELOG.md", - }, - { - label: "Funding", - href: "https://fund.thuongtruong.me", - }, - ], - }, - ], - copyright: "Copyright © 2024 Gouse ❤️", - }, - prism: { - theme: prismThemes.github, - darkTheme: prismThemes.dracula, - }, - // make Tailwind CSS and Docusaurus dark mode coexist - // colorMode: { - // disableSwitch: true, - // respectPrefersColorScheme: true, - // }, - } satisfies Preset.ThemeConfig, - - plugins: [ - function myPlugin(_context, _options) { - return { - name: "docusaurus-tailwindcss", - configurePostCss(postcssOptions) { - postcssOptions.plugins.push(require("tailwindcss")); - postcssOptions.plugins.push(require("autoprefixer")); - return postcssOptions; - }, - }; - }, - ], -}; - -export default config; diff --git a/docs/docs/.vitepress/config.ts b/docs/docs/.vitepress/config.ts index ac8c900..7c84b40 100644 --- a/docs/docs/.vitepress/config.ts +++ b/docs/docs/.vitepress/config.ts @@ -1,42 +1,130 @@ import { defineConfig } from 'vitepress'; +import { createRequire } from 'module' + +const require = createRequire(import.meta.url) +const pkg = require('../../package.json') -// refer https://vitepress.dev/reference/site-config for details export default defineConfig({ lang: 'en-US', - title: 'VitePress', - description: 'Vite & Vue powered static site generator.', + title: 'Gouse', + description: 'A modern essential Golang utility package delivering consistency, modularity, performance, & extras presets', - themeConfig: { - nav: [ - { text: 'Example', link: '/example' }, - { - text: 'Dropdown Menu', - items: [ - { text: 'Item A', link: '/item-1' }, - { text: 'Item B', link: '/item-2' }, - { text: 'Item C', link: '/item-3' }, - ], - }, + sitemap: { + hostname: 'http://localhost:3000', + }, - // ... + head: [ + [ + 'script', + { id: 'register-sw' }, + `;(() => { + if ('serviceWorker' in navigator) { + navigator.serviceWorker.register('/sw.js') + } + })()` ], + [ + 'favicon', + { rel: 'icon', type: 'image/ico', href: '/img/favicon.ico' } + ] + ], - sidebar: [ + themeConfig: { + nav: [ { - text: 'Guide', - items: [ - { text: 'Example', link: '/example' }, - // ... - ], + text: 'Introduction', + link: '/introduction/what-is-gouse', + activeMatch: '/introduction/' }, { text: 'Receipts', - items: [ - { text: 'Receipt', link: '/example' }, - // ... - ], + link: '/receipts/array', + activeMatch: '/receipts/' }, + { + text: `v${pkg.version}`, + items: [ + { + text: 'Changelog', + link: 'https://github.com/thuongtruong109/gouse/blob/main/CHANGELOG.md' + }, + { + text: 'Contributing', + link: 'https://github.com/thuongtruong109/gouse/blob/main/.github/CONTRIBUTING.md' + } + ] + } ], + + sidebar: { + '/introduction/': { + base: '/introduction/', + items: [ + { text: 'What is Gouse?', link: 'what-is-gouse' }, + { text: 'Getting Started', link: 'getting-started' }, + ] + + }, + '/receipts/': { + base: '/receipts/', + items: [ + { text: 'Api', link: 'api' }, + { text: 'Array', link: 'array' }, + { text: 'Cache', link: 'cache' }, + { text: 'Chart', link: 'chart' }, + { text: 'Config', link: 'config' }, + { text: 'Connection', link: 'connection' }, + { text: 'Console', link: 'console' }, + { text: 'Cron', link: 'cron' }, + { text: 'Crypto', link: 'crypto' }, + { text: 'Date', link: 'date' }, + { text: 'Function', link: 'function' }, + { text: 'I/O', link: 'io' }, + { text: 'Log', link: 'Log' }, + { text: 'Math', link: 'math' }, + { text: 'Media', link: 'media' }, + { text: 'Net', link: 'net' }, + { text: 'Number', link: 'number' }, + { text: 'OS', link: 'os' }, + { text: 'Random', link: 'random' }, + { text: 'Regex', link: 'regex' }, + { text: 'String', link: 'string' }, + { text: 'Struct', link: 'struct' }, + { text: 'Type', link: 'type' }, + + // { text: 'Path', link: 'path' }, + // { text: 'Security', link: 'security' }, + // { text: 'Web', link: 'web' }, + // { text: 'Worker', link: 'worker' }, + // { text: 'XML', link: 'xml' }, + // { text: 'Zip', link: 'zip' }, + // { text: 'Zlib', link: 'zlib' }, + // { text: 'Collection', link: 'collection' }, + // { text: 'Convert', link: 'convert' }, + // { text: 'Debug', link: 'debug' }, + // { text: 'File', link: 'file' }, + // { text: 'Hash', link: 'hash' }, + // { text: 'Http', link: 'http' }, + // { text: 'Json', link: 'json' }, + // { text: 'Object', link: 'object' }, + // { text: 'Time', link: 'time' }, + // { text: 'Uuid', link: 'uuid' }, + // { text: 'Validate', link: 'validate' }, + // { text: 'Web', link: 'web' }, + // { text: 'Xml', link: 'xml' } + ] + }, + }, + + editLink: { + pattern: 'https://github.com/thuongtruong109/gouse/edit/main/docs/docs/:path', + text: 'Edit this page on GitHub' + }, + + footer: { + message: 'Released under the MIT License.', + copyright: 'Copyright © 2024-present Tran Nguyen Thuong Truong' + } }, -}); +}); \ No newline at end of file diff --git a/docs/docs/index.md b/docs/docs/index.md index aa545cb..49cf719 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -1,16 +1,60 @@ --- layout: home +title: Gouse +titleTemplate: Utility presets package + hero: - name: VitePress - text: Vite & Vue powered static site generator. - tagline: Simple, powerful, and performant. Meet the modern SSG framework you've always wanted. + name: Gouse + text: A modern Golang utility presets + tagline: Resuable functions rapidly actions: - theme: brand - text: Get Started - link: /example + text: What is Gouse? + link: /guide/what-is-gouse + - theme: alt + text: Quickstart + link: /guide/getting-started - theme: alt - text: View on GitHub - link: https://github.com/vuejs/vitepress - image: https://github.com/thuongtruong109/gouse/raw/main/public/banner.png + text: GitHub + link: https://github.com/thuongtruong109/gouse + image: + src: /img/512x512.png + alt: Gouse + +features: + - icon: 📝 + title: Focus on Your Content + details: Effortlessly create beautiful documentation sites with just markdown. + - icon: + title: Enjoy the Vite DX + details: Instant server start, lightning fast hot updates, and leverage Vite ecosystem plugins. + - icon: + title: Customize with Vue + details: Use Vue syntax and components directly in markdown, or build custom themes with Vue. + - icon: 🚀 + title: Ship Fast Sites + details: Fast initial load with static HTML, fast post-load navigation with client-side routing. --- + + diff --git a/docs/docs/example.md b/docs/docs/introduction/getting-started.md similarity index 100% rename from docs/docs/example.md rename to docs/docs/introduction/getting-started.md diff --git a/docs/docs/introduction/what-is-gouse.md b/docs/docs/introduction/what-is-gouse.md new file mode 100644 index 0000000..5d1fb71 --- /dev/null +++ b/docs/docs/introduction/what-is-gouse.md @@ -0,0 +1,15 @@ +# VitePress 💙 StackBlitz + +Hi there :wave: This is a demo running VitePress within your **browser tab**! + +## Powered by Vite + +VitePress uses Vite under the hood. This means: + +- Instant server start +- Lightning fast HMR +- Optimized builds + +## Markdown-Centered + +So you can focus more on writing. Powered by MarkdownIt. Comes with many [built-in extensions](https://vitepress.dev/guide/markdown), and you can use Vue features in Markdown too! diff --git a/docs/public/img/128x128.png b/docs/docs/public/img/128x128.png similarity index 100% rename from docs/public/img/128x128.png rename to docs/docs/public/img/128x128.png diff --git a/docs/public/img/256x256.png b/docs/docs/public/img/256x256.png similarity index 100% rename from docs/public/img/256x256.png rename to docs/docs/public/img/256x256.png diff --git a/docs/public/img/32x32.png b/docs/docs/public/img/32x32.png similarity index 100% rename from docs/public/img/32x32.png rename to docs/docs/public/img/32x32.png diff --git a/docs/public/img/46x48.png b/docs/docs/public/img/46x48.png similarity index 100% rename from docs/public/img/46x48.png rename to docs/docs/public/img/46x48.png diff --git a/docs/public/img/512x512.png b/docs/docs/public/img/512x512.png similarity index 100% rename from docs/public/img/512x512.png rename to docs/docs/public/img/512x512.png diff --git a/docs/public/img/64x64.png b/docs/docs/public/img/64x64.png similarity index 100% rename from docs/public/img/64x64.png rename to docs/docs/public/img/64x64.png diff --git a/docs/public/img/72x72.png b/docs/docs/public/img/72x72.png similarity index 100% rename from docs/public/img/72x72.png rename to docs/docs/public/img/72x72.png diff --git a/docs/public/img/96x96.png b/docs/docs/public/img/96x96.png similarity index 100% rename from docs/public/img/96x96.png rename to docs/docs/public/img/96x96.png diff --git a/docs/public/img/favicon.ico b/docs/docs/public/img/favicon.ico similarity index 100% rename from docs/public/img/favicon.ico rename to docs/docs/public/img/favicon.ico diff --git a/docs/public/img/logo.svg b/docs/docs/public/img/logo.svg similarity index 100% rename from docs/public/img/logo.svg rename to docs/docs/public/img/logo.svg diff --git a/docs/public/img/undraw_docusaurus_mountain.svg b/docs/docs/public/img/undraw_docusaurus_mountain.svg similarity index 100% rename from docs/public/img/undraw_docusaurus_mountain.svg rename to docs/docs/public/img/undraw_docusaurus_mountain.svg diff --git a/docs/public/img/undraw_docusaurus_react.svg b/docs/docs/public/img/undraw_docusaurus_react.svg similarity index 100% rename from docs/public/img/undraw_docusaurus_react.svg rename to docs/docs/public/img/undraw_docusaurus_react.svg diff --git a/docs/public/img/undraw_docusaurus_tree.svg b/docs/docs/public/img/undraw_docusaurus_tree.svg similarity index 100% rename from docs/public/img/undraw_docusaurus_tree.svg rename to docs/docs/public/img/undraw_docusaurus_tree.svg diff --git a/docs/package-lock.json b/docs/package-lock.json index f156be8..ac44e71 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -5,6 +5,7 @@ "packages": { "": { "devDependencies": { + "@types/node": "^22.9.3", "vitepress": "latest" } }, @@ -1056,6 +1057,15 @@ "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==", "dev": true }, + "node_modules/@types/node": { + "version": "22.9.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.3.tgz", + "integrity": "sha512-F3u1fs/fce3FFk+DAxbxc78DF8x0cY09RRL8GnXLmkJ1jvx3TtPdWoTT5/NiYfI5ASqXBmfqJi9dZ3gxMx4lzw==", + "dev": true, + "dependencies": { + "undici-types": "~6.19.8" + } + }, "node_modules/@types/unist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", @@ -2049,6 +2059,12 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true + }, "node_modules/unist-util-is": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", diff --git a/docs/package.json b/docs/package.json index 5ba6bc7..9d65822 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,12 +1,14 @@ { "private": true, "type": "module", + "version": "1.0.0", "scripts": { "dev": "vitepress dev docs", "build": "vitepress build docs", "preview": "vitepress preview docs" }, "devDependencies": { + "@types/node": "^22.9.3", "vitepress": "latest" } }