1 Star 5 Fork 3

suziwen/小书匠官网博客源码

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

xiaoshujiang.com

该源码为小书匠官网( http://soft.xiaoshujiang.com )静态博客生成源码。 使用开源的静态博客生成工具 gatsby 生成,同时添加了小书匠导出的 zip 文件做为数据源的插件。

目前源代码放在 github 和 gitee 两个平台上, github 适合外网用户访问, gitee 适合国内这边的访问。

本地运行

node > 8.9.* gatsby > 2.3.* git

可以考虑使用 nvm 管理不同版本的 node https://github.com/nvm-sh/nvm

git clone https://github.com/suziwen/roadbike
nvm use 8.9.1
cd roadbike/plugins/gatsby-transformer-xsjzip
npm  install
npm run build
cd roadbike
npm  install
npm run start

访问 http://localhost:8000

注: 这里需要先把 gatsby-transformer-xsjzip 编译一下,生成相关的 js 文件,才能在根目录下正常执行其他操作

添加文章

  1. 通过小书匠编辑器 http://markdown.xiaoshujiang.com 的导出功能,将文章导出为 zip 格式
  2. 将该 zip 文件放置到 src/xsjposts/blogs 目录下
  3. 执行 npm run build
  4. 编译后,再执行 npm run develop
  5. 访问 http://localhost:8000/blog , 就可以在列表里查看到刚添加的文章了。

打包发布

npm run deploy

注:

  1. 需要自己在 package.json 里,把对应的服务器地址调整一下。
  2. 如果发布在非根路径的网站上,比如 roadbike,需要在 gatsby-config.js 里添加 pathPrefix: "/roadbike", 属性
  3. 在 package.json 的打包脚本里带上 --prefix-paths 参数

License

MIT

MIT License Copyright (c) 2019 苏滋文 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.

简介

小书匠官网博客源码 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/suziwen/roadbike.git
git@gitee.com:suziwen/roadbike.git
suziwen
roadbike
小书匠官网博客源码
master

搜索帮助