create-s-blog 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "create-s-blog",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "bin": {
6
+ "create-s-blog": "./dist/index.js"
7
+ },
8
+ "files": ["dist/", "template/"],
9
+ "scripts": {
10
+ "build": "tsc",
11
+ "dev": "tsc --watch"
12
+ },
13
+ "dependencies": {
14
+ "prompts": "^2.4.2",
15
+ "kolorist": "^1.8.0",
16
+ "minimist": "^1.2.8"
17
+ },
18
+ "devDependencies": {
19
+ "@types/prompts": "^2.4.9",
20
+ "@types/minimist": "^1.2.5",
21
+ "@types/node": "^24.10.1",
22
+ "typescript": "~5.9.3"
23
+ },
24
+ "keywords": ["blog", "scaffold", "create", "s-blog"],
25
+ "license": "MIT",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/Suzichen/s-blog.git"
29
+ },
30
+ "bugs": {
31
+ "url": "https://github.com/Suzichen/s-blog/issues"
32
+ },
33
+ "homepage": "https://s-blog.me"
34
+ }
@@ -0,0 +1,27 @@
1
+ # Logs
2
+ logs
3
+ src/generated
4
+ public/generated
5
+ public/albums/*/thumbs
6
+ *.log
7
+ npm-debug.log*
8
+ yarn-debug.log*
9
+ yarn-error.log*
10
+ pnpm-debug.log*
11
+ lerna-debug.log*
12
+
13
+ node_modules
14
+ dist
15
+ dist-ssr
16
+ *.local
17
+
18
+ # Editor directories and files
19
+ .vscode/*
20
+ !.vscode/extensions.json
21
+ .idea
22
+ .DS_Store
23
+ *.suo
24
+ *.ntvs*
25
+ *.njsproj
26
+ *.sln
27
+ *.sw?
@@ -0,0 +1,33 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/png" href="/logo.png" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <link
8
+ rel="stylesheet"
9
+ href="https://gcore.jsdelivr.net/npm/lxgw-wenkai-screen-webfont@1.1.0/lxgwwenkaiscreen.css"
10
+ media="all"
11
+ />
12
+ <title>My Tech Blog</title>
13
+ <script>
14
+ (function () {
15
+ var savedLang = localStorage.getItem("i18nextLng");
16
+ var userLang =
17
+ savedLang || navigator.language || navigator.userLanguage;
18
+
19
+ var lang = "en";
20
+ if (userLang) {
21
+ if (userLang.startsWith("zh")) lang = "zh";
22
+ else if (userLang.startsWith("ja")) lang = "ja";
23
+ }
24
+
25
+ document.documentElement.lang = lang;
26
+ })();
27
+ </script>
28
+ </head>
29
+ <body>
30
+ <div id="root"></div>
31
+ <script type="module" src="/src/main.tsx"></script>
32
+ </body>
33
+ </html>
@@ -0,0 +1,6 @@
1
+ export default {
2
+ plugins: {
3
+ tailwindcss: {},
4
+ autoprefixer: {},
5
+ },
6
+ }
Binary file
Binary file
Binary file
@@ -0,0 +1,6 @@
1
+ import type { AlbumConfig } from '@s-blog/core';
2
+
3
+ export const albumConfig: AlbumConfig = {
4
+ enabled: false,
5
+ albums: [],
6
+ };
@@ -0,0 +1,10 @@
1
+ import type { SiteConfig } from '@s-blog/core';
2
+
3
+ export const siteConfig: SiteConfig = {
4
+ title: "__TITLE__",
5
+ description: "__DESCRIPTION__",
6
+ logo: "/logo.png",
7
+ favicon: "/favicon.ico",
8
+ author: "__AUTHOR__",
9
+ language: "en",
10
+ };
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import ReactDOM from 'react-dom/client'
3
+ import { SBlogApp } from '@s-blog/core'
4
+ import { siteConfig } from './config'
5
+ import { albumConfig } from './album.config'
6
+
7
+ ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
8
+ <React.StrictMode>
9
+ <SBlogApp siteConfig={siteConfig} albumConfig={albumConfig} />
10
+ </React.StrictMode>,
11
+ )
@@ -0,0 +1,31 @@
1
+ ---
2
+ title: About This Blog
3
+ date: 2025-01-01 11:00:00
4
+ tags: [blog-system, about]
5
+ categories: [General]
6
+ preview: About this blog and the S-blog system that powers it.
7
+ ---
8
+
9
+ ## About
10
+
11
+ This blog is powered by [S-blog](https://github.com/Suzichen/s-blog), a static blog system built with React, Vite, and TypeScript.
12
+
13
+ ### Features
14
+
15
+ - 📝 Markdown-based content
16
+ - 🌍 Multi-language support (English, Chinese, Japanese)
17
+ - 📸 Photo album module
18
+ - 🔍 Full-text search
19
+ - 📱 Responsive design
20
+ - 🚀 Static site generation for fast loading
21
+
22
+ ### How It Works
23
+
24
+ All content is processed at build time and served as static files. There is no backend service, no database, and no runtime content processing. Once built, the site can be hosted anywhere that serves static files.
25
+
26
+ ### Customization
27
+
28
+ - Edit `src/config.ts` to change site settings
29
+ - Edit `src/album.config.ts` to configure photo albums
30
+ - Add posts as Markdown files in `src/posts/`
31
+ - Add album photos in `public/albums/`
@@ -0,0 +1,62 @@
1
+ ---
2
+ title: Welcome to S-blog
3
+ date: 2025-01-01 12:00:00
4
+ tags: [blog, getting-started]
5
+ categories: [General]
6
+ preview: Your first post! This article introduces S-blog and how to get started with writing.
7
+ ---
8
+
9
+ ## Welcome! 🎉
10
+
11
+ Congratulations on setting up your new **S-blog** project!
12
+
13
+ This is your first sample post. You can edit or delete it, and start writing your own content.
14
+
15
+ ---
16
+
17
+ ## Quick Guide
18
+
19
+ ### Writing a Post
20
+
21
+ Create a new Markdown file in the `src/posts/` directory. Each post needs frontmatter metadata:
22
+
23
+ ```markdown
24
+ ---
25
+ title: My First Post
26
+ date: 2025-01-01 12:00:00
27
+ tags: [example, hello]
28
+ categories: [Blog]
29
+ preview: A short summary of your post.
30
+ ---
31
+
32
+ Your post content goes here...
33
+ ```
34
+
35
+ ### Running Development Server
36
+
37
+ ```bash
38
+ npm run dev
39
+ ```
40
+
41
+ ### Building for Production
42
+
43
+ ```bash
44
+ npm run build
45
+ ```
46
+
47
+ ### Updating the Framework
48
+
49
+ ```bash
50
+ npm update @s-blog/core
51
+ ```
52
+
53
+ ---
54
+
55
+ ## What's Next?
56
+
57
+ - Edit `src/config.ts` to customize your site title, description, and other settings
58
+ - Add your own posts to `src/posts/`
59
+ - Enable the album feature in `src/album.config.ts` if you want a photo gallery
60
+ - Deploy your built site to any static hosting service
61
+
62
+ Happy blogging! ✍️
@@ -0,0 +1,27 @@
1
+ /** @type {import('tailwindcss').Config} */
2
+ export default {
3
+ content: [
4
+ "./index.html",
5
+ "./src/**/*.{js,ts,jsx,tsx}",
6
+ "./node_modules/@s-blog/core/dist/**/*.{js,ts,jsx,tsx}",
7
+ ],
8
+ theme: {
9
+ extend: {
10
+ colors: {
11
+ primary: 'var(--color-primary)',
12
+ secondary: 'var(--color-secondary)',
13
+ accent: 'var(--color-accent)',
14
+ bg: 'var(--color-bg)',
15
+ 'bg-alt': 'var(--color-bg-alt)',
16
+ border: 'var(--color-border)',
17
+ },
18
+ fontFamily: {
19
+ main: ['"LXGW WenKai Screen"', '"Helvetica Neue"', 'Helvetica', 'Arial', 'sans-serif'],
20
+ },
21
+ maxWidth: {
22
+ 'content': 'var(--max-width)',
23
+ }
24
+ },
25
+ },
26
+ plugins: [],
27
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "useDefineForClassFields": true,
5
+ "module": "ESNext",
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "jsx": "react-jsx",
8
+ "types": ["vite/client"],
9
+ "skipLibCheck": true,
10
+
11
+ /* Bundler mode */
12
+ "moduleResolution": "bundler",
13
+ "allowImportingTsExtensions": true,
14
+ "verbatimModuleSyntax": true,
15
+ "moduleDetection": "force",
16
+ "noEmit": true,
17
+
18
+ /* Linting */
19
+ "strict": true,
20
+ "noUnusedLocals": true,
21
+ "noUnusedParameters": true,
22
+ "erasableSyntaxOnly": true,
23
+ "noFallthroughCasesInSwitch": true,
24
+ "noUncheckedSideEffectImports": true,
25
+ "baseUrl": ".",
26
+ "paths": {
27
+ "@/*": ["src/*"]
28
+ }
29
+ },
30
+ "include": ["src"]
31
+ }
@@ -0,0 +1,13 @@
1
+
2
+ import { defineConfig } from 'vite';
3
+ import react from '@vitejs/plugin-react';
4
+ import path from 'path';
5
+
6
+ export default defineConfig({
7
+ plugins: [react()],
8
+ resolve: {
9
+ alias: {
10
+ '@': path.resolve(__dirname, './src'),
11
+ },
12
+ },
13
+ });