├── .gitignore ├── .vscode ├── extensions.json └── launch.json ├── README.md ├── astro.config.mjs ├── package.json ├── pnpm-lock.yaml ├── public ├── favicon.ico ├── favicon.svg ├── og.png └── robots.txt ├── src ├── assets │ ├── houston.webp │ ├── images │ │ ├── analytics-google.png │ │ ├── config-ai-function.png │ │ ├── dokploy-buildtype.png │ │ ├── dokploy-deploy.png │ │ ├── dokploy-domain.png │ │ ├── dokploy-env.png │ │ ├── dokploy-settings.png │ │ ├── github-client.png │ │ ├── google-client.png │ │ ├── guide-ad-featured.png │ │ ├── guide-ad-sponsor-2.png │ │ ├── guide-ad-sponsor.png │ │ ├── guide-category-list.png │ │ ├── guide-category.png │ │ ├── guide-config-logo.png │ │ ├── guide-config-website-2.png │ │ ├── guide-config-website.png │ │ ├── guide-custom-homepage.png │ │ ├── guide-custom-page.png │ │ ├── guide-dev-architecture.png │ │ ├── guide-dev-console-logs.png │ │ ├── guide-dev-logs-vercel.png │ │ ├── guide-email-preview.png │ │ ├── guide-file-structure.png │ │ ├── guide-font-file.png │ │ ├── guide-font-layout.png │ │ ├── guide-group-list.png │ │ ├── guide-group.png │ │ ├── guide-item-card-icon.png │ │ ├── guide-item-card-image.png │ │ ├── guide-logo.png │ │ ├── guide-payment-feature.png │ │ ├── guide-payment-sponsor.png │ │ ├── guide-send-notification-email.png │ │ ├── guide-sponsor-config.png │ │ ├── guide-sponsor-status.png │ │ ├── guide-submission-admin.png │ │ ├── guide-submission-approved.png │ │ ├── guide-submission-autofill.png │ │ ├── guide-submission-publish.png │ │ ├── guide-submission-review.png │ │ ├── guide-submission-user.png │ │ ├── guide-sync-code-1.png │ │ ├── guide-sync-code.png │ │ ├── guide-theme-blue.png │ │ ├── guide-theme.png │ │ ├── openpanel-client.png │ │ ├── resend-audience.png │ │ ├── resend-keys.png │ │ ├── sanity-cors.png │ │ ├── stripe-key.png │ │ ├── stripe-price.png │ │ ├── stripe-webhook.png │ │ ├── vercel-cloudflare-ssl.png │ │ ├── vercel-domain.png │ │ └── vercel-project.png │ ├── logo-rounded.png │ └── logo.png ├── components │ └── Head.astro ├── content │ ├── config.ts │ └── docs │ │ ├── 404.md │ │ ├── astro.mdx │ │ ├── configuration │ │ ├── ai.mdx │ │ ├── analytics.mdx │ │ ├── auth.mdx │ │ ├── resend.mdx │ │ ├── sanity.mdx │ │ └── stripe.mdx │ │ ├── customization │ │ ├── card.mdx │ │ ├── category.mdx │ │ ├── custom-page.mdx │ │ ├── email.mdx │ │ ├── font.mdx │ │ ├── information.mdx │ │ ├── logo.mdx │ │ └── theme.mdx │ │ ├── deployment │ │ ├── docker.mdx │ │ ├── dokploy.mdx │ │ └── vercel.mdx │ │ ├── faq.mdx │ │ ├── guide │ │ ├── develop.mdx │ │ ├── sanity.mdx │ │ ├── sponsor-ads.mdx │ │ └── submission.mdx │ │ ├── index.mdx │ │ ├── installation.mdx │ │ ├── prerequisites.mdx │ │ └── zh-cn │ │ ├── configuration │ │ ├── ai.mdx │ │ ├── analytics.mdx │ │ ├── auth.mdx │ │ ├── resend.mdx │ │ ├── sanity.mdx │ │ └── stripe.mdx │ │ ├── customization │ │ ├── card.mdx │ │ ├── category.mdx │ │ ├── custom-page.mdx │ │ ├── email.mdx │ │ ├── font.mdx │ │ ├── information.mdx │ │ ├── logo.mdx │ │ └── theme.mdx │ │ ├── deployment │ │ ├── docker.mdx │ │ ├── dokploy.mdx │ │ └── vercel.mdx │ │ ├── faq.mdx │ │ ├── guide │ │ ├── develop.mdx │ │ ├── sanity.mdx │ │ ├── sponsor-ads.mdx │ │ └── submission.mdx │ │ ├── index.mdx │ │ ├── installation.mdx │ │ └── prerequisites.mdx └── env.d.ts └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | # build output 2 | dist/ 3 | # generated types 4 | .astro/ 5 | 6 | # dependencies 7 | node_modules/ 8 | 9 | # logs 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | pnpm-debug.log* 14 | 15 | 16 | # environment variables 17 | .env 18 | .env.production 19 | 20 | # macOS-specific files 21 | .DS_Store 22 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["astro-build.astro-vscode"], 3 | "unwantedRecommendations": [] 4 | } 5 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "command": "./node_modules/.bin/astro dev", 6 | "name": "Development server", 7 | "request": "launch", 8 | "type": "node-terminal" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mkdirs Documentation 2 | 3 | The best directory website template. 4 | 5 | Website: [mkdirs.com](https://mkdirs.com) 6 | 7 | Explore the [live demo](https://demo.mkdirs.com) 8 | 9 | Read the [documentation](https://docs.mkdirs.com) 10 | 11 | Watch the [video tutorial](https://www.youtube.com/@MkdirsHQ) 12 | 13 | > If you find any issues, please [submit an issue](https://github.com/MkdirsHQ/mkdirs-template/issues/new) or contact me at [support@mkdirs.com](mailto:support@mkdirs.com). 14 | 15 | > If you have any feature requests or questions or ideas to share, please [submit it in the discussions](https://github.com/MkdirsHQ/mkdirs-template/discussions). 16 | -------------------------------------------------------------------------------- /astro.config.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import { defineConfig } from "astro/config"; 3 | import starlight from "@astrojs/starlight"; 4 | 5 | import sitemap from "@astrojs/sitemap"; 6 | 7 | // https://astro.build/config 8 | export default defineConfig({ 9 | // site: "http://localhost:4321", 10 | site: "https://docs.mkdirs.com", 11 | integrations: [ 12 | sitemap(), 13 | starlight({ 14 | title: "Mkdirs", 15 | favicon: "./favicon.ico", 16 | social: { 17 | github: "https://github.com/MkdirsHQ", 18 | twitter: "https://x.com/javay_hu", 19 | youtube: "https://www.youtube.com/@MkdirsHQ", 20 | }, 21 | logo: { 22 | src: "./src/assets/logo-rounded.png", 23 | alt: "Mkdirs Logo", 24 | }, 25 | // https://starlight.astro.build/guides/i18n/#use-a-root-locale 26 | defaultLocale: "root", 27 | locales: { 28 | root: { 29 | label: "English", 30 | lang: "en", 31 | }, 32 | "zh-cn": { 33 | label: "简体中文", 34 | lang: "zh-CN", 35 | }, 36 | }, 37 | components: { 38 | Head: './src/components/Head.astro', 39 | }, 40 | sidebar: [ 41 | { 42 | label: "Introduction", 43 | translations: { 44 | "zh-CN": "模板介绍" 45 | }, 46 | slug: "index", 47 | }, 48 | { 49 | label: "FAQ", 50 | translations: { 51 | "zh-CN": "常见问题" 52 | }, 53 | slug: "faq", 54 | }, 55 | { 56 | label: "Roadmap", 57 | translations: { 58 | "zh-CN": "路线图" 59 | }, 60 | link: "https://github.com/MkdirsHQ/mkdirs-template/issues/10", 61 | }, 62 | { 63 | label: "Prerequisites", 64 | translations: { 65 | "zh-CN": "前提条件" 66 | }, 67 | slug: "prerequisites", 68 | }, 69 | { 70 | label: "Installation", 71 | translations: { 72 | "zh-CN": "安装部署" 73 | }, 74 | slug: "installation", 75 | }, 76 | { 77 | label: "Configuration", 78 | translations: { 79 | "zh-CN": "配置环境" 80 | }, 81 | items: [ 82 | { 83 | label: "Sanity", 84 | translations: { 85 | "zh-CN": "数据服务 - Sanity" 86 | }, 87 | slug: "configuration/sanity" 88 | }, 89 | { 90 | label: "Resend", 91 | translations: { 92 | "zh-CN": "邮件服务 - Resend" 93 | }, 94 | slug: "configuration/resend" 95 | }, 96 | { 97 | label: "Stripe", 98 | translations: { 99 | "zh-CN": "支付服务 - Stripe" 100 | }, 101 | slug: "configuration/stripe" 102 | }, 103 | { 104 | label: "Auth", 105 | translations: { 106 | "zh-CN": "认证服务 - Auth" 107 | }, 108 | slug: "configuration/auth" 109 | }, 110 | { 111 | label: "Analytics", 112 | translations: { 113 | "zh-CN": "数据分析 - Analytics" 114 | }, 115 | slug: "configuration/analytics" 116 | }, 117 | { 118 | label: "AI", 119 | translations: { 120 | "zh-CN": "AI 模型 - AI" 121 | }, 122 | slug: "configuration/ai" 123 | }, 124 | ], 125 | }, 126 | { 127 | label: "Deployment", 128 | translations: { 129 | "zh-CN": "部署上线" 130 | }, 131 | items: [ 132 | { 133 | label: "Vercel", 134 | translations: { 135 | "zh-CN": "部署到 Vercel" 136 | }, 137 | slug: "deployment/vercel" 138 | }, 139 | { 140 | label: "Docker", 141 | translations: { 142 | "zh-CN": "Docker 自部署" 143 | }, 144 | slug: "deployment/docker" 145 | }, 146 | { 147 | label: "Dokploy", 148 | translations: { 149 | "zh-CN": "部署到 Dokploy" 150 | }, 151 | slug: "deployment/dokploy" 152 | }, 153 | ], 154 | }, 155 | { 156 | label: "Customization", 157 | translations: { 158 | "zh-CN": "自定义" 159 | }, 160 | items: [ 161 | { 162 | label: "Customize Information", 163 | translations: { 164 | "zh-CN": "自定义网站信息" 165 | }, 166 | slug: "customization/information" 167 | }, 168 | { 169 | label: "Customize Logo", 170 | translations: { 171 | "zh-CN": "自定义 Logo" 172 | }, 173 | slug: "customization/logo" 174 | }, 175 | { 176 | label: "Customize Font", 177 | translations: { 178 | "zh-CN": "自定义字体" 179 | }, 180 | slug: "customization/font" 181 | }, 182 | { 183 | label: "Customize Theme", 184 | translations: { 185 | "zh-CN": "自定义主题" 186 | }, 187 | slug: "customization/theme" 188 | }, 189 | { 190 | label: "Customize Card", 191 | translations: { 192 | "zh-CN": "自定义卡片样式" 193 | }, 194 | slug: "customization/card" 195 | }, 196 | { 197 | label: "Customize Category", 198 | translations: { 199 | "zh-CN": "自定义分类" 200 | }, 201 | slug: "customization/category" 202 | }, 203 | { 204 | label: "Customize Email", 205 | translations: { 206 | "zh-CN": "自定义邮件" 207 | }, 208 | slug: "customization/email" 209 | }, 210 | { 211 | label: "Customize Page", 212 | translations: { 213 | "zh-CN": "自定义页面" 214 | }, 215 | slug: "customization/custom-page" 216 | }, 217 | ], 218 | }, 219 | { 220 | label: "Guide", 221 | translations: { 222 | "zh-CN": "使用指南" 223 | }, 224 | items: [ 225 | { 226 | label: "Development", 227 | translations: { 228 | "zh-CN": "开发相关" 229 | }, 230 | slug: "guide/develop" 231 | }, 232 | { 233 | label: "Submission", 234 | translations: { 235 | "zh-CN": "提交数据" 236 | }, 237 | slug: "guide/submission" 238 | }, 239 | { 240 | label: "Sponsor Ads", 241 | translations: { 242 | "zh-CN": "赞助广告" 243 | }, 244 | slug: "guide/sponsor-ads" 245 | }, 246 | { 247 | label: "Sanity", 248 | translations: { 249 | "zh-CN": "Sanity 相关" 250 | }, 251 | slug: "guide/sanity" 252 | }, 253 | ], 254 | }, 255 | ] 256 | }), 257 | ], 258 | }); 259 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mkdirs-docs-starlight", 3 | "type": "module", 4 | "version": "0.0.1", 5 | "scripts": { 6 | "dev": "astro dev", 7 | "start": "astro dev", 8 | "build": "astro check && astro build", 9 | "preview": "astro preview", 10 | "astro": "astro" 11 | }, 12 | "dependencies": { 13 | "@astrojs/check": "^0.9.4", 14 | "@astrojs/sitemap": "^3.2.1", 15 | "@astrojs/starlight": "^0.28.3", 16 | "astro": "^4.15.3", 17 | "sharp": "^0.32.5", 18 | "typescript": "^5.6.3" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/public/favicon.ico -------------------------------------------------------------------------------- /public/favicon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/og.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/public/og.png -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / 3 | 4 | Sitemap: https://docs.mkdirs.com/sitemap-index.xml 5 | -------------------------------------------------------------------------------- /src/assets/houston.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/houston.webp -------------------------------------------------------------------------------- /src/assets/images/analytics-google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/analytics-google.png -------------------------------------------------------------------------------- /src/assets/images/config-ai-function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/config-ai-function.png -------------------------------------------------------------------------------- /src/assets/images/dokploy-buildtype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/dokploy-buildtype.png -------------------------------------------------------------------------------- /src/assets/images/dokploy-deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/dokploy-deploy.png -------------------------------------------------------------------------------- /src/assets/images/dokploy-domain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/dokploy-domain.png -------------------------------------------------------------------------------- /src/assets/images/dokploy-env.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/dokploy-env.png -------------------------------------------------------------------------------- /src/assets/images/dokploy-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/dokploy-settings.png -------------------------------------------------------------------------------- /src/assets/images/github-client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/github-client.png -------------------------------------------------------------------------------- /src/assets/images/google-client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/google-client.png -------------------------------------------------------------------------------- /src/assets/images/guide-ad-featured.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-ad-featured.png -------------------------------------------------------------------------------- /src/assets/images/guide-ad-sponsor-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-ad-sponsor-2.png -------------------------------------------------------------------------------- /src/assets/images/guide-ad-sponsor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-ad-sponsor.png -------------------------------------------------------------------------------- /src/assets/images/guide-category-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-category-list.png -------------------------------------------------------------------------------- /src/assets/images/guide-category.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-category.png -------------------------------------------------------------------------------- /src/assets/images/guide-config-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-config-logo.png -------------------------------------------------------------------------------- /src/assets/images/guide-config-website-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-config-website-2.png -------------------------------------------------------------------------------- /src/assets/images/guide-config-website.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-config-website.png -------------------------------------------------------------------------------- /src/assets/images/guide-custom-homepage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-custom-homepage.png -------------------------------------------------------------------------------- /src/assets/images/guide-custom-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-custom-page.png -------------------------------------------------------------------------------- /src/assets/images/guide-dev-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-dev-architecture.png -------------------------------------------------------------------------------- /src/assets/images/guide-dev-console-logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-dev-console-logs.png -------------------------------------------------------------------------------- /src/assets/images/guide-dev-logs-vercel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-dev-logs-vercel.png -------------------------------------------------------------------------------- /src/assets/images/guide-email-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-email-preview.png -------------------------------------------------------------------------------- /src/assets/images/guide-file-structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-file-structure.png -------------------------------------------------------------------------------- /src/assets/images/guide-font-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-font-file.png -------------------------------------------------------------------------------- /src/assets/images/guide-font-layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-font-layout.png -------------------------------------------------------------------------------- /src/assets/images/guide-group-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-group-list.png -------------------------------------------------------------------------------- /src/assets/images/guide-group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-group.png -------------------------------------------------------------------------------- /src/assets/images/guide-item-card-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-item-card-icon.png -------------------------------------------------------------------------------- /src/assets/images/guide-item-card-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-item-card-image.png -------------------------------------------------------------------------------- /src/assets/images/guide-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-logo.png -------------------------------------------------------------------------------- /src/assets/images/guide-payment-feature.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-payment-feature.png -------------------------------------------------------------------------------- /src/assets/images/guide-payment-sponsor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-payment-sponsor.png -------------------------------------------------------------------------------- /src/assets/images/guide-send-notification-email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-send-notification-email.png -------------------------------------------------------------------------------- /src/assets/images/guide-sponsor-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-sponsor-config.png -------------------------------------------------------------------------------- /src/assets/images/guide-sponsor-status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-sponsor-status.png -------------------------------------------------------------------------------- /src/assets/images/guide-submission-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-submission-admin.png -------------------------------------------------------------------------------- /src/assets/images/guide-submission-approved.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-submission-approved.png -------------------------------------------------------------------------------- /src/assets/images/guide-submission-autofill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-submission-autofill.png -------------------------------------------------------------------------------- /src/assets/images/guide-submission-publish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-submission-publish.png -------------------------------------------------------------------------------- /src/assets/images/guide-submission-review.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-submission-review.png -------------------------------------------------------------------------------- /src/assets/images/guide-submission-user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-submission-user.png -------------------------------------------------------------------------------- /src/assets/images/guide-sync-code-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-sync-code-1.png -------------------------------------------------------------------------------- /src/assets/images/guide-sync-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-sync-code.png -------------------------------------------------------------------------------- /src/assets/images/guide-theme-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-theme-blue.png -------------------------------------------------------------------------------- /src/assets/images/guide-theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/guide-theme.png -------------------------------------------------------------------------------- /src/assets/images/openpanel-client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/openpanel-client.png -------------------------------------------------------------------------------- /src/assets/images/resend-audience.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/resend-audience.png -------------------------------------------------------------------------------- /src/assets/images/resend-keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/resend-keys.png -------------------------------------------------------------------------------- /src/assets/images/sanity-cors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/sanity-cors.png -------------------------------------------------------------------------------- /src/assets/images/stripe-key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/stripe-key.png -------------------------------------------------------------------------------- /src/assets/images/stripe-price.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/stripe-price.png -------------------------------------------------------------------------------- /src/assets/images/stripe-webhook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/stripe-webhook.png -------------------------------------------------------------------------------- /src/assets/images/vercel-cloudflare-ssl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/vercel-cloudflare-ssl.png -------------------------------------------------------------------------------- /src/assets/images/vercel-domain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/vercel-domain.png -------------------------------------------------------------------------------- /src/assets/images/vercel-project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/images/vercel-project.png -------------------------------------------------------------------------------- /src/assets/logo-rounded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/logo-rounded.png -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkdirsHQ/mkdirs-docs/8fb617e7c8fef3a78df8d8cb138f874b4d65828e/src/assets/logo.png -------------------------------------------------------------------------------- /src/components/Head.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import type { Props } from '@astrojs/starlight/props' 3 | import Default from '@astrojs/starlight/components/Head.astro' 4 | 5 | // Get the URL of the generated image for the current page using its ID and 6 | // append the `.png` file extension. 7 | const ogImageUrl = new URL("/og.png", Astro.site); 8 | // console.log("ogImageUrl", ogImageUrl); 9 | --- 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/content/config.ts: -------------------------------------------------------------------------------- 1 | import { defineCollection } from 'astro:content'; 2 | import { docsSchema } from '@astrojs/starlight/schema'; 3 | 4 | export const collections = { 5 | docs: defineCollection({ schema: docsSchema() }), 6 | }; 7 | -------------------------------------------------------------------------------- /src/content/docs/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: '404' 3 | template: splash 4 | editUrl: false 5 | hero: 6 | title: '404' 7 | tagline: Page not found. Check the URL or try using the search bar. 8 | --- -------------------------------------------------------------------------------- /src/content/docs/astro.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Welcome to Mkdirs 3 | description: Get started building your directory website with Mkdirs. 4 | template: splash 5 | hero: 6 | tagline: Launch your directory website in minutes and make profits today. 7 | image: 8 | file: ../../assets/houston.webp 9 | actions: 10 | - text: Get Started 11 | link: /get-started/ 12 | icon: right-arrow 13 | - text: Introduction 14 | link: /introduction/ 15 | variant: secondary 16 | icon: right-arrow 17 | --- 18 | 19 | import { Card, CardGrid } from '@astrojs/starlight/components'; 20 | 21 | ## Next steps 22 | 23 | 24 | 25 | Edit `src/content/docs/index.mdx` to see this page change. 26 | 27 | 28 | Add Markdown or MDX files to `src/content/docs` to create new pages. 29 | 30 | 31 | Edit your `sidebar` and other config in `astro.config.mjs`. 32 | 33 | 34 | Learn more in [the Starlight Docs](https://starlight.astro.build/). 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/content/docs/configuration/ai.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: AI Models 3 | description: How to configure AI models. 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | import { Steps } from '@astrojs/starlight/components'; 8 | 9 | Mkdirs uses AI models to analyze the content of the website and automatically fill in the submission form, which improves the efficiency of the submission process. 10 | 11 | Mkdirs uses [Vercel AI SDK](https://sdk.vercel.ai/) to wrap AI models and supports [OpenAI ChatGPT](https://openai.com/), [Google Gemini](https://gemini.google.com/), [DeepSeek](https://www.deepseek.com/), [XAI](https://x.ai/) and [OpenRouter](https://openrouter.ai/) models by default, which can be selected according to the needs of the directory. 12 | 13 | ## Configuration 14 | 15 | 16 | 17 | 1. Determine the AI model to use 18 | 19 | You can choose to use `google`, `deepseek`, `openai`, `xai` or `openrouter` as the AI model, and set the `DEFAULT_AI_PROVIDER` variable in the `.env` file. 20 | 21 | ```bash 22 | # .env 23 | # [only required if you are using AI models to auto fill the submission form] 24 | # default ai provider: ``, `google`, `deepseek`, `openai`, `xai`, `openrouter` 25 | # ----------------------------------------------------------------------------- 26 | DEFAULT_AI_PROVIDER= 27 | ``` 28 | 29 | 34 | 35 | 2. Get the API Key of the corresponding AI model 36 | 37 | 2.1 Get Google Gemini API Key 38 | 39 | Link to get the API Key: [Google Gemini API Key](https://aistudio.google.com/apikey) 40 | 41 | ```bash 42 | # .env 43 | # [only required if you are using Google Gemini] 44 | # NOTE: if you set `DEFAULT_AI_PROVIDER=google`, you should set this API_KEY 45 | # ----------------------------------------------------------------------------- 46 | GOOGLE_GENERATIVE_AI_API_KEY= 47 | ``` 48 | 49 | 2.2 Get DeepSeek API Key 50 | 51 | Link to get the API Key: [DeepSeek API Key](https://platform.deepseek.com/api_keys) 52 | 53 | ```bash 54 | # .env 55 | # [only required if you are using DeepSeek] 56 | # NOTE: if you set `DEFAULT_AI_PROVIDER=deepseek`, you should set this API_KEY 57 | # ----------------------------------------------------------------------------- 58 | DEEPSEEK_API_KEY= 59 | ``` 60 | 61 | 2.3 Get OpenAI ChatGPT API Key 62 | 63 | Link to get the API Key: [OpenAI ChatGPT API Key](https://platform.openai.com/settings/organization/api-keys) 64 | 65 | ```bash 66 | # .env 67 | # [only required if you are using OpenAI] 68 | # NOTE: if you set `DEFAULT_AI_PROVIDER=openai`, you should set this API_KEY 69 | # ----------------------------------------------------------------------------- 70 | OPENAI_API_KEY= 71 | ``` 72 | 73 | 2.4 Get XAI API Key 74 | 75 | Link to get the API Key: [XAI API Key](https://console.x.ai/) 76 | 77 | ```bash 78 | # .env 79 | # [only required if you are using XAI] 80 | # NOTE: if you set `DEFAULT_AI_PROVIDER=xai`, you should set this API_KEY 81 | # ----------------------------------------------------------------------------- 82 | XAI_API_KEY= 83 | ``` 84 | 85 | 2.5 Get OpenRouter API Key 86 | 87 | Link to get the API Key: [OpenRouter API Key](https://openrouter.ai/settings/keys) 88 | 89 | ```bash 90 | # .env 91 | # [only required if you are using OpenRouter] 92 | # NOTE: if you set `DEFAULT_AI_PROVIDER=openrouter`, you should set this API_KEY 93 | # ----------------------------------------------------------------------------- 94 | OPENROUTER_API_KEY= 95 | OPENROUTER_MODEL= 96 | ``` 97 | 98 | 3. Enable the AI autofill feature 99 | 100 | If you need to enable the AI model to implement the autofill feature, please set `SUPPORT_AI_SUBMIT` to `true`. 101 | 102 | ```bash 103 | # src/lib/constants.ts 104 | # support AI submit, default is false 105 | # NOTE: if you set true, you should make sure the AI provider 106 | # and the API_KEY is set in the env variables. 107 | # if something is wrong in AI submit, you can set false to disable it. 108 | export const SUPPORT_AI_SUBMIT = true; 109 | ``` 110 | 111 | 116 | 117 | 118 | 119 | After configuration of AI models, the "AI Autofill" button will appear in the submission form if the AI autofill feature is enabled, and click the button will trigger the AI model to automatically parse the webpage content and fill in the form. 120 | 121 | ![AI Auto Fill](../../../assets/images/guide-submission-autofill.png) 122 | 123 | ## Video tutorial 124 | 125 | This video demonstrates how to use the AI model to automatically fill in the submission form. 126 | 127 |
128 | 139 |
140 | 141 | ## Further reading 142 | 143 | - [Vercel AI SDK](https://sdk.vercel.ai/) 144 | - [DeepSeek API Key](https://platform.deepseek.com/api_keys) 145 | - [Google Gemini API Key](https://aistudio.google.com/apikey) 146 | - [OpenAI ChatGPT API Key](https://platform.openai.com/settings/organization/api-keys) 147 | - [XAI API Key](https://console.x.ai/) 148 | - [OpenRouter API Key](https://openrouter.ai/settings/keys) 149 | -------------------------------------------------------------------------------- /src/content/docs/configuration/analytics.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Analytics 3 | description: How to configure the analytics. 4 | --- 5 | 6 | import { Steps } from '@astrojs/starlight/components'; 7 | 8 | Mkdirs uses [Google Analytics](https://analytics.google.com/) or [OpenPanel](https://openpanel.dev/) as the analytics service, but you can also add other analytics services, and we will support more in the future. 9 | 10 | ## Google Analytics 11 | 12 | Follow the [Google Analytics official guide](https://support.google.com/analytics/answer/9304153) to set up Google Analytics for a website. 13 | 14 | Then copy the Google Analytics ID, and set it to the `.env` file. 15 | 16 | ```bash 17 | # .env 18 | # [only required if you are using Google Analytics] 19 | NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=your_google_analytics_id; 20 | ``` 21 | 22 | ![Google Analytics](../../../assets/images/analytics-google.png) 23 | 24 | ## OpenPanel Analytics 25 | 26 | 27 | 28 | 1. Create an account on [OpenPanel](https://openpanel.dev//login) 29 | 30 | If you don't have an account, follow [the steps](https://dashboard.openpanel.dev/login) to create your account. 31 | 32 | 2. Create a new project 33 | 34 | Click on the `Create Project` button, enter the name of your project to create a new one. 35 | 36 | 3. Create a new client 37 | 38 | Click on the `...` button next to the project name, and select `Projects`. 39 | 40 | Click on the `New Client` button, and enter the domain to create a new client. 41 | 42 | 4. Get the OpenPanel Client ID 43 | 44 | Once the client is created, copy the `Client ID` and set it to the `.env` file. 45 | 46 | ```bash 47 | # .env 48 | # [only required if you are using OpenPanel Analytics] 49 | NEXT_PUBLIC_OPENPANEL_CLIENT_ID=your_open_panel_client_id; 50 | ``` 51 | 52 | ![OpenPanel Client](../../../assets/images/openpanel-client.png) 53 | 54 | 55 | 56 | ## Umami Analytics 57 | 58 | 59 | 60 | 1. Create an account on [Umami](https://umami.is) 61 | 62 | If you don't have an account, follow the steps to create your account. 63 | 64 | 2. Create a new website 65 | 66 | After logging in, click on the `Add Website` button and enter your website details. 67 | 68 | 3. Get the Website ID 69 | 70 | Once the website is created, you'll find the Website ID in the website settings. Copy it and set it along with the script URL in your `.env` file. 71 | 72 | ```bash 73 | # .env 74 | # [only required if you are using Umami Analytics] 75 | NEXT_PUBLIC_UMAMI_WEBSITE_ID=your_website_id 76 | NEXT_PUBLIC_UMAMI_SCRIPT=https://cloud.umami.is/script.js 77 | ``` 78 | 79 | 80 | 81 | ## Plausible Analytics 82 | 83 | 84 | 85 | 1. Create an account on [Plausible](https://plausible.io) 86 | 87 | If you don't have an account, follow the steps to create your account. 88 | 89 | 2. Add a new site 90 | 91 | After logging in, click on the `Add a site` button and enter your domain name. 92 | 93 | 3. Configure the domain 94 | 95 | Once the site is added, copy your domain name and set it along with the script URL in your `.env` file. 96 | 97 | ```bash 98 | # .env 99 | # [only required if you are using Plausible Analytics] 100 | NEXT_PUBLIC_PLAUSIBLE_DOMAIN=your_domain 101 | NEXT_PUBLIC_PLAUSIBLE_SCRIPT=https://plausible.io/js/script.js 102 | ``` 103 | 104 | 105 | 106 | ## Video tutorial 107 | 108 | {/* https://www.youtube.com/embed/O3DEgUjJvhs?list=PLVBbrIi208W_qLhMoEV8-XQi7lrTyPlOM */} 109 |
110 | 121 |
122 | 123 | ## Further Reading 124 | 125 | - [Google Analytics](https://analytics.google.com/) 126 | - [OpenPanel Analytics](https://openpanel.dev/) 127 | -------------------------------------------------------------------------------- /src/content/docs/configuration/auth.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Authentication 3 | description: How to configure the authentication. 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | import { Steps } from '@astrojs/starlight/components'; 8 | 9 | Mkdirs uses [Auth.js v5](https://authjs.dev/) for authentication, supports email/password, GitHub, and Google authentication. 10 | 11 | ## Configuration 12 | 13 | 14 | 15 | 1. Generate the `AUTH_SECRET` variable 16 | 17 | `AUTH_SECRET` is a random value, and you can generate one via running: 18 | 19 | ```bash 20 | npx auth secret 21 | 22 | # or 23 | openssl rand -base64 32 24 | ``` 25 | 26 | Then set it to the `.env` file. 27 | 28 | ```bash 29 | # .env 30 | # [required] 31 | AUTH_SECRET=secret 32 | ``` 33 | 34 | 2. [Optional] Get the GitHub client variables 35 | 36 | If you want to use GitHub as an OAuth provider, you need to update the `AUTH_GITHUB_ID` and `AUTH_GITHUB_SECRET` variables. 37 | 38 | Follow the steps [here](https://authjs.dev/guides/configuring-github) to get the `client_id` and `client_secret` from the [GitHub Developer Settings](https://github.com/settings/developers). 39 | 40 | For the callback URL, it is **`https://your-domain.com/api/auth/callback/github`** or **`http://localhost:3000/api/auth/callback/github`** for local development. 41 | 42 | ```bash 43 | # .env 44 | # [only required if you want to support GitHub authentication] 45 | AUTH_GITHUB_ID = your_secret_client_id 46 | AUTH_GITHUB_SECRET = your_secret_client 47 | ``` 48 | 49 | 53 | 54 | ![GitHub Client](../../../assets/images/github-client.png) 55 | 56 | 3. [Optional] Get the Google client variables 57 | 58 | If you want to use Google as an OAuth provider, you need to update the `AUTH_GOOGLE_ID` and `AUTH_GOOGLE_SECRET` variables. 59 | 60 | You can get the `client_id` and `client_secret` from the [Google Cloud Console](https://console.cloud.google.com/apis/credentials). 61 | 62 | For the callback URL, it is **`https://your-domain.com/api/auth/callback/google`** or **`http://localhost:3000/api/auth/callback/google`** for local development. 63 | 64 | ```bash 65 | # .env 66 | # [only required if you want to support Google authentication] 67 | AUTH_GOOGLE_ID = your_secret_client_id.apps.googleusercontent.com 68 | AUTH_GOOGLE_SECRET = your_secret_client 69 | ``` 70 | 71 | 75 | 76 | ![Google Client](../../../assets/images/google-client.png) 77 | 78 | 79 | 80 | 93 | 94 | ## Video tutorial 95 | 96 | {/* https://www.youtube.com/embed/BANUS9CmxYA?list=PLVBbrIi208W_qLhMoEV8-XQi7lrTyPlOM */} 97 |
98 | 109 |
110 | 111 | If you are interested in Next Auth V5, you can refer to the following video tutorial, it is a more advanced guide for Next Auth V5, so much better than the official documentation. 112 | 113 |
114 | 125 |
126 | 127 | ## Further Reading 128 | 129 | - [Auth.js v5](https://authjs.dev/getting-started/introduction) 130 | - [Auth.js v5 - Environment Variables](https://authjs.dev/guides/environment-variables) 131 | - [Auth.js v5 - OAuth with GitHub](https://authjs.dev/guides/configuring-github) 132 | - [Auth.js v5 - Database Adapter](https://authjs.dev/guides/creating-a-database-adapter) 133 | - [Auth.js v5 - Data Models](https://authjs.dev/concepts/database-models) 134 | - [YouTube Video - Next Auth V5 - Advanced Guide (2024)](https://www.youtube.com/watch?v=1MTyCvS05V4) 135 | -------------------------------------------------------------------------------- /src/content/docs/configuration/resend.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Resend 3 | description: How to configure the email. 4 | --- 5 | 6 | import { Steps } from '@astrojs/starlight/components'; 7 | 8 | Mkdirs uses [Resend](https://resend.com/) as the email service, supports sending emails, receiving notification emails, and supports subscription functionality. 9 | 10 | ## Configuration 11 | 12 | 13 | 14 | 1. Create an account on [Resend](https://resend.com/) 15 | 16 | If you don't have an account on Resend, follow their steps to [signup](https://resend.com/signup). 17 | 18 | After signin on Resend, following their steps to [add your domain to Resend](https://resend.com/docs/dashboard/domains/cloudflare). 19 | 20 | 2. Get the Resend API key 21 | 22 | Click on `API Keys` on the left navigation bar, then click on the `Create API key` button, and set it to the `.env` file. 23 | 24 | Please make sure the API key has the `Full Access` permission. 25 | 26 | ```bash 27 | # .env 28 | # [only required if you want to authenticate users by email/password] 29 | RESEND_API_KEY=your_api_key 30 | ``` 31 | 32 | ![Resend Keys](../../../assets/images/resend-keys.png) 33 | 34 | 3. Set the email address to send the emails from 35 | 36 | When sending an email, for example, signup emails, the email will be sent from the following email address: 37 | 38 | ```bash 39 | # .env 40 | # [only required if you want to authenticate users by email/password] 41 | RESEND_EMAIL_FROM=support@example.com 42 | ``` 43 | 44 | 4. [Optional] Set the email address to receive the notification emails 45 | 46 | When there is a new submission from a customer, a notification email will be sent to the following email address: 47 | 48 | ```bash 49 | # .env 50 | # [only required if you want to receive notification emails] 51 | RESEND_EMAIL_ADMIN=admin@example.com 52 | ``` 53 | 54 | 5. [Optional] Get the audience id for newsletter 55 | 56 | Create a new audience in Resend and copy the audience id, then set it to the `.env` file. 57 | 58 | This variable is used to support newsletter subscription on the website, if you don't need it, you can skip this step. 59 | 60 | ```bash 61 | # .env 62 | # [only required if you want to support newsletter] 63 | RESEND_AUDIENCE_ID=your_audience_id 64 | ``` 65 | 66 | ![Resend Audience](../../../assets/images/resend-audience.png) 67 | 68 | 69 | 70 | ## Video tutorial 71 | 72 | {/* https://www.youtube.com/embed/W1BsVEwvFsM?list=PLVBbrIi208W_qLhMoEV8-XQi7lrTyPlOM */} 73 |
74 | 83 |
84 | 85 | ## Further Reading 86 | 87 | - [Resend](https://resend.com/) 88 | - [Resend - Domains](https://resend.com/docs/dashboard/domains/cloudflare) 89 | - [Resend - Email API](https://resend.com/docs/api-reference/emails) 90 | - [Resend - Audiences](https://resend.com/docs/dashboard/audiences/introduction) 91 | - [Resend - Broadcasts](https://resend.com/docs/dashboard/broadcasts/introduction) 92 | - [React Email](https://react.email/docs/introduction) 93 | -------------------------------------------------------------------------------- /src/content/docs/configuration/sanity.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Sanity 3 | description: How to configure the Sanity. 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | import { Steps } from '@astrojs/starlight/components'; 8 | 9 | Mkdirs uses [Sanity](https://www.sanity.io/) as a headless CMS, so you can manage the content of the website (including user data, items data, blog posts data, images, etc.) through Sanity Studio, and you don't need to configure the database or the storage anymore. 10 | 11 | ## Configuration 12 | 13 | 14 | 15 | 1. Create an account on [Sanity](https://www.sanity.io/) 16 | 17 | If you don't have an account on Sanity, follow their steps to [signup](https://www.sanity.io/login/sign-up). 18 | 19 | 2. Create a new project 20 | 21 | After signin on Sanity, you can create your project [here](https://www.sanity.io/manage?new-project). 22 | 23 | 3. Get the project id 24 | 25 | After creating the project, you will see the project id under the project name. 26 | 27 | ```bash 28 | # .env 29 | # [required] 30 | NEXT_PUBLIC_SANITY_PROJECT_ID=your_project_id 31 | ``` 32 | 33 | 4. Get the dataset 34 | 35 | The default dataset is `production`, and you can use the default dataset or create a new one. 36 | 37 | ```bash 38 | # .env 39 | # [required] 40 | NEXT_PUBLIC_SANITY_DATASET=your_dataset 41 | ``` 42 | 43 | 46 | 47 | 5. Get the API token 48 | 49 | Go to the project API settings, click on the `Add API token` button, create a new token with **the permissions of `Editor`**, and set it to the `.env` file. 50 | 51 | ```bash 52 | # .env 53 | # [required] 54 | SANITY_API_TOKEN=your_api_token 55 | ``` 56 | 57 | 6. Configure the CORS origins 58 | 59 | Go to the project API settings, click on the `Add CORS origin` button, add the origin of your domain, for example, **`https://your-domain.com`** for production or **`http://localhost:3000`** for local development. 60 | 61 | It's used to allow you to access the Sanity Studio under the `/studio` path, for example, `https://your-domain.com/studio` or `http://localhost:3000/studio`. 62 | 63 | 66 | 67 | ![Sanity CORS](../../../assets/images/sanity-cors.png) 68 | 69 | 70 | 71 | ## Video tutorial 72 | 73 | {/* https://www.youtube.com/embed/8THGP7Wpkic?list=PLVBbrIi208W_qLhMoEV8-XQi7lrTyPlOM */} 74 |
75 | 84 |
85 | 86 | ## Further Reading 87 | 88 | - [Sanity](https://www.sanity.io/) 89 | - [Sanity Content Lake](https://www.sanity.io/docs/datastore) 90 | - [Sanity Studio](https://www.sanity.io/docs/sanity-studio) 91 | - [Sanity Plugins](https://www.sanity.io/plugins) 92 | - [Sanity CLI](https://www.sanity.io/docs/cli-reference) 93 | - [Sanity Courses](https://www.sanity.io/learn) 94 | - [Course: Day one with Sanity](https://www.sanity.io/learn/course/day-one-with-sanity-studio) 95 | - [Course: Sanity Typed content with Sanity TypeGen](https://www.sanity.io/learn/course/typescripted-content) 96 | - [Cheatsheet: GROQ](https://www.sanity.io/docs/query-cheat-sheet) 97 | - [Cheatsheet: Migrating content](https://www.sanity.io/docs/content-migration-cheatsheet) 98 | - [Sanity docs for Localization](https://www.sanity.io/docs/localization) 99 | - [Sanity docs for Block Content](https://www.sanity.io/docs/block-content) 100 | -------------------------------------------------------------------------------- /src/content/docs/configuration/stripe.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Stripe 3 | description: How to manage the payment with Stripe. 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | import { Steps } from '@astrojs/starlight/components'; 8 | 9 | Mkdirs uses [Stripe](https://stripe.com/) as a payment processor. 10 | 11 | ## Configuration 12 | 13 | 14 | 15 | 1. Create an account on [Stripe](https://stripe.com/) 16 | 17 | If you don't have an account on Stripe, follow their steps to [signup](https://dashboard.stripe.com/register). 18 | 19 | 2. Get the Stripe API key 20 | 21 | - Go to your Stripe dashboard. 22 | - Select `Developers` on the top right navigation bar. 23 | - Select `API keys` on the menu under `Developers`. 24 | - Click on the `Reveal live key` (or `Reveal test key` if you are in test mode). 25 | - Copy the secret key and set it to the `.env` file. 26 | 27 | ```bash 28 | # .env 29 | # [only required if you want to support paid submissions] 30 | STRIPE_API_KEY=your_stripe_api_key 31 | ``` 32 | 33 | 37 | 38 | ![Stripe Key](../../../assets/images/stripe-key.png) 39 | 40 | 3. Get the product price id 41 | 42 | - Go to your Stripe dashboard. 43 | - Select `Product Catalog` on the left sidebar. 44 | - Click on the `+ Create Product` button. 45 | - Give your product a clear name and set the one-time fee for user submissions. 46 | - Click on the `Add Product` button to create it. 47 | - Go to the product detail page, click on the `...` button in the pricing section. 48 | - Copy the **price id** and set it to the `.env` file. 49 | 50 | ```bash 51 | # .env 52 | # [only required if you want to support paid submissions and sponsor ads] 53 | NEXT_PUBLIC_STRIPE_PRO_PRICE_ID=your_price_id 54 | NEXT_PUBLIC_STRIPE_SPONSOR_PRICE_ID=your_price_id 55 | ``` 56 | 57 | 64 | 65 | ![Stripe Price](../../../assets/images/stripe-price.png) 66 | 67 | 4. Get the webhook secret 68 | 69 | - Go to your Stripe dashboard. 70 | - Select `Developers` on the top right navigation bar. 71 | - Select `Webhooks` on the menu under `Developers`. 72 | - Click on the `Add an endpoint` button. 73 | - Enter the endpoint URL where Stripe will send events to, for example, `https://your-domain.com/api/webhook`. 74 | - Choose the events you want to receive notifications for, common events include `checkout.session.completed`. 75 | - Copy the webhook secret and set it to the `.env` file. 76 | 77 | 81 | 82 | ```bash 83 | # .env 84 | # [only required if you want to support paid submissions and sponsor ads] 85 | STRIPE_WEBHOOK_SECRET=your_webhook_secret 86 | ``` 87 | 88 | ![Stripe Webhook](../../../assets/images/stripe-webhook.png) 89 | 90 | 91 | 92 | ## Video tutorial 93 | 94 | {/* https://www.youtube.com/embed/xNtFPjhaVKM?list=PLVBbrIi208W_qLhMoEV8-XQi7lrTyPlOM */} 95 |
96 | 107 |
108 | 109 | ## Further Reading 110 | 111 | - [Stripe - API Keys](https://stripe.com/docs/keys) 112 | - [Stripe - Webhooks](https://stripe.com/docs/webhooks) 113 | - [Stripe - Checkout Sessions](https://docs.stripe.com/api/checkout/sessions/create) 114 | -------------------------------------------------------------------------------- /src/content/docs/customization/card.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: How to customize the Item Card 3 | description: How to customize the Item Card of the directory website. 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | 8 | Mkdirs support two kinds of Item Card: `Card with Image` and `Card with Icon` (default). 9 | 10 | Item Card with Image ([item-card.tsx](https://github.com/MkdirsHQ/mkdirs-template/blob/main/src/components/item/item-card.tsx)): 11 | 12 | ![Item Card with Image](../../../assets/images/guide-item-card-image.png) 13 | 14 | Item Card with Icon ([item-card-2.tsx](https://github.com/MkdirsHQ/mkdirs-template/blob/main/src/components/item/item-card-2.tsx)): 15 | 16 | ![Item Card with Icon](../../../assets/images/guide-item-card-icon.png) 17 | 18 | 19 | `Card with Icon` is the default style, and you can change it to `Card with Image` by setting the `SUPPORT_ITEM_ICON` to `false` in the `src/lib/constants.ts` file. 20 | 21 | ```ts 22 | // support item icon, default is true (aka, show item icon) 23 | // NOTE: if you set true, you should make sure the item icon is available 24 | // if you set false, the item card will show image instead of icon 25 | export const SUPPORT_ITEM_ICON = false; 26 | ``` 27 | 28 | 33 | -------------------------------------------------------------------------------- /src/content/docs/customization/category.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: How to add categories and category groups 3 | description: How to add categories and category groups to the directory website. 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | 8 | ## Add categories 9 | 10 | Go to the Sanity Studio, click the `Category Management` button, and then click the `+` button. 11 | 12 | Input the category name, and generate the slug, set the description and priority, then click the `Publish` button. 13 | 14 | ![Add Categories](../../../assets/images/guide-category.png) 15 | 16 | 19 | 20 | After the category is published, you can see the category list in the website like this. 21 | 22 | ![Category List](../../../assets/images/guide-category-list.png) 23 | 24 | ## Add category groups 25 | 26 | Go to the Sanity Studio, click the `Group Management` button, and then click the `+` button. 27 | 28 | Input the group name, and generate the slug, set the description and priority, then click the `Publish` button. 29 | 30 | ![Add Category Groups](../../../assets/images/guide-group.png) 31 | 32 | 35 | 36 | After the group is published, you can see the group list in the website like this. 37 | 38 | ![Group List](../../../assets/images/guide-group-list.png) 39 | 40 | 41 | The category group is supported by default, if you do not want to show the group, you can disable it by setting the `SUPPORT_CATEGORY_GROUP` to `false` in the `src/lib/constants.ts` file. 42 | 43 | ```ts 44 | // support category group, default is true (aka, show category group) 45 | // NOTE: if you set true, you should make sure each category belongs to a group 46 | // if you set false, the category will be shown in the root level 47 | export const SUPPORT_CATEGORY_GROUP = false; 48 | ``` 49 | -------------------------------------------------------------------------------- /src/content/docs/customization/custom-page.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: How to custom website pages 3 | description: How to change or add the website pages. 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | 8 | ## Add custom pages 9 | 10 | Go to the Sanity Studio, click the `Pages` button, and then click the `Create` button. 11 | 12 | Input the page title, and generate the slug, then click the `Publish` button. 13 | 14 | After the page is published, you can see the page in the website via the URL `/[slug]`. 15 | 16 | For example, if the slug is `about`, you can see the page in the website via the URL `/about`. 17 | 18 | You can add About page, Contact page, Privacy page, Terms page, etc, in the Sanity Studio. 19 | 20 | ![Custom Page](../../../assets/images/guide-custom-page.png) 21 | 22 | 25 | 26 | 27 | ## Change Home Page 28 | 29 | There are 3 home page layouts in Mkdirs template, you can change the default home page layout by the following steps. 30 | 31 | 1. Remove the 3 files in the `src/app/(website)/(public)/(home)` folder. 32 | 33 | 2. Copy the files in `src/app/(website)/(test)/(home2)` or `src/app/(website)/(test)/(home3)` folder to the `src/app/(website)/(public)/(home)` folder. 34 | 35 | ![Custom Home Page](../../../assets/images/guide-custom-homepage.png) 36 | -------------------------------------------------------------------------------- /src/content/docs/customization/email.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: How to change or add the emails 3 | description: How to change or add the emails used in the directory website. 4 | --- 5 | 6 | ## Start the email server 7 | 8 | Run the following command to start the email server, and you can see the email server is running on `http://localhost:3333`. 9 | 10 | ```bash 11 | pnpm email 12 | ``` 13 | 14 | ![Email Preview](../../../assets/images/guide-email-preview.png) 15 | 16 | ## Change or add new emails 17 | 18 | The email files are in the `emails` folder, you can change the email files to your own emails. 19 | 20 | Or you can add new email files to the `emails` folder, preview the email in the browser. 21 | 22 | ## Video tutorial 23 | 24 |
25 | 36 |
37 | -------------------------------------------------------------------------------- /src/content/docs/customization/font.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: How to customize the font 3 | description: How to customize the font of the directory website. 4 | --- 5 | 6 | The font file is in the `src/assets/fonts` folder, you can add your custom font file to the `fonts` folder, and define the font in `src/assets/fonts/index.ts`. 7 | 8 | ![Font File](../../../assets/images/guide-font-file.png) 9 | 10 | Then you can use the font in the `src/app/(website)/layout.tsx` file. 11 | 12 | ![Font Definition](../../../assets/images/guide-font-layout.png) 13 | -------------------------------------------------------------------------------- /src/content/docs/customization/information.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: How to customize the information 3 | description: How to customize the information. 4 | --- 5 | 6 | Open the files under `src/config` folder, you can see the `site.ts` file. 7 | 8 | ![Config information](../../../assets/images/guide-config-website.png) 9 | 10 | You can customize the information of the website here, and you can also customize other information in other files under the `config` folder. 11 | 12 | {/* ```ts 13 | export const siteConfig: SiteConfig = { 14 | name: "Directory", 15 | tagline: "This is a demo site for Mkdirs, the best directory website template", 16 | description: 17 | "This is a demo site for Mkdirs template. Mkdirs is the ultimate directory website template. With Mkdirs, you can build any trending and profitable directory website in minutes, packed with Listings, Newsletter, Payment, CMS, Blog, Authentication, SEO, Themes and more", 18 | keywords: [ 19 | "Directory", 20 | "Template", 21 | "Boilerplate", 22 | ], 23 | author: "Mkdirs", 24 | url: SITE_URL, 25 | // please increase the version number when you update the image 26 | image: `${SITE_URL}/og.png?v=1`, 27 | mail: "support@mkdirs.com", 28 | utm: { 29 | source: "mkdirs.com", 30 | medium: "referral", 31 | campaign: "navigation", 32 | }, 33 | links: { 34 | // leave it blank if you don't want to show the link (don't delete) 35 | twitter: "https://x.com/MkdirsHQ", 36 | github: "https://github.com/MkdirsHQ", 37 | youtube: "https://www.youtube.com/@MkdirsHQ", 38 | }, 39 | }; 40 | ``` */} 41 | 42 | For example, if you have changed the name/title/subtitle/menus/logo/theme, your directory website may look like this. 43 | 44 | ![Config information](../../../assets/images/guide-config-website-2.png) 45 | 46 | 47 | ## Video tutorial 48 | 49 | Currently, there is no video tutorial in English for this part, but you can refer to the following video in Chinese to learn how to customize the information. 50 | 51 | ### How to customize the information - Video Tutorial in Chinese (for developers) 52 | 53 |
54 | 65 |
66 | 67 | ### How to customize the information - Video Tutorial in Chinese (for beginners) 68 | 69 |
70 | 81 |
82 | -------------------------------------------------------------------------------- /src/content/docs/customization/logo.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: How to customize the logo 3 | description: How to customize the logo and favicon of the directory website. 4 | --- 5 | 6 | Create a new `logo.png` file and new `favicon.ico` files, put them in the `public` folder. 7 | 8 | You can delete original `logo.png` file and `favicon.ico` files. 9 | 10 | You can create your logo and favicons using [these tools](https://indiehub.best/collection/the-best-logo-generator-tools-in-2025), I prefer [IconKitchen](https://icon.kitchen/) and [Icon Maker](https://ray.so/icon). 11 | 12 | ![Logo and Favicon](../../../assets/images/guide-config-logo.png) 13 | 14 | 15 | ## Video tutorial 16 | 17 | Currently, there is no video tutorial in English for this part, but you can refer to the following video in Chinese to learn how to customize the information. 18 | 19 | ### How to customize the information - Video Tutorial in Chinese (for developers) 20 | 21 |
22 | 33 |
34 | 35 | ### How to customize the information - Video Tutorial in Chinese (for beginners) 36 | 37 |
38 | 49 |
50 | -------------------------------------------------------------------------------- /src/content/docs/customization/theme.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: How to customize the theme 3 | description: How to customize the theme of the directory website. 4 | --- 5 | 6 | Mkdirs uses Shadcn UI for the theme, and you can customize the color themes in [Shadcn UI Theme](https://ui.shadcn.com/themes), then copy the code and replace the existing code in the `src/styles/globals.css` file. 7 | 8 | For example, you can change the color theme to `Blue` by copying the code below to test it. 9 | 10 | ![Theme](../../../assets/images/guide-theme-blue.png) 11 | 12 | 13 | ```css 14 | /* src/styles/globals.css */ 15 | 16 | @layer base { 17 | :root { 18 | --background: 0 0% 100%; 19 | --foreground: 222.2 84% 4.9%; 20 | --card: 0 0% 100%; 21 | --card-foreground: 222.2 84% 4.9%; 22 | --popover: 0 0% 100%; 23 | --popover-foreground: 222.2 84% 4.9%; 24 | --primary: 221.2 83.2% 53.3%; 25 | --primary-foreground: 210 40% 98%; 26 | --secondary: 210 40% 96.1%; 27 | --secondary-foreground: 222.2 47.4% 11.2%; 28 | --muted: 210 40% 96.1%; 29 | --muted-foreground: 215.4 16.3% 46.9%; 30 | --accent: 210 40% 96.1%; 31 | --accent-foreground: 222.2 47.4% 11.2%; 32 | --destructive: 0 84.2% 60.2%; 33 | --destructive-foreground: 210 40% 98%; 34 | --border: 214.3 31.8% 91.4%; 35 | --input: 214.3 31.8% 91.4%; 36 | --ring: 221.2 83.2% 53.3%; 37 | --radius: 0.5rem; 38 | --chart-1: 12 76% 61%; 39 | --chart-2: 173 58% 39%; 40 | --chart-3: 197 37% 24%; 41 | --chart-4: 43 74% 66%; 42 | --chart-5: 27 87% 67%; 43 | } 44 | 45 | .dark { 46 | --background: 222.2 84% 4.9%; 47 | --foreground: 210 40% 98%; 48 | --card: 222.2 84% 4.9%; 49 | --card-foreground: 210 40% 98%; 50 | --popover: 222.2 84% 4.9%; 51 | --popover-foreground: 210 40% 98%; 52 | --primary: 217.2 91.2% 59.8%; 53 | --primary-foreground: 222.2 47.4% 11.2%; 54 | --secondary: 217.2 32.6% 17.5%; 55 | --secondary-foreground: 210 40% 98%; 56 | --muted: 217.2 32.6% 17.5%; 57 | --muted-foreground: 215 20.2% 65.1%; 58 | --accent: 217.2 32.6% 17.5%; 59 | --accent-foreground: 210 40% 98%; 60 | --destructive: 0 62.8% 30.6%; 61 | --destructive-foreground: 210 40% 98%; 62 | --border: 217.2 32.6% 17.5%; 63 | --input: 217.2 32.6% 17.5%; 64 | --ring: 224.3 76.3% 48%; 65 | --chart-1: 220 70% 50%; 66 | --chart-2: 160 60% 45%; 67 | --chart-3: 30 80% 55%; 68 | --chart-4: 280 65% 60%; 69 | --chart-5: 340 75% 55%; 70 | } 71 | } 72 | ``` 73 | 74 | ## Video tutorial 75 | 76 | Currently, there is no video tutorial in English for this part, but you can refer to the following video in Chinese to learn how to customize the information. 77 | 78 | ### How to customize the information - Video Tutorial in Chinese (for developers) 79 | 80 |
81 | 92 |
93 | 94 | ### How to customize the information - Video Tutorial in Chinese (for beginners) 95 | 96 |
97 | 108 |
109 | -------------------------------------------------------------------------------- /src/content/docs/deployment/docker.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Docker 3 | description: How to deploy Mkdirs on Docker. 4 | --- 5 | 6 | import { Steps } from '@astrojs/starlight/components'; 7 | 8 | You can easily deploy Mkdirs on [Docker](https://www.docker.com/). 9 | 10 | ## Deploy with Dockerfile 11 | 12 | Mkdirs comes with a pre-configured Docker file. 13 | 14 | ```bash 15 | # Dockerfile 16 | 17 | # syntax=docker/dockerfile:1 18 | FROM node:20-alpine AS base 19 | 20 | # Install dependencies only when needed 21 | FROM base AS deps 22 | # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. 23 | RUN apk add --no-cache libc6-compat 24 | WORKDIR /app 25 | 26 | # Install dependencies 27 | COPY package.json pnpm-lock.yaml* ./ 28 | RUN corepack enable pnpm && pnpm i --frozen-lockfile 29 | 30 | # Rebuild the source code only when needed 31 | FROM base AS builder 32 | WORKDIR /app 33 | COPY --from=deps /app/node_modules ./node_modules 34 | COPY . . 35 | 36 | # Next.js collects completely anonymous telemetry data about general usage. 37 | # Learn more here: https://nextjs.org/telemetry 38 | # Uncomment the following line in case you want to disable telemetry during the build. 39 | # ENV NEXT_TELEMETRY_DISABLED 1 40 | 41 | RUN corepack enable pnpm \ 42 | && mv next.config.docker.mjs next.config.mjs \ 43 | && pnpm build 44 | 45 | # Production image, copy all the files and run next 46 | FROM base AS runner 47 | WORKDIR /app 48 | 49 | ENV NODE_ENV production 50 | # Uncomment the following line in case you want to disable telemetry during runtime. 51 | # ENV NEXT_TELEMETRY_DISABLED 1 52 | 53 | RUN addgroup --system --gid 1001 nodejs 54 | RUN adduser --system --uid 1001 nextjs 55 | 56 | COPY --from=builder /app/public ./public 57 | 58 | # Set the correct permission for prerender cache 59 | RUN mkdir .next 60 | RUN chown nextjs:nodejs .next 61 | 62 | # Automatically leverage output traces to reduce image size 63 | # https://nextjs.org/docs/advanced-features/output-file-tracing 64 | COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ 65 | COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static 66 | 67 | USER nextjs 68 | 69 | EXPOSE 3000 70 | 71 | ENV PORT 3000 72 | ENV HOSTNAME "0.0.0.0" 73 | 74 | # server.js is created by next build from the standalone output 75 | # https://nextjs.org/docs/pages/api-reference/next-config-js/output 76 | CMD ["node", "server.js"] 77 | ``` 78 | -------------------------------------------------------------------------------- /src/content/docs/deployment/dokploy.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Dokploy 3 | description: How to deploy Mkdirs on Dokploy. 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | import { Steps } from '@astrojs/starlight/components'; 8 | 9 | I personally recommend using [Dokploy](https://dokploy.com/) to deploy Mkdirs, because it's much easier to setup the whole thing and you get the automatic CI/CD pipeline like Vercel out of the box. 10 | 11 | ## Deploy on Dokploy 12 | 13 | 14 | 15 | 1. Create a new project on Dokploy 16 | 17 | Click on the `Create project` button and set the project name and description. 18 | 19 | 2. Create an application in the project 20 | 21 | Click on the `Create services` button and select `Application`, then set the application name and description. 22 | 23 | 3. Set the source code and build type 24 | 25 | Set the source code to the repository, and set the build type to Dockerfile. 26 | 27 | ![Dokploy Settings](../../../assets/images/dokploy-settings.png) 28 | 29 | ![Dokploy Build Type](../../../assets/images/dokploy-buildtype.png) 30 | 31 | 4. Set the environment variables 32 | 33 | Copy the content from the `.env` file and paste them in environment settings. 34 | 35 | 40 | 41 | ![Dokploy Environment Variables](../../../assets/images/dokploy-env.png) 42 | 43 | 5. Start to deploy 44 | 45 | Click on `Deploy` and wait for the deployment to finish. 46 | 47 | ![Dokploy Deploy](../../../assets/images/dokploy-deploy.png) 48 | 49 | 6. Set the domain 50 | 51 | Add the domain you want to use, and make sure to check on `HTTPS`. 52 | 53 | ![Dokploy Domain](../../../assets/images/dokploy-domain.png) 54 | 55 | 7. Done 56 | 57 | Check the application by visiting the domain you set once the deployment is finished. 58 | 59 | 60 | 61 | 62 | ## Video tutorial 63 | 64 | There is no video tutorial for the deployment on Dokploy for now, but you can refer to the following video for the introduction of Dokploy Cloud, and learn how to deploy a Next.js application on Dokploy Cloud. 65 | 66 | After that, you will know how to deploy your directory on Dokploy by following the steps above. 67 | 68 | {/* https://youtu.be/x2s_Y5ON-ms */} 69 |
70 | 79 |
80 | 81 | ## Further reading 82 | 83 | - [Dokploy](https://dokploy.com/) 84 | - [How to install Dokploy on your own server](https://mksaas.me/blog/dokploy) 85 | - [How to install Dokploy on Aliyun ECS server](https://coreychiu.com/blogs/how-to-install-dokploy-on-aliyun-ecs-server) 86 | -------------------------------------------------------------------------------- /src/content/docs/deployment/vercel.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Vercel 3 | description: How to deploy Mkdirs on Vercel. 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | import { Steps } from '@astrojs/starlight/components'; 8 | 9 | You can easily deploy Mkdirs on [Vercel](https://vercel.com/). 10 | 11 | ## Deploy on Vercel 12 | 13 | 14 | 15 | 1. Create an account on [Vercel](https://vercel.com/) 16 | 17 | If you don't have an account on Vercel, follow their steps to [signup](https://vercel.com/signup). 18 | 19 | 2. Create a new project 20 | 21 | Click on the `Add New Project` button, and select the GitHub repository you just created, then click on the `Import` button. 22 | 23 | 3. Set the environment variables 24 | 25 | Copy and paste the environment variables from the `.env` file to the `Environment Variables` section, then click on the `Deploy` button. 26 | 27 | ![Vercel Project](../../../assets/images/vercel-project.png) 28 | 29 | 4. Set the domain 30 | 31 | Add the domain you want to use in the `Domains` section, and add the DNS records to your domain provider, then wait for the DNS records to take effect. 32 | 33 | ![Vercel Domain](../../../assets/images/vercel-domain.png) 34 | 35 | 5. Set the Function Max Duration (Optional) 36 | 37 | 40 | 41 | ![Config AI Function](../../../assets/images/config-ai-function.png) 42 | 43 | 6. Done 44 | 45 | Wait for the deployment to finish, and your directory website should be live on the web. 46 | 47 | 48 | 49 | ## FAQ 50 | 51 | - **Q: How to use Cloudflare as a reverse proxy?** 52 | 53 | A: Follow the steps [here](https://vercel.com/docs/integrations/external-platforms/cloudflare#set-cloudflare-ssl/tls-encryption-mode) to use Cloudflare as a reverse proxy. 54 | 55 | **If you met with `Error: Too many redirects`, you can try to set SSL mode to `Full`.** 56 | 57 | ![Cloudflare SSL](../../../assets/images/vercel-cloudflare-ssl.png) 58 | 59 | ## Video tutorial 60 | 61 |
62 | 73 |
74 | -------------------------------------------------------------------------------- /src/content/docs/faq.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: FAQ 3 | description: Frequently asked questions about Mkdirs. 4 | --- 5 | 6 | import { LinkCard } from '@astrojs/starlight/components'; 7 | 8 | ## General 9 | 10 | ### How to set up the directory website with Mkdirs? 11 | 12 | You can checkout the [documentation](https://docs.mkdirs.com) and the [video tutorials](https://youtube.com/@MkdirsHQ) for the detailed instructions. 13 | I can launch a directory website within 30 minutes, you can too if you follow the instructions. 14 | Feel free to reach out to us via email at [support@mkdirs.com](mailto:support@mkdirs.com) if you have any questions. 15 | 16 | ### How many directory websites can I build with Mkdirs? 17 | 18 | You can build unlimited directory websites with Mkdirs, you only need to pay for the template, no other fees are required. 19 | 20 | ### What am I allowed to do with the boilerplate? 21 | 22 | You are allowed to build and ship unlimited projects with Mkdirs (commercial projects too). 23 | 24 | You are not allowed to: 25 | - Publish the code or parts of it as a template or boilerplate 26 | - Provide the boilerplate code as a service to others, for example, you can't help others launch directory websites with Mkdirs as a service, but if others are willing to pay for the Mkdirs template, you can help them launch directory websites 27 | 28 | ### How to get technical support? 29 | 30 | You can reach out to us via email at [support@mkdirs.com](mailto:support@mkdirs.com). 31 | 32 | ## Technical 33 | 34 | ### How many items can I save to Sanity in Free Plan? 35 | 36 | According to the [Sanity pricing](https://www.sanity.io/pricing), you can save up to 10,000 items in the Free Plan. 37 | 38 | If you upgrade to the Growth plan, you can save up to 25,000 items, and the price is $15/month. 39 | 40 | ### How to sync the source code with the repository? 41 | 42 | You can checkout this [guide](https://docs.mkdirs.com/guide/develop/#how-to-sync-the-code) for the detailed instructions. 43 | 44 | ### How to customize the font or the logo or the theme? 45 | 46 | You can checkout the [documentation](https://docs.mkdirs.com) and the [video tutorials](https://youtube.com/@MkdirsHQ) for the detailed instructions. 47 | 48 | - Customize the font: [https://docs.mkdirs.com/customization/font/](https://docs.mkdirs.com/customization/font/) 49 | - Customize the logo: [https://docs.mkdirs.com/customization/logo/](https://docs.mkdirs.com/customization/logo/) 50 | - Customize the theme: [https://docs.mkdirs.com/customization/theme/](https://docs.mkdirs.com/customization/theme/) 51 | 52 | ### How to find the logs? 53 | 54 | You can checkout the [guide](https://docs.mkdirs.com/guide/develop/#how-to-find-the-logs) for the detailed instructions. 55 | 56 | ### How to import the data from other directory websites? 57 | 58 | You can write a script to export the data from other directory websites, and then import the data to Mkdirs. 59 | 60 | We have provided some example scripts in the codebase, you can refer to them for more information. 61 | 62 | For example, you can use the [Sanity CLI](https://www.sanity.io/docs/cli-reference) feature or [Sanity Client API](https://www.sanity.io/docs/js-client) to import the data to Mkdirs. 63 | 64 | More information can be found in this [Issue](https://github.com/MkdirsHQ/mkdirs-template/issues/34). 65 | 66 | ### How to learn more about Sanity CMS? 67 | 68 | You can checkout this [guide](https://docs.mkdirs.com/guide/sanity/) for the detailed instructions. 69 | 70 | You will learn how to update the Sanity schemas, and how to configure the Sanity Studio, etc. 71 | 72 | We also provide a [list of tutorials and documents](https://docs.mkdirs.com/guide/sanity/#further-reading) about Sanity CMS, you can refer to them for more information. 73 | 74 | ### Does Mkdirs support internationalization? 75 | 76 | No, Mkdirs does not support internationalization, and will not support it in the future, because it will make the boilerplate too heavy. 77 | 78 | I have open sourced another [Directory Boilerplate](https://github.com/javayhu/free-directory-boilerplate), which supports internationalization, you can refer to it for more information. 79 | 80 | If you want to support internationalization, you can email Meepo at [meepo.hyper@gmail.com](mailto:meepo.hyper@gmail.com), he offers a paid service to help you to add the internationalization feature to your directory website. 81 | 82 | And if you want to do it yourself, you can refer to the following documents: 83 | 84 | - Next.js: [https://nextjs.org/docs/app/building-your-application/routing/internationalization](https://nextjs.org/docs/app/building-your-application/routing/internationalization) 85 | - Sanity: [https://www.sanity.io/docs/localization](https://www.sanity.io/docs/localization) 86 | 87 | ## Payment 88 | 89 | ### Does Mkdirs support Lemonsqueezy or other payment services? 90 | 91 | No, Mkdirs does not support Lemonsqueezy or other payment services, only Stripe is supported. 92 | 93 | If you want to support Lemon Squeezy, you can refer to this open source project. 94 | 95 | [https://github.com/lmsqueezy/nextjs-billing](https://github.com/lmsqueezy/nextjs-billing) 96 | 97 | ### How much does it cost to run a directory website? 98 | 99 | With Mkdirs, you can easily launch a directory website for almost zero cost. 100 | 101 | You only pay for your domain, and start with the free plan of [Sanity](https://www.sanity.io/pricing) and [Resend](https://resend.com/pricing) and [Vercel](https://vercel.com/pricing). 102 | 103 | When the traffic of your directory website grows, you can choose to upgrade your plans later. 104 | -------------------------------------------------------------------------------- /src/content/docs/guide/develop.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: How to work with source code 3 | description: How to work with the source code of the directory website. 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | import { Steps } from '@astrojs/starlight/components'; 8 | 9 | ## Folder Structure 10 | 11 | It's simply a [Next.js](https://nextjs.org/) project using [Typescript](https://www.typescriptlang.org/), so the folder structure of the Mkdirs is as follows: 12 | 13 | ![File Structure](../../../assets/images/guide-file-structure.png) 14 | 15 | ## Application Architecture 16 | 17 | ![Application Architecture](../../../assets/images/guide-dev-architecture.png) 18 | 19 | ## How to find the logs 20 | 21 | If you met with some errors, you can find the logs in the `console` of the browser (if it is a client error), or in the `terminal` of the server (if it is a server error). 22 | 23 | If you are using Vercel to deploy your website, you can find the logs in the `Logs` section of the Vercel dashboard. 24 | 25 | **Console Logs** 26 | 27 | ![Console Logs](../../../assets/images/guide-dev-console-logs.png) 28 | 29 | **Vercel Logs** 30 | 31 | ![Vercel Logs](../../../assets/images/guide-dev-logs-vercel.png) 32 | 33 | ## How to batch import data 34 | 35 | Mkdirs uses [Sanity](https://www.sanity.io/) as the content management system, so if you want to batch import data, you need to import the data into Sanity, and it's recommended to read the [Sanity documentation](/guide/sanity) before importing the data. 36 | 37 | If you are familiar with Sanity, you can refer to the scripts in the `scripts` directory in the root of the project to implement batch import of categories, tags, and items. 38 | 39 | By default, there are four scripts in the `scripts` directory in the root of the project: `batch-group.ts`, `batch-category.ts`, `batch-tag.ts`, and `batch-item.ts`, which are used to import category groups, categories, tags, and items, respectively. 40 | 41 | You can test importing data by running the command `pnpm batch` after creating a new project, and you can also refer to the other scripts in the directory too, the corresponding commands can be found in the [`package.json` file](https://github.com/MkdirsHQ/mkdirs-template/blob/main/package.json#L27). 42 | 43 | ```json 44 | "scripts": { 45 | "dev": "next dev", 46 | "build": "next build", 47 | "start": "next start", 48 | "lint": "next lint", 49 | "typegen": "sanity schema extract && sanity typegen generate", 50 | "email": "email dev --dir emails --port 3333", 51 | "export-user-emails": "tsx scripts/export-user-emails.ts", 52 | "microlink:fetch": "tsx scripts/explore-microlink.ts fetch", 53 | "microlink:insights": "tsx scripts/explore-microlink.ts insights", 54 | "microlink:screenshot": "tsx scripts/explore-microlink.ts screenshot", 55 | "microlink:fullpage": "tsx scripts/explore-microlink.ts fullpage", 56 | "aisdk:fetch": "tsx scripts/explore-aisdk.ts fetch", 57 | "aisdk:structure": "tsx scripts/explore-aisdk.ts structure", 58 | "item:remove": "tsx scripts/batch-item.ts remove", 59 | "item:import": "tsx scripts/batch-item.ts import", 60 | "item:update": "tsx scripts/batch-item.ts update", 61 | "item:fetch": "tsx scripts/batch-item.ts fetch", 62 | "batch": "tsx scripts/batch-all.ts", 63 | "batch:remove": "tsx scripts/batch-all.ts remove", 64 | "batch:import": "tsx scripts/batch-all.ts import", 65 | "batch:update": "tsx scripts/batch-all.ts update" 66 | }, 67 | ``` 68 | 69 | 73 | 74 | 75 | ## How to format the code 76 | 77 | We use [Biome](https://biomejs.dev/) to format the code, and it's already configured in the project. 78 | 79 | You can install the [Biome extension](https://marketplace.visualstudio.com/items?itemName=biomejs.biome) in vscode to format the code automatically. 80 | 81 | Or you can run the following command to format the code: 82 | 83 | ```bash 84 | biome format 85 | ``` 86 | 87 | ## How to sync the code 88 | 89 | If you have followed the steps in the [Installation](/installation), and you have a repository named `@your-github-username/your-mkdirs`. 90 | 91 | Follow the steps below to sync the source code from `@MkdirsHQ/mkdirs-template` to your own repository if some updates are available, for example, new features or bug fixes. 92 | 93 | 94 | 95 | 1. Add the upstream repository 96 | 97 | First, you need to add the original repository as a remote repository. 98 | 99 | You can name it `upstream`, and run the following command in your local repository: 100 | 101 | ```bash 102 | git remote add upstream https://github.com/MkdirsHQ/mkdirs-template.git 103 | ``` 104 | 105 | 2. Fetch upstream changes 106 | 107 | Run the following command to fetch all branches and commits from the original repository: 108 | 109 | ```bash 110 | git fetch upstream 111 | ``` 112 | 113 | 3. Switch to your main branch 114 | 115 | Make sure you're on your main branch (usually main or master): 116 | 117 | ```bash 118 | git checkout main 119 | ``` 120 | 121 | 4. Merge upstream changes 122 | 123 | Now, merge the changes from the upstream main branch into your local main branch: 124 | 125 | ```bash 126 | git merge upstream/main --allow-unrelated-histories 127 | ``` 128 | 129 | If you don't want to merge all the changes from the upstream main branch, you can also cherry-pick the specific commits that you want to apply to your local main branch: 130 | 131 | 132 | ```bash 133 | git cherry-pick 134 | ``` 135 | 136 | If you prefer to use vscode extension, you can use [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) to sync the code. 137 | 138 | ![Sync Code](../../../assets/images/guide-sync-code.png) 139 | 140 | 5. Resolve conflicts (if any) 141 | 142 | If conflicts occur during the merge (mainly due to you have made some changes to the source code already), you'll need to resolve them manually. 143 | 144 | After resolving, use `git add` to add the modified files, then use `git commit` to commit the changes. 145 | 146 | 6. Push to your own repository 147 | 148 | Finally, push the updated local main branch to your own repository: 149 | 150 | ```bash 151 | git push origin main 152 | ``` 153 | 154 | 155 | 156 | By following these steps, you can keep your fork in sync with the original repository. It's recommended to perform this process regularly to ensure your fork doesn't fall too far behind. 157 | 158 | ## Further Reading 159 | 160 | - [Next.js](https://nextjs.org/) 161 | - [Course: Learn React Foundation](https://nextjs.org/learn/react-foundations) 162 | - [Course: Learn Next.js](https://nextjs.org/learn) 163 | -------------------------------------------------------------------------------- /src/content/docs/guide/sanity.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: How to work with Sanity CMS 3 | description: How to customize the Sanity schema and GROQ queries. 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | 8 | ## Learn Sanity 9 | 10 | If you are new to Sanity, you can learn it from the [Sanity Courses](https://www.sanity.io/learn), especially the following two courses: 11 | 12 | - [Course: Day one with Sanity](https://www.sanity.io/learn/course/day-one-with-sanity-studio) 13 | - [Course: Sanity Typed content with Sanity TypeGen](https://www.sanity.io/learn/course/typescripted-content) 14 | 15 | These courses are free and will help you understand how to use Sanity, and the following content are based on these courses. 16 | 17 | 18 | ## Add or update the Sanity schema 19 | 20 | The Sanity schema files are in the `src/sanity/schemas/documents` folder, you can change the schema to your own schema, or add new schema, then add the new schema to the `src/sanity/schemas/index.ts` file. 21 | 22 | After you update the Sanity schema, you need to run the following command to generate the types: 23 | 24 | ```bash 25 | pnpm typegen 26 | ``` 27 | 28 | 31 | 32 | For example, you want to add a new field to the `item` schema, you can add the new field to the `src/sanity/schemas/documents/directory/item.ts` file, and then update the `itemSimpleFields` in the `src/sanity/libs/queries.ts` file, so that the new field will be fetched from the Sanity CMS when you query the item information from the GROQ queries. 33 | 34 | 35 | ## Update the GROQ queries 36 | 37 | The GROQ queries are in the `src/sanity/lib/queries.ts` file, you can change the GROQ queries to your own queries, or add new queries to the file. 38 | 39 | After you update the GROQ queries, you need to run the following command to generate the types: 40 | 41 | ```bash 42 | pnpm typegen 43 | ``` 44 | 45 | 48 | 49 | ## Configure the Sanity Studio 50 | 51 | The configuration of the Sanity Studio is in the `sanity.config.ts` file, you can customize the Sanity Studio to your own needs. 52 | 53 | For example, you can find a new [Sanity Plugin](https://www.sanity.io/plugins) and add it to the Sanity Studio. 54 | 55 | You can also change the default layout structure, according to the [Sanity Structure Builder](https://www.sanity.io/docs/structure-builder-introduction). 56 | 57 | 58 | ## Further Reading 59 | 60 | - [Sanity](https://www.sanity.io/) 61 | - [Sanity Content Lake](https://www.sanity.io/docs/datastore) 62 | - [Sanity Studio](https://www.sanity.io/docs/sanity-studio) 63 | - [Sanity Plugins](https://www.sanity.io/plugins) 64 | - [Sanity CLI](https://www.sanity.io/docs/cli-reference) 65 | - [Sanity Structure Builder](https://www.sanity.io/docs/structure-builder-introduction) 66 | - [Sanity Courses](https://www.sanity.io/learn) 67 | - [Course: Day one with Sanity](https://www.sanity.io/learn/course/day-one-with-sanity-studio) 68 | - [Course: Sanity Typed content with Sanity TypeGen](https://www.sanity.io/learn/course/typescripted-content) 69 | - [Cheatsheet: GROQ](https://www.sanity.io/docs/query-cheat-sheet) 70 | - [Cheatsheet: Migrating content](https://www.sanity.io/docs/content-migration-cheatsheet) 71 | - [Sanity docs for Localization](https://www.sanity.io/docs/localization) 72 | - [Sanity docs for Block Content](https://www.sanity.io/docs/block-content) 73 | -------------------------------------------------------------------------------- /src/content/docs/guide/sponsor-ads.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Sponsor Ads 3 | description: How to display sponsor ads. 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | import { Steps } from '@astrojs/starlight/components'; 8 | 9 | Sponsor ads are one of the main sources of revenue for directories. Sponsor ads are displayed in the list pages or detail pages. Mkdirs template supports sponsor ads submission and display, only one sponsor ad can be displayed at a time. 10 | 11 | The default process for displaying sponsor ads is as follows. 12 | 13 | ## Display Sponsor Ads 14 | 15 | 16 | 17 | 1. User fills out the submission form and pays the sponsor fee 18 | 19 | User clicks the "Submit" button on the directory website, fills out the form, and pays the sponsor fee. 20 | 21 | 24 | 25 | ![Sponsor](../../../assets/images/guide-payment-sponsor.png) 26 | 27 | 2. Admin communicates with the user to set the display time of the sponsor ad 28 | 29 | The admin communicates with the user to set the display time of the sponsor ad, and then sets the display time of the sponsor ad in Sanity Studio, and checks the `Sponsor` option. 30 | 31 | 34 | 35 | ![Sponsor Status](../../../assets/images/guide-sponsor-status.png) 36 | 37 | ![Sponsor Config](../../../assets/images/guide-sponsor-config.png) 38 | 39 | 3. The directory website automatically displays the sponsor ad 40 | 41 | After the display time of the sponsor ad is set, the directory website will automatically display the sponsor ad at the specified time. 42 | 43 | ![Sponsor](../../../assets/images/guide-ad-sponsor.png) 44 | 45 | ![Sponsor](../../../assets/images/guide-ad-sponsor-2.png) 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/content/docs/guide/submission.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: How to submit items 3 | description: How to submit new items to the directory. 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | import { Steps } from '@astrojs/starlight/components'; 8 | 9 | ## Free Submission 10 | 11 | ### How users submit new item to the directory 12 | 13 | 14 | 15 | 1. Users fill in the submission form 16 | 17 | Users click the "Submit" button on the directory page, and fill in the form with the required information, then submit to review. 18 | 19 | 25 | 26 | ![Submit](../../../assets/images/guide-submission-user.png) 27 | 28 | 2. Admins review the submission and approve it or reject it 29 | 30 | Admins will review the submission, and approve it or reject it, if reject it, a rejection message will be sent to the user. 31 | 32 | ![Review](../../../assets/images/guide-submission-review.png) 33 | 34 | 37 | 38 | ![Send notification email](../../../assets/images/guide-send-notification-email.png) 39 | 40 | 3. Users publish the submission 41 | 42 | After the submission is approved, users can publish the submission to the directory by clicking the "Publish" button whenever they want. After publishing, the item will be displayed in the directory. 43 | 44 | ![Publish](../../../assets/images/guide-submission-publish.png) 45 | 46 | 47 | 48 | ### How admins submit new item to the directory 49 | 50 | Admins can submit new item to the directory by clicking the "Submit" button on the directory page like users, or by adding a new item in the Sanity Studio directly. 51 | 52 | ![Studio](../../../assets/images/guide-submission-admin.png) 53 | 54 | Please make sure to set the `Publish Date` field, and the `Free Plan Status` field to `approved` before publishing. After publishing, the item will be displayed in the directory. Because Sanity has cache for API requests, it may take a few minutes to see the content on the directory page. 55 | 56 | ![Approved](../../../assets/images/guide-submission-approved.png) 57 | 58 | 59 | ## Paid Submission 60 | 61 | Users click the "Submit" button on the directory website, fill out the form, and pay the `PRO` fee. 62 | 63 | After payment, the admin does not need to review it, and the user can publish it immediately or wait for a suitable time to publish it. 64 | 65 | ![Feature](../../../assets/images/guide-payment-feature.png) 66 | 67 | 68 | ## Video tutorial 69 | 70 | This video demonstrates how to submit a new item to the directory for free. 71 | 72 |
73 | 84 |
85 | 86 | This video demonstrates how to submit a new item to the directory after payment. 87 | 88 |
89 | 100 |
101 | -------------------------------------------------------------------------------- /src/content/docs/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Introduction 3 | description: Learn about Mkdirs and how it works. 4 | --- 5 | 6 | import { LinkCard } from '@astrojs/starlight/components'; 7 | 8 | 👋 Hello, welcome to [Mkdirs](https://mkdirs.com)! 9 | 10 | [Mkdirs](https://mkdirs.com) is the best directory website template, you can launch any profitable directory website in minutes, packed with AI Submission, Listings, Payment, Submission, CMS, Blog, Authentication, Newsletter, SEO, Themes and more. 11 | 12 | **The documentation and the video tutorials are available in [🇬🇧 English](https://docs.mkdirs.com) and [🇨🇳 Chinese](https://docs.mkdirs.com/zh-cn).** 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | ## Further Reading 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/content/docs/installation.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Installation 3 | description: How to launch your directory website with Mkdirs. 4 | --- 5 | 6 | import { Steps } from '@astrojs/starlight/components'; 7 | import { LinkCard } from '@astrojs/starlight/components'; 8 | 9 | Learn how to launch your directory website with Mkdirs. 10 | 11 | ## Installation Guide 12 | 13 | 14 | 15 | 1. Create your own repository 16 | 17 | Click on `Fork` button on the top right corner of [mkdirs-template](https://github.com/MkdirsHQ/mkdirs-template) to create your own repository, set the name of the repository and make sure to set it to private. 18 | 19 | 2. Clone the Github repository 20 | 21 | ```bash 22 | git clone https://github.com/your-username/.git 23 | ``` 24 | 25 | 3. Install the dependencies 26 | 27 | Make sure to install the dependencies (PNPM recommended). 28 | 29 | ```bash 30 | cd 31 | pnpm install 32 | ``` 33 | 34 | 4. Copy the `.env.example` file to `.env` 35 | 36 | ```bash 37 | cp .env.example .env 38 | ``` 39 | 40 | 5. Configure the environment variables 41 | 42 | Update the environment variables with your own values, learn more about configuring the environment variables [here](/configuration/sanity/). 43 | 44 | ```bash 45 | # .env 46 | 47 | # "http://localhost:3000" or "https://mkdirs.com" 48 | NEXT_PUBLIC_APP_URL= 49 | 50 | # ----------------------------------------------------------------------------- 51 | # Dataset & Storage (Sanity) 52 | # ----------------------------------------------------------------------------- 53 | NEXT_PUBLIC_SANITY_DATASET= 54 | NEXT_PUBLIC_SANITY_PROJECT_ID= 55 | SANITY_API_TOKEN= 56 | 57 | # ----------------------------------------------------------------------------- 58 | # Email (Resend) 59 | # ----------------------------------------------------------------------------- 60 | RESEND_API_KEY= 61 | RESEND_EMAIL_FROM= 62 | RESEND_EMAIL_ADMIN= 63 | RESEND_AUDIENCE_ID= 64 | 65 | # ----------------------------------------------------------------------------- 66 | # Analytics (OpenPanel & Google Analytics) 67 | # ----------------------------------------------------------------------------- 68 | NEXT_PUBLIC_OPENPANEL_CLIENT_ID= 69 | NEXT_PUBLIC_GOOGLE_ANALYTICS_ID= 70 | 71 | # ----------------------------------------------------------------------------- 72 | # Payment (Stripe) 73 | # ----------------------------------------------------------------------------- 74 | STRIPE_API_KEY= 75 | STRIPE_WEBHOOK_SECRET= 76 | NEXT_PUBLIC_STRIPE_PRO_PRICE_ID= 77 | 78 | # ----------------------------------------------------------------------------- 79 | # Authentication (NextAuth) 80 | # ----------------------------------------------------------------------------- 81 | AUTH_SECRET= 82 | 83 | AUTH_GOOGLE_ID= 84 | AUTH_GOOGLE_SECRET= 85 | 86 | AUTH_GITHUB_ID= 87 | AUTH_GITHUB_SECRET= 88 | ``` 89 | 90 | 6. Start the development server 91 | 92 | Start the development server and open it in your browser at http://localhost:3000 93 | 94 | ```bash 95 | pnpm dev 96 | ``` 97 | 98 | 7. Build for production 99 | 100 | Build the application to generate code for production. 101 | 102 | ```bash 103 | pnpm build 104 | ``` 105 | 106 | 8. Deploy 107 | 108 | Follow the deployment guides to deploy your application on your favorite platform. 109 | 110 | - [Vercel](/deployment/vercel) 111 | - [Docker](/deployment/docker) 112 | - [Dokploy](/deployment/dokploy) 113 | 114 | 115 | 116 | ## Video tutorial 117 | 118 | {/* https://www.youtube.com/embed/etdRxqls8Co?list=PLVBbrIi208W_qLhMoEV8-XQi7lrTyPlOM */} 119 |
120 | 129 |
130 | 131 | ## What's next? 132 | 133 | Once you have deployed your application, it's recommended to set up a process to sync the source code from `MkdirsHQ/mkdirs-template` to your own repository if some updates are available, for example, new features or bug fixes. 134 | 135 | Learn more about how to sync the source code in the [Development](/guide/develop) section. 136 | 137 | 138 | ## Further reading 139 | 140 | 141 | -------------------------------------------------------------------------------- /src/content/docs/prerequisites.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Prerequisites 3 | description: Prerequisites to start with Mkdirs. 4 | --- 5 | 6 | import { Steps } from '@astrojs/starlight/components'; 7 | import { LinkCard } from '@astrojs/starlight/components'; 8 | 9 | Learn how to set up the prerequisites to start with Mkdirs. 10 | 11 | ## Prerequisites 12 | 13 | 14 | 15 | 1. Node.js 16 | 17 | Make sure you have installed Node.js v18 or later, if you don't have it, you can install it from [Node.js official website](https://nodejs.org/en/download/). 18 | 19 | ```bash 20 | # Check if Node.js is installed 21 | node -v 22 | ``` 23 | 24 | 2. Git 25 | 26 | Make sure you have installed Git, if you don't have it, you can install it from [Git official website](https://git-scm.com/downloads). 27 | 28 | ```bash 29 | # Check if Git is installed 30 | git --version 31 | ``` 32 | 33 | 3. PNPM 34 | 35 | Make sure you have installed PNPM, if you don't have it, you can install it from [PNPM official website](https://pnpm.io/installation). 36 | 37 | ```bash 38 | # Install PNPM 39 | npm install -g pnpm 40 | 41 | # Check if PNPM is installed 42 | pnpm --version 43 | ``` 44 | 45 | 46 | 47 | 48 | ## Further reading 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/configuration/ai.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: AI模型 3 | description: 如何配置AI模型相关的环境变量。 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | import { Steps } from '@astrojs/starlight/components'; 8 | 9 | Mkdirs 在提交界面使用 AI 模型来分析网站的内容,并将分析结果自动填充到提交表单中,从而大幅度提高导航站提交和数据录入流程的效率。 10 | 11 | Mkdirs 使用 [Vercel AI SDK](https://sdk.vercel.ai/) 作为 AI 模型的封装,并默认支持 [OpenAI ChatGPT](https://openai.com/)、[Google Gemini](https://gemini.google.com/)、[DeepSeek](https://www.deepseek.com/)、[XAI](https://x.ai/) 和 [OpenRouter](https://openrouter.ai/) 5个模型,可以根据导航站的需求选择使用。 12 | 13 | ## 配置 14 | 15 | 16 | 17 | 1. 确定要使用的 AI 模型 18 | 19 | 您可以选择使用 `google`、`deepseek`、`openai`、`xai` 或 `openrouter` 作为 AI 模型,并在 `.env` 文件中设置 `DEFAULT_AI_PROVIDER` 变量。 20 | 21 | 26 | 27 | ```bash 28 | # .env 29 | # [only required if you are using AI models to auto fill the submission form] 30 | # default ai provider: ``, `google`, `deepseek`, `openai`, `xai`, `openrouter` 31 | # ----------------------------------------------------------------------------- 32 | DEFAULT_AI_PROVIDER= 33 | ``` 34 | 35 | 2. 获取对应 AI 模型的 API Key 36 | 37 | 2.1 获取 Google Gemini API Key 38 | 39 | 获取 API Key 的链接:[Google Gemini API Key](https://aistudio.google.com/apikey) 40 | 41 | ```bash 42 | # .env 43 | # [only required if you are using Google Gemini] 44 | # NOTE: if you set `DEFAULT_AI_PROVIDER=google`, you should set this API_KEY 45 | # ----------------------------------------------------------------------------- 46 | GOOGLE_GENERATIVE_AI_API_KEY= 47 | ``` 48 | 49 | 2.2 获取 DeepSeek API Key 50 | 51 | 获取 API Key 的链接:[DeepSeek API Key](https://platform.deepseek.com/api_keys) 52 | 53 | ```bash 54 | # .env 55 | # [only required if you are using DeepSeek] 56 | # NOTE: if you set `DEFAULT_AI_PROVIDER=deepseek`, you should set this API_KEY 57 | # ----------------------------------------------------------------------------- 58 | DEEPSEEK_API_KEY= 59 | ``` 60 | 61 | 2.3 获取 OpenAI ChatGPT API Key 62 | 63 | 获取 API Key 的链接:[OpenAI ChatGPT API Key](https://platform.openai.com/settings/organization/api-keys) 64 | 65 | ```bash 66 | # .env 67 | # [only required if you are using OpenAI] 68 | # NOTE: if you set `DEFAULT_AI_PROVIDER=openai`, you should set this API_KEY 69 | # ----------------------------------------------------------------------------- 70 | OPENAI_API_KEY= 71 | ``` 72 | 73 | 2.4 获取 XAI API Key 74 | 75 | 获取 API Key 的链接:[XAI API Key](https://console.x.ai/) 76 | 77 | ```bash 78 | # .env 79 | # [only required if you are using XAI] 80 | # NOTE: if you set `DEFAULT_AI_PROVIDER=xai`, you should set this API_KEY 81 | # ----------------------------------------------------------------------------- 82 | XAI_API_KEY= 83 | ``` 84 | 85 | 2.5 获取 OpenRouter API Key 86 | 87 | 获取 API Key 的链接:[OpenRouter API Key](https://openrouter.ai/settings/keys) 88 | 89 | ```bash 90 | # .env 91 | # [only required if you are using OpenRouter] 92 | # NOTE: if you set `DEFAULT_AI_PROVIDER=openrouter`, you should set this API_KEY 93 | # ----------------------------------------------------------------------------- 94 | OPENROUTER_API_KEY= 95 | OPENROUTER_MODEL= 96 | ``` 97 | 98 | 3. 启用 AI 自动填表的功能 99 | 100 | 如果需要启用 AI 模型实现自动填表的功能,请将 `SUPPORT_AI_SUBMIT` 设置为 `true`。 101 | 102 | 107 | 108 | ```bash 109 | # src/lib/constants.ts 110 | # support AI submit, default is false 111 | # NOTE: if you set true, you should make sure the AI provider 112 | # and the API_KEY is set in the env variables. 113 | # if something is wrong in AI submit, you can set false to disable it. 114 | export const SUPPORT_AI_SUBMIT = true; 115 | ``` 116 | 117 | 118 | 119 | 配置完成之后,如果开启 AI 自动填表功能,在提交表单时,就会出现 "AI 自动填充" 按钮,点击该按钮,AI 模型会自动解析网页内容并自动填充表单。 120 | 121 | ![AI Auto Fill](../../../../assets/images/guide-submission-autofill.png) 122 | 123 | ## 视频教程 124 | 125 | 这个视频演示了如何使用 AI 模型自动填充提交表单的功能流程。 126 | 127 |
128 | 139 |
140 | 141 | ## 进一步阅读 142 | 143 | - [Vercel AI SDK](https://sdk.vercel.ai/) 144 | - [DeepSeek API Key](https://platform.deepseek.com/api_keys) 145 | - [Google Gemini API Key](https://aistudio.google.com/apikey) 146 | - [OpenAI ChatGPT API Key](https://platform.openai.com/settings/organization/api-keys) 147 | - [XAI API Key](https://console.x.ai/) 148 | - [OpenRouter API Key](https://openrouter.ai/settings/keys) -------------------------------------------------------------------------------- /src/content/docs/zh-cn/configuration/analytics.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Analytics 3 | description: 如何配置 Analytics 相关环境变量。 4 | --- 5 | 6 | import { Steps } from '@astrojs/starlight/components'; 7 | 8 | Mkdirs 使用 [Google Analytics](https://analytics.google.com/) 或 [OpenPanel](https://openpanel.dev/) 作为 Analytics 服务,但您也可以添加其他 Analytics 服务,未来我们将支持更多 Analytics 服务。 9 | 10 | ## Google Analytics 11 | 12 | 按照 [Google Analytics 官方教程](https://support.google.com/analytics/answer/9304153) 为网站设置 Google Analytics。 13 | 14 | 然后复制 Google Analytics ID,并将其设置到 `.env` 文件中。 15 | 16 | ```bash 17 | # .env 18 | # [only required if you are using Google Analytics] 19 | NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=your_google_analytics_id; 20 | ``` 21 | 22 | ![Google Analytics](../../../../assets/images/analytics-google.png) 23 | 24 | ## OpenPanel Analytics 25 | 26 | 27 | 28 | 1. 在 [OpenPanel](https://openpanel.dev//login) 创建一个账户 29 | 30 | 如果您没有账户,请按照他们的 [步骤](https://dashboard.openpanel.dev/login) 创建您的账户。 31 | 32 | 2. 创建一个新项目 33 | 34 | 点击 `Create Project` 按钮,输入项目名称以创建一个新项目。 35 | 36 | 3. 创建一个新客户端 37 | 38 | 点击项目名称旁边的 `...` 按钮,并选择 `Projects`。 39 | 40 | 点击 `New Client` 按钮,并输入域名以创建一个新客户端。 41 | 42 | 4. 获取 OpenPanel 客户端 ID 43 | 44 | 一旦客户端创建完成,复制 `Client ID`,并将其设置到 `.env` 文件中。 45 | 46 | ```bash 47 | # .env 48 | # [only required if you are using OpenPanel Analytics] 49 | NEXT_PUBLIC_OPENPANEL_CLIENT_ID=your_open_panel_client_id; 50 | ``` 51 | 52 | ![OpenPanel Client](../../../../assets/images/openpanel-client.png) 53 | 54 | 55 | 56 | ## Umami Analytics 57 | 58 | 59 | 60 | 1. 在 [Umami](https://umami.is) 创建一个账户 61 | 62 | 如果您没有账户,请按照步骤创建您的账户。 63 | 64 | 2. 创建一个新网站 65 | 66 | 登录后,点击 `Add Website` 按钮并输入您的网站详情。 67 | 68 | 3. 获取网站 ID 69 | 70 | 网站创建完成后,您可以在网站设置中找到网站 ID。复制它并将其与脚本 URL 一起设置到 `.env` 文件中。 71 | 72 | ```bash 73 | # .env 74 | # [only required if you are using Umami Analytics] 75 | NEXT_PUBLIC_UMAMI_WEBSITE_ID=your_website_id 76 | NEXT_PUBLIC_UMAMI_SCRIPT=https://cloud.umami.is/script.js 77 | ``` 78 | 79 | 80 | 81 | ## Plausible Analytics 82 | 83 | 84 | 85 | 1. 在 [Plausible](https://plausible.io) 创建一个账户 86 | 87 | 如果您没有账户,请按照步骤创建您的账户。 88 | 89 | 2. 添加新站点 90 | 91 | 登录后,点击 `Add a site` 按钮并输入您的域名。 92 | 93 | 3. 配置域名 94 | 95 | 站点添加完成后,复制您的域名并将其与脚本 URL 一起设置到 `.env` 文件中。 96 | 97 | ```bash 98 | # .env 99 | # [only required if you are using Plausible Analytics] 100 | NEXT_PUBLIC_PLAUSIBLE_DOMAIN=your_domain 101 | NEXT_PUBLIC_PLAUSIBLE_SCRIPT=https://plausible.io/js/script.js 102 | ``` 103 | 104 | 105 | 106 | ## 视频教程 107 | 108 | 视频教程有2个版本,一个是开发者教程,一个是初学者教程,请根据自己的实际情况选择观看。 109 | 110 | ### 配置 Analytics 环境变量 - 开发者教程 111 | 112 |
113 | 124 |
125 | 126 | ### 配置 Analytics 环境变量 - 初学者教程 127 | 128 |
129 | 138 |
139 | 140 | ## 延伸阅读 141 | 142 | - [Google Analytics](https://analytics.google.com/) 143 | - [OpenPanel Analytics](https://openpanel.dev/) 144 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/configuration/auth.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Auth 3 | description: 如何配置 Authjs 相关环境变量。 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | import { Steps } from '@astrojs/starlight/components'; 8 | 9 | Mkdirs 使用 [Auth.js v5](https://authjs.dev/) 进行身份认证,支持邮箱+密码、GitHub、Google 三种认证方式。 10 | 11 | ## 配置 12 | 13 | 14 | 15 | 1. 生成 `AUTH_SECRET` 变量 16 | 17 | `AUTH_SECRET` 是一个随机值,您可以通过运行以下命令生成一个: 18 | 19 | ```bash 20 | npx auth secret 21 | 22 | # or 23 | openssl rand -base64 32 24 | ``` 25 | 26 | 然后将它设置到 `.env` 文件中。 27 | 28 | ```bash 29 | # .env 30 | # [required] 31 | AUTH_SECRET=secret 32 | ``` 33 | 34 | 2. [可选] 获取 GitHub 客户端变量 35 | 36 | 如果您想使用 GitHub 作为 OAuth 提供商,您需要更新 `AUTH_GITHUB_ID` 和 `AUTH_GITHUB_SECRET` 变量。 37 | 38 | 按照 [这里](https://authjs.dev/guides/configuring-github) 的步骤,从 [GitHub Developer Settings](https://github.com/settings/developers)上,获取 `client_id` 和 `client_secret`。 39 | 40 | 对于回调 URL,在线上环境下,它是 **`https://your-domain.com/api/auth/callback/github`**,在本地开发环境下,它是 **`http://localhost:3000/api/auth/callback/github`**。 41 | 42 | ```bash 43 | # .env 44 | # [only required if you want to support GitHub authentication] 45 | AUTH_GITHUB_ID = your_secret_client_id 46 | AUTH_GITHUB_SECRET = your_secret_client 47 | ``` 48 | 49 | 53 | 54 | ![GitHub Client](../../../../assets/images/github-client.png) 55 | 56 | 3. [可选] 获取 Google 客户端变量 57 | 58 | 如果您想使用 Google 作为 OAuth 提供商,您需要更新 `AUTH_GOOGLE_ID` 和 `AUTH_GOOGLE_SECRET` 变量。 59 | 60 | 您可以从 [Google Cloud Console](https://console.cloud.google.com/apis/credentials) 获取 `client_id` 和 `client_secret`。 61 | 62 | 对于回调 URL,在线上环境下,它是 **`https://your-domain.com/api/auth/callback/google`**,在本地开发环境下,它是 **`http://localhost:3000/api/auth/callback/google`**。 63 | 64 | ```bash 65 | # .env 66 | # [only required if you want to support Google authentication] 67 | AUTH_GOOGLE_ID = your_secret_client_id.apps.googleusercontent.com 68 | AUTH_GOOGLE_SECRET = your_secret_client 69 | ``` 70 | 71 | 75 | 76 | ![Google Client](../../../../assets/images/google-client.png) 77 | 78 | 79 | 80 | 81 | 96 | 97 | ## 视频教程 98 | 99 | 视频教程有2个版本,一个是开发者教程,一个是初学者教程,请根据自己的实际情况选择观看。 100 | 101 | ### 配置 Authjs 环境变量 - 开发者教程 102 | 103 |
104 | 115 |
116 | 117 | ### 配置 Authjs 环境变量 - 初学者教程 118 | 119 |
120 | 129 |
130 | 131 | ### Next Auth V5 教程 132 | 133 | 如果您对 Next Auth V5 感兴趣,可以参考以下视频教程,它是一个更高级更全面的 Next Auth V5 指南,比官方文档好得多。 134 | 135 |
136 | 147 |
148 | 149 | ## 延伸阅读 150 | 151 | - [Auth.js v5](https://authjs.dev/getting-started/introduction) 152 | - [Auth.js v5 - Environment Variables](https://authjs.dev/guides/environment-variables) 153 | - [Auth.js v5 - OAuth with GitHub](https://authjs.dev/guides/configuring-github) 154 | - [Auth.js v5 - Database Adapter](https://authjs.dev/guides/creating-a-database-adapter) 155 | - [Auth.js v5 - Data Models](https://authjs.dev/concepts/database-models) 156 | - [YouTube Video - Next Auth V5 - Advanced Guide (2024)](https://www.youtube.com/watch?v=1MTyCvS05V4) 157 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/configuration/resend.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Resend 3 | description: 如何配置 Resend 相关环境变量。 4 | --- 5 | 6 | import { Steps } from '@astrojs/starlight/components'; 7 | 8 | Mkdirs 使用 [Resend](https://resend.com/) 作为邮件服务,支持发送邮件、接收通知邮件、支持订阅功能。 9 | 10 | ## 配置 11 | 12 | 13 | 14 | 1. 在 [Resend](https://resend.com/) 创建一个账户 15 | 16 | 如果您没有 Resend 账户,请按照他们提供的步骤进行 [注册](https://resend.com/signup)。 17 | 18 | 登录 Resend 后,按照他们提供的步骤 [将您的域名添加到 Resend](https://resend.com/docs/dashboard/domains/cloudflare)。 19 | 20 | 2. 获取 Resend API 密钥 21 | 22 | 点击左侧导航栏的 `API Keys`,点击 `Create API key` 按钮,将密钥设置到 `.env` 文件中。 23 | 24 | 请确保 API 密钥具有 `Full Access` 权限。 25 | 26 | ```bash 27 | # .env 28 | # [only required if you want to authenticate users by email/password] 29 | RESEND_API_KEY=your_api_key 30 | ``` 31 | 32 | ![Resend Keys](../../../../assets/images/resend-keys.png) 33 | 34 | 3. 设置发送邮件的邮箱地址 35 | 36 | 发送邮件时,例如注册邮件,邮件将来自以下邮箱地址: 37 | 38 | ```bash 39 | # .env 40 | # [only required if you want to authenticate users by email/password] 41 | RESEND_EMAIL_FROM=support@example.com 42 | ``` 43 | 44 | 4. [可选] 设置接收通知邮件的邮箱地址 45 | 46 | 当有新的提交时,将发送通知邮件到以下邮箱地址: 47 | 48 | ```bash 49 | # .env 50 | # [only required if you want to receive notification emails] 51 | RESEND_EMAIL_ADMIN=admin@example.com 52 | ``` 53 | 54 | 5. [可选] 获取订阅的 ID 55 | 56 | 在 Resend 中创建一个新订阅,复制订阅 ID,然后将其设置到 `.env` 文件中。 57 | 58 | 该变量用于支持网站的订阅功能,如果不需要订阅功能,可以跳过此步骤。 59 | 60 | ```bash 61 | # .env 62 | # [only required if you want to support newsletter] 63 | RESEND_AUDIENCE_ID=your_audience_id 64 | ``` 65 | 66 | ![Resend Audience](../../../../assets/images/resend-audience.png) 67 | 68 | 69 | 70 | ## 视频教程 71 | 72 | 视频教程有2个版本,一个是开发者教程,一个是初学者教程,请根据自己的实际情况选择观看。 73 | 74 | ### 配置 Resend 环境变量 - 开发者教程 75 |
76 | 85 |
86 | 87 | ### 配置 Resend 环境变量 - 初学者教程 88 | 89 |
90 | 99 |
100 | 101 |
102 | 111 |
112 | 113 | 114 | ## 延伸阅读 115 | 116 | - [Resend](https://resend.com/) 117 | - [Resend - Domains](https://resend.com/docs/dashboard/domains/cloudflare) 118 | - [Resend - Email API](https://resend.com/docs/api-reference/emails) 119 | - [Resend - Audiences](https://resend.com/docs/dashboard/audiences/introduction) 120 | - [Resend - Broadcasts](https://resend.com/docs/dashboard/broadcasts/introduction) 121 | - [React Email](https://react.email/docs/introduction) 122 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/configuration/sanity.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Sanity 3 | description: 如何配置 Sanity 相关环境变量. 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | import { Steps } from '@astrojs/starlight/components'; 8 | 9 | Mkdirs 使用 [Sanity](https://www.sanity.io/) 作为 CMS,您可以通过 Sanity Studio 管理网站所有内容(包括用户数据、导航数据、文章数据、图片等),您不再需要配置其他数据库或存储。 10 | 11 | ## 配置 12 | 13 | 14 | 15 | 1. 在 [Sanity](https://www.sanity.io/) 创建一个账户 16 | 17 | 如果您没有 Sanity 账户,请按照他们提供的步骤进行 [注册](https://www.sanity.io/login/sign-up)。 18 | 19 | 2. 创建一个新项目 20 | 21 | 登录 Sanity 后,您可以在 [这里](https://www.sanity.io/manage?new-project) 创建新项目。 22 | 23 | 3. 获取项目 ID 24 | 25 | 创建项目后,您可以在项目名称下看到项目 ID。 26 | 27 | ```bash 28 | # .env 29 | # [required] sanity project id 30 | NEXT_PUBLIC_SANITY_PROJECT_ID=your_project_id 31 | ``` 32 | 33 | 4. 获取数据集 34 | 35 | 默认数据集是 `production`,您可以使用默认数据集或创建一个新数据集。 36 | 37 | 40 | 41 | ```bash 42 | # .env 43 | # [required] production by default, you can set your own dataset name 44 | NEXT_PUBLIC_SANITY_DATASET=your_dataset 45 | ``` 46 | 47 | 5. 获取 API 令牌 48 | 49 | 进入项目 API 设置,点击 `Add API token` 按钮,创建一个新令牌,权限是 `Editor`,并将其设置到 `.env` 文件中。 50 | 51 | ```bash 52 | # .env 53 | # [required] sanity api token 54 | SANITY_API_TOKEN=your_api_token 55 | ``` 56 | 57 | 6. 配置 CORS 来源 58 | 59 | 进入项目 API 设置,点击 `Add CORS origin` 按钮,添加您的域名,例如线上环境的 **`https://your-domain.com`** 或本地开发的 **`http://localhost:3000`**。 60 | 61 | 它将用于允许您通过 `/studio` 路径访问 Sanity Studio,例如 `https://your-domain.com/studio` 或 `http://localhost:3000/studio`。 62 | 63 | 66 | 67 | ![Sanity CORS](../../../../assets/images/sanity-cors.png) 68 | 69 | 70 | 71 | 76 | 77 | ## 视频教程 78 | 79 | 视频教程有2个版本,一个是开发者教程,一个是初学者教程,请根据自己的实际情况选择观看。 80 | 81 | ### 配置 Sanity 环境变量 - 开发者教程 82 | 83 |
84 | 95 |
96 | 97 | ### 配置 Sanity 环境变量 - 初学者教程 98 | 99 |
100 | 111 |
112 | 113 | ## 延伸阅读 114 | 115 | - [Sanity](https://www.sanity.io/) 116 | - [Sanity Content Lake](https://www.sanity.io/docs/datastore) 117 | - [Sanity Studio](https://www.sanity.io/docs/sanity-studio) 118 | - [Sanity Plugins](https://www.sanity.io/plugins) 119 | - [Sanity CLI](https://www.sanity.io/docs/cli-reference) 120 | - [Sanity Courses](https://www.sanity.io/learn) 121 | - [Course: Day one with Sanity](https://www.sanity.io/learn/course/day-one-with-sanity-studio) 122 | - [Course: Sanity Typed content with Sanity TypeGen](https://www.sanity.io/learn/course/typescripted-content) 123 | - [Cheatsheet: GROQ](https://www.sanity.io/docs/query-cheat-sheet) 124 | - [Cheatsheet: Migrating content](https://www.sanity.io/docs/content-migration-cheatsheet) 125 | - [Sanity docs for Localization](https://www.sanity.io/docs/localization) 126 | - [Sanity docs for Block Content](https://www.sanity.io/docs/block-content) 127 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/configuration/stripe.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Stripe 3 | description: 如何配置 Stripe 相关环境变量。 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | import { Steps } from '@astrojs/starlight/components'; 8 | 9 | Mkdirs 使用 [Stripe](https://stripe.com/) 作为支付服务商,用于收款。 10 | 11 | ## 配置 12 | 13 | 14 | 15 | 1. 创建 Stripe 账户 16 | 17 | 如果您没有 Stripe 账户,请按照他们的步骤 [注册](https://dashboard.stripe.com/register)。 18 | 19 | 2. 获取 Stripe API 密钥 20 | 21 | - 进入 Stripe 仪表盘。 22 | - 点击右上角的 `Developers`。 23 | - 点击 `Developers` 菜单下的 `API keys`。 24 | - 点击 `Reveal live key`(如果您在测试模式下,请点击 `Reveal test key`)。 25 | - 复制密钥并将其设置到 `.env` 文件中。 26 | 27 | 31 | 32 | ```bash 33 | # .env 34 | # [only required if you want to support paid submissions] 35 | STRIPE_API_KEY=your_stripe_api_key 36 | ``` 37 | 38 | ![Stripe Key](../../../../assets/images/stripe-key.png) 39 | 40 | 3. 获取产品价格 ID 41 | 42 | - 进入 Stripe 仪表盘。 43 | - 点击左侧栏的 `Product Catalog`。 44 | - 点击 `+ Create Product` 按钮。 45 | - 给产品一个清晰的名字,并设置用户提交的费用。 46 | - 点击 `Add Product` 按钮创建它。 47 | - 进入产品详情页面,点击 `...` 按钮在定价部分。 48 | - 复制 **price id** 并将其设置到 `.env` 文件中。 49 | 50 | 57 | 58 | ```bash 59 | # .env 60 | # [only required if you want to support paid submissions and sponsor ads] 61 | NEXT_PUBLIC_STRIPE_PRO_PRICE_ID=your_price_id 62 | NEXT_PUBLIC_STRIPE_SPONSOR_PRICE_ID=your_sponsor_price_id 63 | ``` 64 | 65 | ![Stripe Price](../../../../assets/images/stripe-price.png) 66 | 67 | 4. 获取 Webhook 密钥 68 | 69 | - 进入 Stripe 仪表盘。 70 | - 点击右上角的 `Developers`。 71 | - 点击 `Developers` 菜单下的 `Webhooks`。 72 | - 点击 `Add an endpoint` 按钮。 73 | - 输入 Stripe 发送事件的端点 URL,例如 `https://your-domain.com/api/webhook`。 74 | - 选择您想要接收通知的事件,常见事件包括 `checkout.session.completed`。 75 | - 复制 Webhook 密钥并将其设置到 `.env` 文件中。 76 | 77 | 81 | 82 | ```bash 83 | # .env 84 | # [only required if you want to support paid submissions and sponsor ads] 85 | STRIPE_WEBHOOK_SECRET=your_webhook_secret 86 | ``` 87 | 88 | ![Stripe Webhook](../../../../assets/images/stripe-webhook.png) 89 | 90 | 91 | 92 | ## 视频教程 93 | 94 | 视频教程有2个版本,一个是开发者教程,一个是初学者教程,请根据自己的实际情况选择观看。 95 | 96 | ### 配置 Stripe 环境变量 - 开发者教程 97 | 98 |
99 | 110 |
111 | 112 | ### 配置 Stripe 环境变量 - 初学者教程 113 | 114 |
115 | 124 |
125 | 126 | ## 延伸阅读 127 | 128 | - [Stripe - API Keys](https://stripe.com/docs/keys) 129 | - [Stripe - Webhooks](https://stripe.com/docs/webhooks) 130 | - [Stripe - Checkout Sessions](https://docs.stripe.com/api/checkout/sessions/create) 131 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/customization/card.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 如何自定义卡片样式 3 | description: 如何自定义导航站的卡片样式。 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | 8 | Mkdirs模板支持两种卡片样式:`带封面图样式` 和 `带图标样式` (默认)。 9 | 10 | 带封面图样式 ([item-card.tsx](https://github.com/MkdirsHQ/mkdirs-template/blob/main/src/components/item/item-card.tsx)): 11 | 12 | ![Item Card with Image](../../../../assets/images/guide-item-card-image.png) 13 | 14 | 带图标样式 ([item-card-2.tsx](https://github.com/MkdirsHQ/mkdirs-template/blob/main/src/components/item/item-card-2.tsx)): 15 | 16 | ![Item Card with Icon](../../../../assets/images/guide-item-card-icon.png) 17 | 18 | 19 | `带图标样式` 是默认样式,您可以通过修改 `src/lib/constants.ts` 文件中的 `SUPPORT_ITEM_ICON` 为 `false` 来将其更改为 `带封面图样式`。 20 | 21 | ```ts 22 | // support item icon, default is true (aka, show item icon) 23 | // NOTE: if you set true, you should make sure the item icon is available 24 | // if you set false, the item card will show image instead of icon 25 | export const SUPPORT_ITEM_ICON = false; 26 | ``` 27 | 28 | 33 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/customization/category.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 如何添加分类和分类组 3 | description: 如何添加分类和分类组到导航站。 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | 8 | ## 添加分类 9 | 10 | 进入Sanity Studio,点击 `Category Management` 按钮,然后点击 `+` 按钮。 11 | 12 | 输入分类名称,生成slug,设置描述和优先级,然后点击 `Publish` 按钮。 13 | 14 | ![Add Categories](../../../../assets/images/guide-category.png) 15 | 16 | 19 | 20 | 分类发布后,您可以在网站上看到分类列表,如下所示。 21 | 22 | ![Category List](../../../../assets/images/guide-category-list.png) 23 | 24 | ## 添加分类组 25 | 26 | 进入Sanity Studio,点击 `Group Management` 按钮,然后点击 `+` 按钮。 27 | 28 | 输入组名称,生成slug,设置描述和优先级,然后点击 `Publish` 按钮。 29 | 30 | ![Add Category Groups](../../../../assets/images/guide-group.png) 31 | 32 | 35 | 36 | 分类组发布后,您可以在网站上看到组列表,如下所示。 37 | 38 | ![Group List](../../../../assets/images/guide-group-list.png) 39 | 40 | 41 | 分类组是默认支持的,如果您不想显示组,您可以通过在 `src/lib/constants.ts` 文件中将 `SUPPORT_CATEGORY_GROUP` 设置为 `false` 来禁用它。 42 | 43 | ```ts 44 | // support category group, default is true (aka, show category group) 45 | // NOTE: if you set true, you should make sure each category belongs to a group 46 | // if you set false, the category will be shown in the root level 47 | export const SUPPORT_CATEGORY_GROUP = false; 48 | ``` 49 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/customization/custom-page.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 如何添加自定义页面 3 | description: 如何添加自定义页面到网站。 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | 8 | ## 添加自定义页面 9 | 10 | 前往 Sanity Studio,点击 `Pages` 按钮,然后点击 `Create` 按钮。 11 | 12 | 输入页面标题,并生成 slug,然后点击 `Publish` 按钮。 13 | 14 | 页面发布后,您可以在网站上通过 URL `/[slug]` 访问该页面。 15 | 16 | 例如,如果 slug 是 `about`,您可以通过 URL `/about` 访问该页面。 17 | 18 | 您可以在 Sanity Studio 中添加关于页面、联系页面、隐私页面、条款页面等。 19 | 20 | ![Custom Page](../../../../assets/images/guide-custom-page.png) 21 | 22 | 25 | 26 | ## 修改首页 27 | 28 | Mkdirs 模板有3种首页布局,您可以通过以下步骤修改默认首页布局。 29 | 30 | 1. 删除 `src/app/(website)/(public)/(home)` 文件夹中的3个文件。 31 | 32 | 2. 将 `src/app/(website)/(test)/(home2)` 或 `src/app/(website)/(test)/(home3)` 文件夹中的文件复制到 `src/app/(website)/(public)/(home)` 文件夹中。 33 | 34 | ![Custom Home Page](../../../../assets/images/guide-custom-homepage.png) 35 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/customization/email.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 如何更改或添加邮件模板 3 | description: 如何更改或添加邮件模板。 4 | --- 5 | 6 | ## 启动邮件预览服务器 7 | 8 | 运行以下命令启动邮件预览服务器,您可以看到邮件预览服务器运行在 `http://localhost:3333`。 9 | 10 | ```bash 11 | pnpm email 12 | ``` 13 | 14 | ![Email Preview](../../../../assets/images/guide-email-preview.png) 15 | 16 | ## 更改或添加新的邮件模板 17 | 18 | 邮件模板文件位于 `emails` 文件夹中,您可以更改邮件模板文件为自己的邮件模板。 19 | 20 | 或者您可以添加新的邮件模板文件到 `emails` 文件夹中,然后在浏览器中预览邮件模板。 21 | 22 | ## 视频教程 23 | 24 |
25 | 36 |
37 | 38 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/customization/font.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 如何自定义字体 3 | description: 如何自定义导航站的字体。 4 | --- 5 | 6 | 字体文件位于 `src/assets/fonts` 文件夹中,您可以添加自定义字体文件到 `fonts` 文件夹中,并在 `src/assets/fonts/index.ts` 文件中定义字体。 7 | 8 | ![Font File](../../../../assets/images/guide-font-file.png) 9 | 10 | 然后您可以在 `src/app/(website)/layout.tsx` 文件中使用字体。 11 | 12 | ![Font Definition](../../../../assets/images/guide-font-layout.png) 13 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/customization/information.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 如何自定义导航站信息 3 | description: 如何自定义导航站的信息。 4 | --- 5 | 6 | 打开 `src/config` 文件夹,您可以看到 `site.ts` 文件。 7 | 8 | ![Config information](../../../../assets/images/guide-config-website.png) 9 | 10 | 您可以在这里自定义导航站的信息,也可以在 `config` 文件夹中的其他文件中自定义其他信息,例如菜单栏、底部链接等。 11 | 12 | ![Config information](../../../../assets/images/guide-config-website-2.png) 13 | 14 | ## 视频教程 15 | 16 | ### 自定义导航站信息- 开发者教程 17 | 18 |
19 | 30 |
31 | 32 | ### 自定义导航站信息- 初学者教程 33 | 34 |
35 | 46 |
47 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/customization/logo.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 如何自定义 Logo 和 Favicon 3 | description: 如何自定义 Logo 和 Favicon。 4 | --- 5 | 6 | 创建一个新的 `logo.png` 文件和一个新的 `favicon.ico` 文件,并将它们放在 `public` 文件夹中。 7 | 8 | 你可以直接删除模板中自带的 `logo.png` 文件和 `favicon.ico` 文件。 9 | 10 | 您可以使用 [这些工具](https://indiehub.best/collection/the-best-logo-generator-tools-in-2025) 创建您的 Logo 和 Favicon,我推荐 [IconKitchen](https://icon.kitchen.io/) 和 [Icon Maker](https://ray.so/icon)。 11 | 12 | ![Logo and Favicon](../../../../assets/images/guide-config-logo.png) 13 | 14 | ## 视频教程 15 | 16 | ### 自定义导航站信息- 开发者教程 17 | 18 |
19 | 30 |
31 | 32 | ### 自定义导航站信息- 初学者教程 33 | 34 |
35 | 46 |
47 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/customization/theme.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 如何自定义主题 3 | description: 如何自定义主题。 4 | --- 5 | 6 | Mkdirs 使用 Shadcn UI 的主题,您可以在 [Shadcn UI 主题](https://ui.shadcn.com/themes) 中自定义颜色主题,然后复制代码并替换 `src/styles/globals.css` 文件中的现有代码。 7 | 8 | 例如,您可以通过复制粘贴以下代码来得到一个蓝色主题。 9 | 10 | ![Theme](../../../../assets/images/guide-theme-blue.png) 11 | 12 | 13 | ```css 14 | /* src/styles/globals.css */ 15 | 16 | @layer base { 17 | :root { 18 | --background: 0 0% 100%; 19 | --foreground: 222.2 84% 4.9%; 20 | --card: 0 0% 100%; 21 | --card-foreground: 222.2 84% 4.9%; 22 | --popover: 0 0% 100%; 23 | --popover-foreground: 222.2 84% 4.9%; 24 | --primary: 221.2 83.2% 53.3%; 25 | --primary-foreground: 210 40% 98%; 26 | --secondary: 210 40% 96.1%; 27 | --secondary-foreground: 222.2 47.4% 11.2%; 28 | --muted: 210 40% 96.1%; 29 | --muted-foreground: 215.4 16.3% 46.9%; 30 | --accent: 210 40% 96.1%; 31 | --accent-foreground: 222.2 47.4% 11.2%; 32 | --destructive: 0 84.2% 60.2%; 33 | --destructive-foreground: 210 40% 98%; 34 | --border: 214.3 31.8% 91.4%; 35 | --input: 214.3 31.8% 91.4%; 36 | --ring: 221.2 83.2% 53.3%; 37 | --radius: 0.5rem; 38 | --chart-1: 12 76% 61%; 39 | --chart-2: 173 58% 39%; 40 | --chart-3: 197 37% 24%; 41 | --chart-4: 43 74% 66%; 42 | --chart-5: 27 87% 67%; 43 | } 44 | 45 | .dark { 46 | --background: 222.2 84% 4.9%; 47 | --foreground: 210 40% 98%; 48 | --card: 222.2 84% 4.9%; 49 | --card-foreground: 210 40% 98%; 50 | --popover: 222.2 84% 4.9%; 51 | --popover-foreground: 210 40% 98%; 52 | --primary: 217.2 91.2% 59.8%; 53 | --primary-foreground: 222.2 47.4% 11.2%; 54 | --secondary: 217.2 32.6% 17.5%; 55 | --secondary-foreground: 210 40% 98%; 56 | --muted: 217.2 32.6% 17.5%; 57 | --muted-foreground: 215 20.2% 65.1%; 58 | --accent: 217.2 32.6% 17.5%; 59 | --accent-foreground: 210 40% 98%; 60 | --destructive: 0 62.8% 30.6%; 61 | --destructive-foreground: 210 40% 98%; 62 | --border: 217.2 32.6% 17.5%; 63 | --input: 217.2 32.6% 17.5%; 64 | --ring: 224.3 76.3% 48%; 65 | --chart-1: 220 70% 50%; 66 | --chart-2: 160 60% 45%; 67 | --chart-3: 30 80% 55%; 68 | --chart-4: 280 65% 60%; 69 | --chart-5: 340 75% 55%; 70 | } 71 | } 72 | ``` 73 | 74 | ## 视频教程 75 | 76 | ### 自定义导航站信息- 开发者教程 77 | 78 |
79 | 90 |
91 | 92 | ### 自定义导航站信息- 初学者教程 93 | 94 |
95 | 106 |
107 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/deployment/docker.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Docker 3 | description: 如何使用 Docker 部署 Mkdirs。 4 | --- 5 | 6 | import { Steps } from '@astrojs/starlight/components'; 7 | 8 | 您可以轻松地在 [Docker](https://www.docker.com/) 上部署 Mkdirs。 9 | 10 | ## 使用 Dockerfile 部署 11 | 12 | Mkdirs 提供了一个预配置的 Dockerfile 文件,方便你快速通过 Docker 部署导航站。 13 | 14 | ```bash 15 | # Dockerfile 16 | 17 | # syntax=docker/dockerfile:1 18 | FROM node:20-alpine AS base 19 | 20 | # Install dependencies only when needed 21 | FROM base AS deps 22 | # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. 23 | RUN apk add --no-cache libc6-compat 24 | WORKDIR /app 25 | 26 | # Install dependencies 27 | COPY package.json pnpm-lock.yaml* ./ 28 | RUN corepack enable pnpm && pnpm i --frozen-lockfile 29 | 30 | # Rebuild the source code only when needed 31 | FROM base AS builder 32 | WORKDIR /app 33 | COPY --from=deps /app/node_modules ./node_modules 34 | COPY . . 35 | 36 | # Next.js collects completely anonymous telemetry data about general usage. 37 | # Learn more here: https://nextjs.org/telemetry 38 | # Uncomment the following line in case you want to disable telemetry during the build. 39 | # ENV NEXT_TELEMETRY_DISABLED 1 40 | 41 | RUN corepack enable pnpm \ 42 | && mv next.config.docker.mjs next.config.mjs \ 43 | && pnpm build 44 | 45 | # Production image, copy all the files and run next 46 | FROM base AS runner 47 | WORKDIR /app 48 | 49 | ENV NODE_ENV production 50 | # Uncomment the following line in case you want to disable telemetry during runtime. 51 | # ENV NEXT_TELEMETRY_DISABLED 1 52 | 53 | RUN addgroup --system --gid 1001 nodejs 54 | RUN adduser --system --uid 1001 nextjs 55 | 56 | COPY --from=builder /app/public ./public 57 | 58 | # Set the correct permission for prerender cache 59 | RUN mkdir .next 60 | RUN chown nextjs:nodejs .next 61 | 62 | # Automatically leverage output traces to reduce image size 63 | # https://nextjs.org/docs/advanced-features/output-file-tracing 64 | COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ 65 | COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static 66 | 67 | USER nextjs 68 | 69 | EXPOSE 3000 70 | 71 | ENV PORT 3000 72 | ENV HOSTNAME "0.0.0.0" 73 | 74 | # server.js is created by next build from the standalone output 75 | # https://nextjs.org/docs/pages/api-reference/next-config-js/output 76 | CMD ["node", "server.js"] 77 | ``` 78 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/deployment/dokploy.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Dokploy 3 | description: How to deploy Mkdirs on Dokploy. 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | import { Steps } from '@astrojs/starlight/components'; 8 | 9 | 我推荐使用 [Dokploy](https://dokploy.com/) 部署 Mkdirs,因为它更容易使用,并且你还可以获得像 Vercel 一样的 CI/CD 自动流程。 10 | 11 | ## 在 Dokploy 上部署 12 | 13 | 14 | 15 | 1. 在 Dokploy 上创建一个新项目 16 | 17 | 点击 `Create project` 按钮,并设置项目名称和描述。 18 | 19 | 2. 在项目中创建一个应用 20 | 21 | 点击 `Create services` 按钮,并选择 `Application`,然后设置应用名称和描述。 22 | 23 | 3. 设置源码和构建类型 24 | 25 | 将源码设置为仓库,并将构建类型设置为 Dockerfile。 26 | 27 | ![Dokploy Settings](../../../../assets/images/dokploy-settings.png) 28 | 29 | ![Dokploy Build Type](../../../../assets/images/dokploy-buildtype.png) 30 | 31 | 4. 设置环境变量 32 | 33 | 复制 `.env` 文件中的内容,并将其粘贴到环境变量设置中。 34 | 35 | 40 | 41 | ![Dokploy Environment Variables](../../../../assets/images/dokploy-env.png) 42 | 43 | 5. 开始部署 44 | 45 | 点击 `Deploy`,并等待部署完成。 46 | 47 | ![Dokploy Deploy](../../../../assets/images/dokploy-deploy.png) 48 | 49 | 6. 设置域名 50 | 51 | 添加你想要使用的域名,并确保勾选 `HTTPS`。 52 | 53 | ![Dokploy Domain](../../../../assets/images/dokploy-domain.png) 54 | 55 | 7. 完成 56 | 57 | 部署完成后,访问你设置的域名,检查应用是否正常运行。 58 | 59 | 60 | 61 | ## 教程 62 | 63 | 目前没有关于在 Dokploy 上部署 Mkdirs 导航站的视频教程,但文章[《Dokploy 极简教程》](https://javayhu.com/dokployde-ji-jian-jiao-cheng/)可以让你快速上手 Dokploy。或者,你可以参考以下视频了解 Dokploy Cloud 的介绍,并学习如何在 Dokploy Cloud 上部署一个 Next.js 应用。之后,你将知道如何在 Dokploy 上部署你的导航站。 64 | 65 |
66 | 75 |
76 | 77 | 78 | ## 延伸阅读 79 | 80 | - [Dokploy](https://dokploy.com/) 81 | - [How to install Dokploy on your own server](https://mksaas.me/blog/dokploy) 82 | - [How to install Dokploy on Aliyun ECS server](https://coreychiu.com/blogs/how-to-install-dokploy-on-aliyun-ecs-server) 83 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/deployment/vercel.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Vercel 3 | description: 如何将 Mkdirs 部署到 Vercel。 4 | --- 5 | 6 | import { Steps } from '@astrojs/starlight/components'; 7 | 8 | 你可以轻松地将 Mkdirs 部署到 [Vercel](https://vercel.com/)。 9 | 10 | ## 在 Vercel 上部署 11 | 12 | 13 | 14 | 1. 在 [Vercel](https://vercel.com/) 上创建一个账户 15 | 16 | 如果你还没有 Vercel 账户,请按照他们的步骤进行 [注册](https://vercel.com/signup)。 17 | 18 | 2. 创建一个新项目 19 | 20 | 点击 `Add New Project` 按钮,并选择你的 GitHub 仓库,然后点击 `Import` 按钮。 21 | 22 | 3. 设置环境变量 23 | 24 | 复制并粘贴 `.env` 文件中的环境变量到 `Environment Variables` 部分,然后点击 `Deploy` 按钮。 25 | 26 | ![Vercel Project](../../../../assets/images/vercel-project.png) 27 | 28 | 4. 设置域名 29 | 30 | 在 `Domains` 部分添加你想要使用的域名,并添加 DNS 记录到你的域名提供商,然后等待 DNS 记录生效。 31 | 32 | ![Vercel Domain](../../../../assets/images/vercel-domain.png) 33 | 34 | 5. 设置函数最大执行时间 (可选) 35 | 36 | 如果启用了AI自动填充功能,请在 `Settings/Functions` 部分将 `Function Max Duration` 设置为 `60` 秒。 37 | 38 | ![Config AI Function](../../../../assets/images/config-ai-function.png) 39 | 40 | 6. 完成 41 | 42 | 等待部署完成,你的目录网站应该已经上线。 43 | 44 | 45 | 46 | ## 常见问题 47 | 48 | - **Q: 如何使用 Cloudflare 作为反向代理?** 49 | 50 | A: 请按照 [这里](https://vercel.com/docs/integrations/external-platforms/cloudflare#set-cloudflare-ssl/tls-encryption-mode) 的步骤使用 Cloudflare 作为反向代理。 51 | 52 | **如果遇到 `Error: Too many redirects`,可以尝试将 SSL 模式设置为 `Full`。** 53 | 54 | ![Cloudflare SSL](../../../../assets/images/vercel-cloudflare-ssl.png) 55 | 56 | 57 | ## 视频教程 58 | 59 | ### 部署到 Vercel - 开发者教程 60 | 61 |
62 | 73 |
74 | 75 | 76 | ### 部署到 Vercel - 初学者教程 77 | 78 |
79 | 90 |
91 | 92 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/faq.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 常见问题 3 | description: 关于 Mkdirs 模板的常见问题。 4 | --- 5 | 6 | import { LinkCard } from '@astrojs/starlight/components'; 7 | 8 | ## 通用 9 | 10 | ### 如何部署导航站? 11 | 12 | 你可以查看 [文档](https://docs.mkdirs.com) 和 [视频教程](https://youtube.com/@MkdirsHQ) 获取详细说明。 13 | 14 | 我可以在 30 分钟内启动一个导航站,如果你按照文档和视频操作,那么你也可以。 15 | 16 | ### 我可以使用 Mkdirs 创建多少个导航站? 17 | 18 | 你可以使用 Mkdirs 创建无限数量的导航站,只需支付模板费用,无需再支付其他费用。 19 | 20 | ### 我可以做什么? 21 | 22 | 你可以使用 Mkdirs 创建无限数量的导航站(商业项目也可以)。 23 | 24 | 你不能: 25 | - 开源 Mkdirs 全部代码或部分代码,或者把它作为模板二次销售 26 | - 将 Mkdirs 代码作为服务提供给他人,例如,你不能帮助他人使用 Mkdirs 搭建导航站,但如果他人愿意付费购买 Mkdirs 模板,那么你可以帮助他们搭建导航站 27 | 28 | ### 如何获取技术支持? 29 | 30 | 你可以通过电子邮件 [support@mkdirs.com](mailto:support@mkdirs.com) 联系我们。 31 | 32 | ## 技术 33 | 34 | ### Sanity 的免费计划最多可以保存多少份文档? 35 | 36 | 根据 [Sanity 定价](https://www.sanity.io/pricing),你可以在免费计划中保存最多 10,000 个文档。 37 | 38 | 如果升级到 Growth 计划,每月支付 15 美元,最多可以保存 25,000 个文档。 39 | 40 | ### 如何同步源代码与仓库? 41 | 42 | 你可以查看 [开发指南](https://docs.mkdirs.com/zh-cn/guide/develop/#how-to-sync-the-code) 获取详细说明。 43 | 44 | ### 如何自定义字体、Logo或主题? 45 | 46 | 你可以查看 [文档](https://docs.mkdirs.com/zh-cn) 和 [视频教程](https://youtube.com/@MkdirsHQ) 获取详细说明。 47 | 48 | - 自定义字体: [https://docs.mkdirs.com/zh-cn/customization/font/](https://docs.mkdirs.com/zh-cn/customization/font/) 49 | - 自定义Logo: [https://docs.mkdirs.com/zh-cn/customization/logo/](https://docs.mkdirs.com/zh-cn/customization/logo/) 50 | - 自定义主题: [https://docs.mkdirs.com/zh-cn/customization/theme/](https://docs.mkdirs.com/zh-cn/customization/theme/) 51 | 52 | ### 如何查看日志? 53 | 54 | 你可以查看 [开发指南](https://docs.mkdirs.com/zh-cn/guide/develop/#how-to-find-the-logs) 获取详细说明。 55 | 56 | ### 如何从其他导航站导入数据? 57 | 58 | 你可以编写一个脚本从其他导航站导出数据,然后导入到 Mkdirs。 59 | 60 | 我们已经在代码库中提供了一些示例脚本,你可以参考它们的实现,自定义自己的导入逻辑。 61 | 62 | 例如,你可以使用 [Sanity CLI](https://www.sanity.io/docs/cli-reference) 或 [Sanity Client API](https://www.sanity.io/docs/js-client) 将数据导入到 Mkdirs。 63 | 64 | 更多信息可以参考这个 [Issue](https://github.com/MkdirsHQ/mkdirs-template/issues/34)。 65 | 66 | ### 如何了解更多关于 Sanity CMS 的信息? 67 | 68 | 你可以查看 [Sanity 指南](https://docs.mkdirs.com/zh-cn/guide/sanity/) 获取详细说明。 69 | 70 | 你将学习如何更新 Sanity 的 Schema,以及如何配置 Sanity Studio 等。 71 | 72 | 我们还提供了一个关于 Sanity CMS 的 [教程和文档列表](https://docs.mkdirs.com/zh-cn/guide/sanity/#further-reading) ,你可以参考它们获取更多信息。 73 | 74 | ### Mkdirs 是否支持国际化? 75 | 76 | Mkdirs 不支持国际化,未来也不会支持,因为这会使模板过于复杂。 77 | 78 | 我开源了另一个 [导航站模板](https://github.com/javayhu/free-directory-boilerplate),支持国际化,你可以参考它来实现国际化。 79 | 80 | 如果你实在想要支持国际化,可以联系 [Meepo](mailto:meepo.hyper@gmail.com),他提供了一个付费服务来帮助你将国际化功能添加到你的导航站。你也可以参考以下文档来自行实现: 81 | 82 | - Next.js: [https://nextjs.org/docs/app/building-your-application/routing/internationalization](https://nextjs.org/docs/app/building-your-application/routing/internationalization) 83 | - Sanity: [https://www.sanity.io/docs/localization](https://www.sanity.io/docs/localization) 84 | 85 | ## 支付 86 | 87 | ### 是否支持 Lemonsqueezy 或其他支付服务? 88 | 89 | 不支持,Mkdirs 只支持 Stripe,其他支付服务暂时不支持。 90 | 91 | 如果要支持 Lemon Squeezy,可以参考这个开源项目。 92 | 93 | [https://github.com/lmsqueezy/nextjs-billing](https://github.com/lmsqueezy/nextjs-billing) 94 | 95 | ### 运行一个导航站需要多少费用? 96 | 97 | 使用 Mkdirs 模板,你可以轻松启动一个几乎零成本的导航站。 98 | 99 | 你只需支付域名费用,并使用 [Sanity](https://www.sanity.io/pricing)、[Resend](https://resend.com/pricing) 和 [Vercel](https://vercel.com/pricing) 的免费计划。 100 | 101 | 当你的导航站流量增长时,你可以选择升级你的付费计划。 102 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/guide/develop.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 如何使用源码 3 | description: 如何使用导航站模板的源码。 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | import { Steps } from '@astrojs/starlight/components'; 8 | 9 | ## 文件结构 10 | 11 | Mkdirs 是一个使用 [Typescript](https://www.typescriptlang.org/) 语言开发的 [Next.js](https://nextjs.org/) 项目,因此 Mkdirs 的文件结构如下: 12 | 13 | ![File Structure](../../../../assets/images/guide-file-structure.png) 14 | 15 | ## 应用架构 16 | 17 | ![Application Architecture](../../../../assets/images/guide-dev-architecture.png) 18 | 19 | ## 如何查找日志 20 | 21 | 如果您遇到一些错误,您可以在浏览器的 `console` 中找到日志(如果它是客户端错误),或者在服务器的 `terminal` 中找到日志(如果它是服务器错误)。 22 | 23 | 如果您使用 Vercel 部署您的网站,您可以在 Vercel 仪表板中的 `Logs` 部分找到日志。 24 | 25 | **浏览器控制台日志** 26 | 27 | ![Console Logs](../../../../assets/images/guide-dev-console-logs.png) 28 | 29 | **Vercel 日志** 30 | 31 | ![Vercel Logs](../../../../assets/images/guide-dev-logs-vercel.png) 32 | 33 | ## 如何批量导入数据 34 | 35 | Mkdirs 使用 [Sanity](https://www.sanity.io/) 作为内容管理系统,因此如果你想要批量导入数据,那么你需要将数据导入到 Sanity,导入之前建议您先阅读 [Sanity 文档](/zh-cn/guide/sanity) 中提供的资料了解 Sanity 的基本概念和用法。 36 | 37 | 如果你已经熟悉了 Sanity,那么你可以参考项目根目录下的 `scripts` 目录下的脚本,实现批量导入分类、标签和元素。 38 | 39 | 默认情况下,项目根目录下的 `scripts` 目录下有 `batch-group.ts`、`batch-category.ts`、 `batch-tag.ts` 和 `batch-item.ts` 四个脚本,分别用于导入分类组、分类、标签和元素。 40 | 41 | 你可以在新建项目之后,通过执行命令 `pnpm batch` 来测试导入数据,脚本目录下还提供了其他脚本,您可以参考它们实现自己的需求,对应命令请参考 [`package.json` 文件中的 `scripts` 部分](https://github.com/MkdirsHQ/mkdirs-template/blob/main/package.json#L27)。 42 | 43 | ```json 44 | "scripts": { 45 | "dev": "next dev", 46 | "build": "next build", 47 | "start": "next start", 48 | "lint": "next lint", 49 | "typegen": "sanity schema extract && sanity typegen generate", 50 | "email": "email dev --dir emails --port 3333", 51 | "export-user-emails": "tsx scripts/export-user-emails.ts", 52 | "microlink:fetch": "tsx scripts/explore-microlink.ts fetch", 53 | "microlink:insights": "tsx scripts/explore-microlink.ts insights", 54 | "microlink:screenshot": "tsx scripts/explore-microlink.ts screenshot", 55 | "microlink:fullpage": "tsx scripts/explore-microlink.ts fullpage", 56 | "aisdk:fetch": "tsx scripts/explore-aisdk.ts fetch", 57 | "aisdk:structure": "tsx scripts/explore-aisdk.ts structure", 58 | "item:remove": "tsx scripts/batch-item.ts remove", 59 | "item:import": "tsx scripts/batch-item.ts import", 60 | "item:update": "tsx scripts/batch-item.ts update", 61 | "item:fetch": "tsx scripts/batch-item.ts fetch", 62 | "batch": "tsx scripts/batch-all.ts", 63 | "batch:remove": "tsx scripts/batch-all.ts remove", 64 | "batch:import": "tsx scripts/batch-all.ts import", 65 | "batch:update": "tsx scripts/batch-all.ts update" 66 | }, 67 | ``` 68 | 69 | 73 | 74 | ## 如何格式化代码 75 | 76 | 我们使用 [Biome](https://biomejs.dev/) 来格式化代码,并且已经在项目中配置好了。 77 | 78 | 您可以在 vscode 中安装 [Biome 扩展](https://marketplace.visualstudio.com/items?itemName=biomejs.biome) 来自动格式化代码。 79 | 80 | 或者您可以运行以下命令来格式化代码: 81 | 82 | ```bash 83 | biome format 84 | ``` 85 | 86 | ## 如何同步源码 87 | 88 | 如果您按照 [安装](/zh-cn/installation) 中的步骤操作,并且有一个名为 `@your-github-username/your-mkdirs` 的仓库。 89 | 90 | 按照以下步骤从 `@MkdirsHQ/mkdirs-template` 同步源码到您的仓库,例如,新功能或错误修复。 91 | 92 | 93 | 94 | 1. 添加上游仓库 95 | 96 | 首先,您需要将原始仓库添加为远程仓库。 97 | 98 | 您可以将其命名为 `upstream`,然后在本地仓库中运行以下命令: 99 | 100 | ```bash 101 | git remote add upstream https://github.com/MkdirsHQ/mkdirs-template.git 102 | ``` 103 | 104 | 2. 获取上游仓库的更改 105 | 106 | 运行以下命令以获取原始仓库中的所有分支和提交: 107 | 108 | ```bash 109 | git fetch upstream 110 | ``` 111 | 112 | 3. 切换到您的 `main` 分支 113 | 114 | 确保您在 `main` 分支上(通常是 `main` 或 `master`): 115 | 116 | ```bash 117 | git checkout main 118 | ``` 119 | 120 | 4. 合并上游更改 121 | 122 | 现在,将上游 `main` 分支的更改合并到您的本地 `main` 分支: 123 | 124 | ```bash 125 | git merge upstream/main --allow-unrelated-histories 126 | ``` 127 | 128 | 如果您不想合并上游 `main` 分支的所有更改,您也可以选择性地挑选您想要应用到本地 `main` 分支的特定提交: 129 | 130 | ```bash 131 | git cherry-pick 132 | ``` 133 | 134 | ![Sync Code](../../../../assets/images/guide-sync-code.png) 135 | 136 | 5. 解决冲突(如果有) 137 | 138 | 如果在合并过程中发生冲突(主要是因为您已经对源码进行了一些更改),您需要手动解决它们。 139 | 140 | 解决冲突后,使用 `git add` 添加修改的文件,然后使用 `git commit` 提交更改。 141 | 142 | 6. 推送到您的仓库 143 | 144 | 最后,将更新后的本地 `main` 分支推送到您自己的仓库: 145 | 146 | ```bash 147 | git push origin main 148 | ``` 149 | 150 | 151 | 152 | 按照这些步骤,您可以保持您的分支与原始仓库同步。建议定期执行此过程,以确保您的分支不会落后太多。 153 | 154 | ## 延伸阅读 155 | 156 | - [Next.js](https://nextjs.org/) 157 | - [Course: Learn React Foundation](https://nextjs.org/learn/react-foundations) 158 | - [Course: Learn Next.js](https://nextjs.org/learn) 159 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/guide/sanity.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 如何使用 Sanity CMS 3 | description: 如何自定义 Sanity 模式和 GROQ 查询。 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | 8 | ## 学习 Sanity 9 | 10 | 如果您是 Sanity 的新手,您可以从 [Sanity 课程](https://www.sanity.io/learn) 开始学习,特别是以下两个课程: 11 | 12 | - [课程:Sanity 入门](https://www.sanity.io/learn/course/day-one-with-sanity-studio) 13 | - [课程:Sanity 数据类型化](https://www.sanity.io/learn/course/typescripted-content) 14 | 15 | 这些课程是免费的,将帮助您了解如何使用 Sanity,以下内容都是基于这些课程。 16 | 17 | ## 添加或更新 Sanity Schema 18 | 19 | Sanity Schema 文件位于 `src/sanity/schemas/documents` 文件夹中,您可以更改 Schema 为您的 Schema,或添加新 Schema,然后将新 Schema 添加到 `src/sanity/schemas/index.ts` 文件中。 20 | 21 | 更新 Sanity Schema 后,您需要运行以下命令来生成类型: 22 | 23 | ```bash 24 | pnpm typegen 25 | ``` 26 | 27 | 30 | 31 | 32 | ## 更新 GROQ 查询 33 | 34 | GROQ 查询语句位于 `src/sanity/lib/queries.ts` 文件中,您可以更改 GROQ 查询语句为您的查询语句,或添加新查询语句到文件中。 35 | 36 | 更新 GROQ 查询语句后,您需要运行以下命令来生成类型: 37 | 38 | ```bash 39 | pnpm typegen 40 | ``` 41 | 42 | 45 | 46 | ## 配置 Sanity Studio 47 | 48 | Sanity Studio 的配置位于 `sanity.config.ts` 文件中,您可以自定义 Sanity Studio 以满足您的需求。 49 | 50 | 例如,您可以找到一个新的 [Sanity 插件](https://www.sanity.io/plugins) 并将其添加到 Sanity Studio 中。 51 | 52 | 您还可以更改默认布局结构,根据 [Sanity Structure Builder](https://www.sanity.io/docs/structure-builder-introduction)。 53 | 54 | 55 | ## 延伸阅读 56 | 57 | - [Sanity](https://www.sanity.io/) 58 | - [Sanity Content Lake](https://www.sanity.io/docs/datastore) 59 | - [Sanity Studio](https://www.sanity.io/docs/sanity-studio) 60 | - [Sanity Plugins](https://www.sanity.io/plugins) 61 | - [Sanity CLI](https://www.sanity.io/docs/cli-reference) 62 | - [Sanity Structure Builder](https://www.sanity.io/docs/structure-builder-introduction) 63 | - [Sanity Courses](https://www.sanity.io/learn) 64 | - [Course: Day one with Sanity](https://www.sanity.io/learn/course/day-one-with-sanity-studio) 65 | - [Course: Sanity Typed content with Sanity TypeGen](https://www.sanity.io/learn/course/typescripted-content) 66 | - [Cheatsheet: GROQ](https://www.sanity.io/docs/query-cheat-sheet) 67 | - [Cheatsheet: Migrating content](https://www.sanity.io/docs/content-migration-cheatsheet) 68 | - [Sanity docs for Localization](https://www.sanity.io/docs/localization) 69 | - [Sanity docs for Block Content](https://www.sanity.io/docs/block-content) 70 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/guide/sponsor-ads.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 赞助广告 3 | description: 如何实现导航站的赞助广告功能。 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | import { Steps } from '@astrojs/starlight/components'; 8 | 9 | 赞助广告是导航站的主要收入来源之一,赞助广告会显示在导航站的列表中或者详情页中。Mkdirs 模板支持赞助广告的提交和显示,同一时间最多显示一个赞助广告,默认的显示赞助广告的流程如下。 10 | 11 | ## 显示赞助广告的流程 12 | 13 | 14 | 15 | 1. 用户填写提交表单,并支付赞助费用 16 | 17 | 用户点击导航站的 "提交" 按钮,并填写表单,然后支付赞助费用。 18 | 19 | 22 | 23 | ![Sponsor](../../../../assets/images/guide-payment-sponsor.png) 24 | 25 | 2. 管理员与用户沟通,赞助广告的显示时间 26 | 27 | 管理员与用户沟通广告的显示时间,确定后在 Sanity Studio 中设置赞助广告的显示时间,同时勾选设置这个 Item 是`Sponsor`。 28 | 29 | 32 | 33 | ![Sponsor Status](../../../../assets/images/guide-sponsor-status.png) 34 | 35 | ![Sponsor Config](../../../../assets/images/guide-sponsor-config.png) 36 | 37 | 3. 导航站自动显示赞助广告 38 | 39 | 赞助广告的显示时间设置完成后,导航站将自动在指定的时间内显示赞助广告。 40 | 41 | ![Sponsor](../../../../assets/images/guide-ad-sponsor.png) 42 | 43 | ![Sponsor](../../../../assets/images/guide-ad-sponsor-2.png) 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/guide/submission.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 如何提交新内容 3 | description: 如何提交新内容到导航站。 4 | --- 5 | 6 | import { Aside } from '@astrojs/starlight/components'; 7 | import { Steps } from '@astrojs/starlight/components'; 8 | 9 | ## 免费提交流程 10 | 11 | ### 用户如何提交新内容 12 | 13 | 14 | 15 | 1. 用户填写提交表单 16 | 17 | 用户点击导航站的 "提交" 按钮,并填写表单,然后提交审核。 18 | 19 | 25 | 26 | ![Submit](../../../../assets/images/guide-submission-user.png) 27 | 28 | 2. 管理员审核提交,并批准或拒绝 29 | 30 | 管理员将审核提交,并批准或拒绝,如果拒绝,将传递拒绝消息给用户。 31 | 32 | ![Review](../../../../assets/images/guide-submission-review.png) 33 | 34 | 37 | 38 | ![Send notification email](../../../../assets/images/guide-send-notification-email.png) 39 | 40 | 3. 用户发布提交 41 | 42 | 在提交被批准后,用户可以点击 "发布" 按钮,将提交发布到导航站。发布后,内容将显示在导航站中,因为 Sanity 有缓存,所以可能需要等待几分钟才能看到内容。 43 | 44 | ![Publish](../../../../assets/images/guide-submission-publish.png) 45 | 46 | 47 | 48 | ### 管理员如何提交新内容 49 | 50 | 管理员可以像用户一样,点击导航站的 "提交" 按钮,或者直接在 Sanity Studio 中添加新内容。 51 | 52 | ![Studio](../../../../assets/images/guide-submission-admin.png) 53 | 54 | 请确保设置 `发布日期` (Publish Date) 和 `免费计划状态` (Free Plan Status) 字段为 `已批准` (Approved) ,然后发布。用户确认发布后,内容将显示在导航站中,因为 Sanity 有缓存,所以可能需要等待几分钟才能看到内容。 55 | 56 | ![Approved](../../../../assets/images/guide-submission-approved.png) 57 | 58 | ## 付费提交流程 59 | 60 | 付费提交是导航站的主要收入来源之一,付费提交的内容会显示在导航站的列表中高亮显示。 61 | 62 | 用户点击导航站的 "提交" 按钮,并填写表单,然后支付 `PRO` 费用,支付完成后,默认情况下管理员无需审核直接通过,用户可以立即发布或者等待合适的时机发布产品。 63 | 64 | ![Feature](../../../../assets/images/guide-payment-feature.png) 65 | 66 | ## 视频教程 67 | 68 | 这个视频教程演示了如何进行免费提交和付费提交的流程。 69 | 70 |
71 | 82 |
83 | 84 | 这个视频演示了如何使用 AI 模型自动填充提交表单的功能流程。 85 | 86 |
87 | 98 |
99 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 介绍 Mkdirs 3 | description: 了解导航站模板 Mkdirs 及其工作原理。 4 | --- 5 | 6 | import { LinkCard } from '@astrojs/starlight/components'; 7 | 8 | 👋 你好,欢迎来到 [Mkdirs](https://mkdirs.com)! 9 | 10 | [Mkdirs](https://mkdirs.com) 是最好的导航站模板,利用这个模板,您可以在几分钟内轻松启动任何可以盈利的导航站,内置 AI提交、导航列表、付费提交、内容管理、身份认证、邮件订阅、博客、SEO、主题 等功能。 11 | 12 | **文档和视频教程有 🇬🇧 英文和 🇨🇳 中文两种语言。** 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | ## 应用架构 23 | 24 | ![Application Architecture](../../../assets/images/guide-dev-architecture.png) 25 | 26 | 27 | ## 进一步阅读 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/installation.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 安装 3 | description: 如何使用 Mkdirs 启动您的导航站。 4 | --- 5 | 6 | import { Steps } from '@astrojs/starlight/components'; 7 | import { LinkCard } from '@astrojs/starlight/components'; 8 | 9 | 学习如何使用 Mkdirs 启动您的导航站。 10 | 11 | ## 安装指南 12 | 13 | 14 | 15 | 1. 创建您的仓库 16 | 17 | 点击 [Mkdirs 模板](https://github.com/MkdirsHQ/mkdirs-template) 右上角的 `Fork` 按钮创建您的仓库,设置仓库名称,并确保将其设置为私有。 18 | 19 | 2. 克隆 Github 仓库 20 | 21 | ```bash 22 | git clone https://github.com/your-username/.git 23 | ``` 24 | 25 | 3. 安装依赖 26 | 27 | 确保安装依赖(推荐使用 PNPM)。 28 | 29 | ```bash 30 | cd 31 | pnpm install 32 | ``` 33 | 34 | 4. 复制 `.env.example` 文件为 `.env` 35 | 36 | ```bash 37 | cp .env.example .env 38 | ``` 39 | 40 | 5. 配置环境变量 41 | 42 | 更新环境变量,了解更多关于配置环境变量的信息,请看 [这里](/zh-cn/configuration/sanity/)。 43 | 44 | ```bash 45 | # .env 46 | 47 | # "http://localhost:3000" or "https://mkdirs.com" 48 | NEXT_PUBLIC_APP_URL= 49 | 50 | # ----------------------------------------------------------------------------- 51 | # Dataset & Storage (Sanity) 52 | # ----------------------------------------------------------------------------- 53 | NEXT_PUBLIC_SANITY_DATASET= 54 | NEXT_PUBLIC_SANITY_PROJECT_ID= 55 | SANITY_API_TOKEN= 56 | 57 | # ----------------------------------------------------------------------------- 58 | # Email (Resend) 59 | # ----------------------------------------------------------------------------- 60 | RESEND_API_KEY= 61 | RESEND_EMAIL_FROM= 62 | RESEND_EMAIL_ADMIN= 63 | RESEND_AUDIENCE_ID= 64 | 65 | # ----------------------------------------------------------------------------- 66 | # Analytics (OpenPanel & Google Analytics) 67 | # ----------------------------------------------------------------------------- 68 | NEXT_PUBLIC_OPENPANEL_CLIENT_ID= 69 | NEXT_PUBLIC_GOOGLE_ANALYTICS_ID= 70 | 71 | # ----------------------------------------------------------------------------- 72 | # Payment (Stripe) 73 | # ----------------------------------------------------------------------------- 74 | STRIPE_API_KEY= 75 | STRIPE_WEBHOOK_SECRET= 76 | NEXT_PUBLIC_STRIPE_PRO_PRICE_ID= 77 | 78 | # ----------------------------------------------------------------------------- 79 | # Authentication (NextAuth) 80 | # ----------------------------------------------------------------------------- 81 | AUTH_SECRET= 82 | 83 | AUTH_GOOGLE_ID= 84 | AUTH_GOOGLE_SECRET= 85 | 86 | AUTH_GITHUB_ID= 87 | AUTH_GITHUB_SECRET= 88 | ``` 89 | 90 | 6. 启动开发服务器 91 | 92 | 启动开发服务器,并打开浏览器访问 http://localhost:3000 93 | 94 | ```bash 95 | pnpm dev 96 | ``` 97 | 98 | 7. 构建生产环境 99 | 100 | 构建应用程序以生成生产环境的代码。 101 | 102 | ```bash 103 | pnpm build 104 | ``` 105 | 106 | 8. 部署 107 | 108 | 按照部署指南将您的应用程序部署到您喜欢的平台。 109 | 110 | - [Vercel](/zh-cn/deployment/vercel) 111 | - [Docker](/zh-cn/deployment/docker) 112 | - [Dokploy](/zh-cn/deployment/dokploy) 113 | 114 | 115 | 116 | ## 视频教程 117 | 118 | {/* ### 中文版 */} 119 | 120 | 视频教程有2个版本,一个是开发者教程,一个是初学者教程,请根据自己的实际情况选择观看。 121 | 122 | ### 【完整版】基于Mkdirs模板部署上线导航站的全流程记录 - 开发者教程 123 | 124 |
125 | 134 |
135 | 136 | ### 【完整版】基于Mkdirs模板部署上线导航站的全流程记录 - 初学者教程 137 | 138 |
139 | 148 |
149 | 150 | ## 下一步是什么? 151 | 152 | 一旦您部署了应用程序,建议设置一个过程来同步 `MkdirsHQ/mkdirs-template` 的源代码到您的仓库,当有新功能或错误修复时,您可以同步更新。 153 | 154 | 了解更多关于如何同步源代码的信息,请看 [开发相关](/zh-cn/guide/develop) 部分。 155 | 156 | 157 | ## 进一步阅读 158 | 159 | 160 | -------------------------------------------------------------------------------- /src/content/docs/zh-cn/prerequisites.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 前提条件 3 | description: 开始使用 Mkdirs 的前提条件。 4 | --- 5 | 6 | import { Steps } from '@astrojs/starlight/components'; 7 | import { LinkCard } from '@astrojs/starlight/components'; 8 | 9 | 使用 Mkdirs 模板的前提条件。 10 | 11 | ## 前提条件 12 | 13 | 14 | 15 | 1. Node.js 16 | 17 | 请确保你已经安装了 Node.js v18 或更高版本,如果没有,请从 [Node.js 官方网站](https://nodejs.org/en/download/) 安装。 18 | 19 | ```bash 20 | # 检查 Node.js 是否已安装 21 | node -v 22 | ``` 23 | 24 | 2. Git 25 | 26 | 请确保你已经安装了 Git,如果没有,请从 [Git 官方网站](https://git-scm.com/downloads) 安装。 27 | 28 | ```bash 29 | # 检查 Git 是否已安装 30 | git --version 31 | ``` 32 | 33 | 3. PNPM 34 | 35 | 请确保你已经安装了 PNPM,如果没有,请从 [PNPM 官方网站](https://pnpm.io/installation) 安装。 36 | 37 | ```bash 38 | # 安装 PNPM 39 | npm install -g pnpm 40 | 41 | # 检查 PNPM 是否已安装 42 | pnpm --version 43 | ``` 44 | 45 | 46 | 47 | 48 | ## 进一步阅读 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "astro/tsconfigs/strict" 3 | } 4 | --------------------------------------------------------------------------------