首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >支持wintersmith的部署

支持wintersmith的部署
EN

Stack Overflow用户
提问于 2013-09-12 10:44:24
回答 1查看 949关注 0票数 2

是否有一种自动的方法可以轻松地在Github页面或Heroku上托管使用温特史密斯制作的静态站点?

我尝试过编写一个gruntfile、shell脚本和一些在这个问题中提到的建议,但它们都很难设置。

我基本上是在寻找像这样简单的东西-

代码语言:javascript
复制
wintersmith new myblog
npm install
wintersmith deploy

PS:能给这个问题加上一个新的温特史密斯标签吗?

EN

回答 1

Stack Overflow用户

发布于 2013-09-15 05:52:16

以下是一些基于我为github页面设置的通用指南。(关于github页面的更多信息)

我有两个文件夹。一个是wintersmith的,另一个是git存储库文件夹。

代码语言:javascript
复制
./myblog/ (wintersmith)
./personalblog/ (git repo)

在配置git时,通过以下方法创建./personalblog/

代码语言:javascript
复制
mkdir personalblog; cd personalblog
git init
git branch -m master gh-pages (this is important! see: https://help.github.com/articles/user-organization-and-project-pages#project-pages)

在github上创建同名存储库。然后设置本地回购的起源。有关更多信息,请看这里。

./myblog中,我有一个bash脚本(build.sh),其中包含以下内容:

代码语言:javascript
复制
#!/bin/sh
# ./myblog/build.sh

# other build commands such as javascript or css minifiers

rm -r ./build/
wintersmith build

然后,我检查并验证了温特史密斯的建筑。我使用http-server进行验证。我需要另一个bash脚本文件来进行部署:

代码语言:javascript
复制
#!/bin/sh
# ./myblog/deploy.sh

# rsync to efficiently sync ./myblog/build to ./personalblog/
# ignore deleteing .git folder and other stuff
rsync -rtvu --delete -f"- .git/" -f"- CNAME" -f"- .gitignore" -f"- README.md" ./build/ ../personalblog/


# change dir
cd ../personalblog/

# sync to github
git add -A
git commit -am "Commit on $(date)"
git push origin gh-pages

希望这些指导方针对你有帮助。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18762081

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档