1 Star 1 Fork 1

caixw / blogit

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

blogit

Test Go version PkgGoDev codecov License

简单方便的静态博客生成工具

  • 没有分类信息;
  • 也不区分页面和文章;
  • 仅通过标签对文章进行归类;
  • 可生成 RSS、Atom 和 Sitemap 等数据;
  • 存档页按可以按月和年进行分类;
  • 采用 Go 模板作为主题模板语法;
  • 可在主题中指定代码高亮;
  • 生成静态 TOC 数据;

安装

macOS 和 linux 用户可以直接使用 brew 进行安装:

brew tap caixw/brew
brew install caixw/brew/blogit

常用平台也可以从 https://github.com/caixw/blogit/releases 下载,并将二进制文件放入 PATH 即可。

如果不存在你当前平台的二进制,可以自己编译:

git clone https://github.com/caixw/blogit.git
cd blogit
./build.sh

docker

目前 docker 同时托管于 docker.ioghcr.io,可通过以下方式获取相应在的容器:

docker pull docker.io/caixw/blogit:latest

docker pull ghcr.io/caixw/blogit:latest

使用

blogit init dir 可以直接生成一个完整的博客系统。具体使用可参考 USAGE

GitHub action

如果你的网站部署在 github 的话,可以直接使用 action 实现全程自动化编译上传代码。

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: checkout source
      uses: actions/checkout@v2
      with:
        repository: owner/src
        path: src/

    - name: checkout dest
      uses: actions/checkout@v2
      with:
        repository: owner/dest
        path: dest/
        persist-credentials: false # github-push-action@master 需要这个
        fetch-depth: 0 # # github-push-action@master 需要这个

    - name: build static site
      uses: caixw/blogit@master
      with:
        src: src
        dest: dest

    - name: commit files
      uses: EndBug/add-and-commit@v7
      with:
        author_name: github-actions
        author_email: 41898282+github-actions[bot]@users.noreply.github.com
        cwd: dest/
        push: false
        message: 'docs: add changes'

    - name: push changes
      uses: ad-m/github-push-action@master
      with:
        directory: dest/
        github_token: ${{ secrets.GITHUB_TOKEN }} # 确保有相应的权限
        branch: ${{ github.ref }}

secrets.GITHUB_TOKEN 关联的 PAT 需要有写入 owner/dest 指向的仓库的权限。

参数

名称 类型 必填 默认值 描述
src string true src 源文件的路径
dest string true dest 编译后的路径

版权

本项目采用 MIT 开源授权许可证,完整的授权说明可在 LICENSE 文件中找到。

MIT License Copyright (c) 2020 caixw Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

静态博客生成工具 展开 收起
Go 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Go
1
https://gitee.com/caixw/blogit.git
git@gitee.com:caixw/blogit.git
caixw
blogit
blogit
master

搜索帮助