Markdown-Blog is incredibly fast, easy to use, and converts Markdown formatted text files into beautifully rendered HTML pages.
Designed with simplicity and ease-of-use in mind, this application allows users to create and publish blog content without the need for complex web development skills. anyone can use this software to create professional-looking blogs with minimal hassle. Whether you're a blogger, writer, or developer, our static blog generator is an excellent choice for creating fast, stylish, and aesthetically pleasing website.
Style | Preveiw |
---|---|
Dark | ![]() |
Light | ![]() |
Dark | Light |
---|---|
![]() |
![]() |
Windows, Linux, Mac OS
-
[v1.1.1]
2023-05-20- Support setting record number
- Fix cache parameter invalidation
- Support reading local files, including but not limited to pictures
- windows environment parsing problem
- MD folder, read only markdonw files
- Other known issues fixed
-
[v1.1.0]
2022-11-26- Support for comments
- Parameter setting, support reading from local file (config.yml)
- Support for loading favicon.ico
- Other known issues fixed
-
[v1.0.0]
2022-11-20- Support for Docker deployments
- Packaged static files, optimized for a single application, no more external web directories
- Other known issues fixed
-
[v0.1.1]
2022-11-12- New third-party analysis statistics configuration, including: Baidu, Google
- Support configuration page cache time
- Mobile style optimization
- Other known issues fixed
-
[v0.0.5]
2022-11-06- Support TOC syntax, when the first line of the file content using
[toc]
will be automatically parsed - New bright 🔆 theme, support light and dark switch
- Other known issues fixed
- Support TOC syntax, when the first line of the file content using
-
Download release
-
Decompress
tar zxf markdown-blog-v0.0.5-linux-amd64.tar.gz
- create markdown file directory
cd markdown-blog-linux-amd64
mkdir md
echo "## Hello World" > . /md/home.md
- run
. /markdown-blog web
- Visit http://127.0.0.1:5006 to see the results
- Download
docker pull willgao/markdown-blog:latest
-
Start
- online environment
docker run -dit --rm --name=markdown-blog \ -p 5006:5006 \ -v $(pwd)/md:/md -v $(pwd)/cache:/cache \ willgao/markdown-blog:latest
- Development environment
docker run -dit --rm --name=markdown-blog \ -p 5006:5006 \ -v $(pwd)/md:/md -v $(pwd)/cache:/cache \ willgao/markdown-blog:latest \ -e dev
-
Visit http://127.0.0.1:5006 to see the results
-
Other usage
# View help
docker run -dit --rm --name=markdown-blog \
-p 5006:5006 \
-v $(pwd)/md:/md -v $(pwd)/cache:/cache \
willgao/markdown-blog:latest -h
# Set the title
docker run -dit --rm --name=markdown-blog \
-p 5006:5006 \
-v $(pwd)/md:/md -v $(pwd)/cache:/cache \
willgao/markdown-blog:latest \
-t "TechMan'Blog"
# Set up Google stats
docker run -dit --rm --name=markdown-blog \
-p 5006:5006 \
-v $(pwd)/md:/md -v $(pwd)/cache:/cache \
willgao/markdown-blog:latest \
-t "TechMan'Blog" \
--analyzer-google "De44AJSLDdda"
- markdown-blog
- h to view the version
- web to run the blog service
- markdown-blog web
- -config FILE Load configuration file, default is empty
- -dir value, -d value Specify the markdown folder, default: . /md/
- -title value, -t value Web service title, default: "Blog"
- -port value, -p value Web service port, default: 5006
- -env value, -e value Runtime environment, optional: dev,test,prod, default: "prod"
- -index value, -i value Set the default home page file name, default is empty
- -cache value, -c value Set the page cache time, in minutes, default is 3 minutes
- --icp value ICP record number, default is empty
- --copyright value Copyright year, default current year, such as: 2023
- --fdir value The name of the static resource directory under the markdown directory, such as pictures, etc., the default is "public"
- -analyzer-baidu value Set Baidu analyzer statistics
- -analyzer-google value Set Google analyzer statistics
- -gitalk.client-id value Set Gitalk ClientId, default is null
- -gitalk.client-secret value Set Gitalk ClientSecret, default is null
- -gitalk.repo value Set Gitalk Repo, default is null
- -gitalk.owner value Set Gitalk Owner, default is null
- -gitalk.admin value Set Gitalk Admin, default is array [gitalk.owner]
- -gitalk.labels value Set Gitalk Admin, default is array ["gitalk"].
- -ignore-file value Set ignore file, eg: demo.md
- -ignore-path value Set ignore folders, eg: demo
- -h Help
Support reading configuration items from configuration file, but specify parameters to take precedence over configuration file at runtime, refer to
config/config.yml.tmp
for configuration content
-
create a new configuration file
config/config.yml
2. -
load the configuration file at startup
- Binary file
. /markdown-blog web --config . /config/config.yml
- Docker
docker run -dit --rm --name=markdown-blog \
-p 5006:5006 \
-v $(pwd)/md:/md -v $(pwd)/cache:/cache -v $(pwd)/config:/config \
willgao/markdown-blog:latest --config . /config/config.yml
If
index
is not specified at startup, the program defaults to the first file in the navigation as the home page
The comment plugin uses Gitalk, please read the plugin instructions before using it English | Chinese gitalk/blob/master/readme-cn.md)
gitalk:
client-id: "Your github oauth app client-id, required. e.g.: ad549a9d085d7f5736d3"
client-secret: "Your github oauth app
client-secret, required. e.g.: 510d1a6bb875fd5031f0d613cd606b1d"
repo: "The name of the project you intend to use for comments, required. e.g.: blog-issue"
owner: "Your Github account, required."
admin:
- "Your Github account"
labels:
- "Custom issue labels, e.g.: gitalk"
1. Visit https://tongji.baidu.com to create a site and get the parameter 0952befd5b7da358ad12fae3437515b1
in the official code
<script>
var _hmt = _hmt || [];
(function() {
var hm = document. createElement("script");
hm.src = "https://hm.baidu.com/hm.js?0952befd5b7da358ad12fae3437515b1";
var s = document. getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
./markdown-blog web --analyzer-baidu 0952befd5b7da358ad12fae3437515b1
1. Visit https://analytics.google.com to create a site and get the parameter G-MYSMYSMYS
in the official code
<script async="" src="https://www.googletagmanager.com/gtag/js?id=G-MYSMYSMYS"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer. push(arguments);}
gtag('js', new Date());
gtag('config', 'G-MYSMYSMYS');
</script>
./markdown-blog web --analyzer-google G-MYSMYSMYS
By default, read the favicon.ico file in the same directory as the program is running
The blog navigation is sorted by
dictionary
by default, you can customize the order by the number in front of@
Nginx reverse proxy configuration file reference
server {
listen 80;
listen [::]:80;
server_name yourhost.com;
location / {
proxy_pass http://127.0.0.1:5006;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 80;
listen [::]:80;
server_name yourhost.com;
location / {
rewrite ^ https://$host$request_uri? permanent;
}
}
server {
listen 443 ssl;
server_name yourhost.com;
access_log /var/log/nginx/markdown-blog.access.log main;
#Certificate file name
ssl_certificate /etc/nginx/certs/yourhost.com_bundle.crt;
#Private key file name
ssl_certificate_key /etc/nginx/certs/yourhost.com.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://127.0.0.1:5006;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
-
Download the latest version release
-
Stop the program, decompress and replace
markdown-blog
-
Restart the program
-
Install
Golang
development environment -
Fork source code
-
Start the web service
After running, visit the address http://localhost:5006, and the API request will be forwarded to
markdown-blog
programmake run
-
Compile
Generate the compressed package of the current system in the bin directory, such as: markdown-blog-v1.1.0-darwin-amd64.tar
make
-
Pack
Generate the compressed package of the current system in the package directory, such as: markdown-blog-v1.1.0-darwin-amd64.tar
make package
-
Generate compressed packages for Windows, Linux, and Mac
Generate a compressed package in package, such as: markdown-blog-v1.1.0-darwin-amd64.tar markdown-blog-v1.1.0-linux-amd64.tar.gz markdown-blog-v1.1.0-windows- amd64.zip
make package-all
- If you encounter problems in the project, you can find answers in issues or ask questions directly
- If you have any suggestions and ideas, you can start a discussion in discussions
- Thanks to JetBrains for supporting this project!
This project adopts the MIT open source license, and the complete authorization description has been placed in the LICENSE file.