是否有一种自动的方法可以轻松地在Github页面或Heroku上托管使用温特史密斯制作的静态站点?
我尝试过编写一个gruntfile、shell脚本和一些在这个问题中提到的建议,但它们都很难设置。
我基本上是在寻找像这样简单的东西-
wintersmith new myblog
npm install
wintersmith deployPS:能给这个问题加上一个新的温特史密斯标签吗?
发布于 2013-09-15 05:52:16
以下是一些基于我为github页面设置的通用指南。(关于github页面的更多信息)
我有两个文件夹。一个是wintersmith的,另一个是git存储库文件夹。
./myblog/ (wintersmith)
./personalblog/ (git repo)在配置git时,通过以下方法创建./personalblog/:
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),其中包含以下内容:
#!/bin/sh
# ./myblog/build.sh
# other build commands such as javascript or css minifiers
rm -r ./build/
wintersmith build然后,我检查并验证了温特史密斯的建筑。我使用http-server进行验证。我需要另一个bash脚本文件来进行部署:
#!/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希望这些指导方针对你有帮助。
https://stackoverflow.com/questions/18762081
复制相似问题