-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
163 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/bin/*.d.ts | ||
/bin/*.pdb | ||
/bin/*.xml | ||
/obj | ||
*.csproj | ||
*.sln |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Blog | ||
|
||
This tool generates a `pure static` blog website from a `markdown` document through commands. With the help of `GitHub Pages`, you can have a personal blog for free in 5 minutes.It has the following characteristics | ||
|
||
- Provide command line tools to generate static websites | ||
- Generate a pure static website with extremely fast access speed | ||
- Support for content written in markdown format | ||
- Support search, classification, archiving and screening | ||
- Customize website name and description, etc | ||
|
||
**Demo:** NilTor's Blog: [https://blog.dusi.dev/](https://blog.dusi.dev/) | ||
|
||
## 🎖️Features | ||
|
||
- Blog list on the homepage, supporting search, category and archive filtering | ||
- Customize website name and description | ||
- Light and Dark themes that change with the system | ||
- Adaptive display for mobile devices | ||
- TOC support | ||
- mermaid, nomnoml, Math rendering support | ||
- Code highlighting and copy support | ||
|
||
## 🚀Quick Start | ||
|
||
Currently, the tool has been released in the form of 'dotnet tool'.You can easily install and use it. | ||
|
||
### Using tools | ||
|
||
We assume that you already have some markdown documents in the `markdown` directory. | ||
|
||
Now we use the command: | ||
|
||
```pwsh | ||
ezblog init | ||
``` | ||
|
||
Initialize a 'webinfo.json' file to configure the basic information of your blog. This file can be reused during subsequent generation.The document reads as follows: | ||
|
||
```json | ||
{ | ||
"Name": "Niltor Blog", // blog name, displayed at the top of the homepage navigation | ||
"Description": "🗽 for freedom",// description, displayed in the middle of the top of the homepage | ||
"AuthorName": "Ater", // Author name, displayed in the blog list | ||
"BaseHref": "/blazor-blog/", // sub directory | ||
"Domain": "https://aterdev.github.io" // Domain name, used for generating a sitemap. Leave it blank if not needed | ||
} | ||
``` | ||
|
||
> [!IMPORTANT] | ||
Please note that the trailing `/` in `BaseHref` is mandatory. | ||
> | ||
If you have configured a custom domain name and are not using a subdirectory, set BaseHref to '/'. | ||
|
||
Then we use the command | ||
|
||
```pwsh | ||
ezblog build .\markdown .\WebApp | ||
``` | ||
|
||
This command will convert all markdown files in the 'markdown' directory into html files and generate them into the 'WebApp' directory. | ||
|
||
You can use the `http-server` command to start a local server and view the generated content. | ||
|
||
The 'WebApp' directory contains everything you need for a static website, and you can freely deploy it wherever you need. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,42 @@ | ||
#!/usr/bin/env node | ||
import dotnet from 'node-api-dotnet'; | ||
import { Command } from "commander"; | ||
import "./bin/BuildSite.js"; | ||
|
||
|
||
const Cmd = dotnet.BuildSite.Command; | ||
|
||
const program = new Command(); | ||
|
||
program.name('ezblog') | ||
.description('Generates a pure static blog website from a markdown document'); | ||
|
||
program.command('init') | ||
.description('初始化webinfo.json配置文件') | ||
.argument('[path]', '目录') | ||
.action((path) => { | ||
if (path == null) { | ||
path = '' | ||
} | ||
Cmd.Init(path); | ||
}); | ||
|
||
|
||
program.command('build <source> <output>') | ||
.description('生成静态博客站点') | ||
.argument('<source>', 'markdown文件目录') | ||
.argument('<output>', '站点输出目录') | ||
.action((source, output) => { | ||
Cmd.Build(source, output); | ||
}); | ||
|
||
program | ||
.action(() => { | ||
console.log('No command provided. Use --help to see available commands.'); | ||
}); | ||
|
||
program.on('--help', () => { | ||
console.log('Generates a pure static blog website from a markdown document'); | ||
}); | ||
|
||
program.parse(process.argv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
{ | ||
"name": "ater.ezblog", | ||
"version": "0.1.0", | ||
"bin": { | ||
"ezblog": "./index.js" | ||
}, | ||
"description": "Generates a pure static blog website from a markdown document through commands", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/AterDev/EasyBlog" | ||
}, | ||
"homepage": "https://github.com/AterDev/EasyBlog", | ||
"readme": "README.md", | ||
"author": "NilTor", | ||
"license": "MIT" | ||
"license": "MIT", | ||
"type": "module", | ||
"dependencies": { | ||
"commander": "^12.1.0", | ||
"node-api-dotnet": "^0.7.34" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.