2

Is there an automated way to easily host a static site made with wintersmith on Github Pages or Heroku?

I have tried writing a gruntfile, shell scripts and a couple of suggestions that were mentioned in this issue but all of them were quite difficult to setup.

I am basically looking for something as simple as this -

wintersmith new myblog
npm install
wintersmith deploy

PS: Can someone put a new wintersmith tag to this question?

Madara's Ghost
  • 172,118
  • 50
  • 264
  • 308
tusharmath
  • 10,622
  • 12
  • 56
  • 83

1 Answers1

3

Here are some general guidelines based on my set up for github pages. (more info on github pages)

I have two folders. One for wintersmith, and one which is a git repository folder.

./myblog/ (wintersmith)
./personalblog/ (git repo)

On configuring your git repo, create ./personalblog/ via:

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)

Create a repository of the same name on github. Then set the origin of the local repo. See here for more info.

Within ./myblog I'd have a bash script (build.sh) with the following:

#!/bin/sh
# ./myblog/build.sh

# other build commands such as javascript or css minifiers

rm -r ./build/
wintersmith build

Then, I check and verify the wintersmith build. I verify using nodejs http-server. I'd have another bash script file for deployment:

#!/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

Hopefully these guidelines are helpful for you.

Alberto Leal
  • 520
  • 2
  • 10
  • 19
  • To be honest, it seems an unnecessary feature for wintersmith since deployment solutions are very specialized for a service/platform. Anyways, it isn't hard to set up a simple deployment script. – Alberto Leal Sep 27 '13 at 22:25
  • if you compare it with other platforms such as wordpress, octopress and a lot of others, they all have built in support for deploying to gh-pages and heroku. This feature completes `wintersmith` as a package. Writing scripts for publishing negates it for evaluation purposes. – tusharmath Sep 28 '13 at 13:58
  • You're free to make an octopress-like framework for wintersmith. But honestly, wintersmith should just do one thing and do it well (akin to the [Unix philosophy](https://en.wikipedia.org/wiki/Unix_philosophy)), which is to generate static pages. Things like deployment becomes [feature creeping](https://en.wikipedia.org/wiki/Feature_creep). So far, most users of wintersmith are power users, and they should have no problem finding ways to easily augment what they want. – Alberto Leal Sep 28 '13 at 16:16
  • "most users of wintersmith are power users" That's a bit circular! Maybe there’d be more normal users if there was an easy to use deployment script? – Jake Rayson Feb 08 '17 at 20:24
  • Also, see this question http://stackoverflow.com/questions/23145621/how-to-publish-pages-on-github and this package https://www.npmjs.com/package/push-dir – Jake Rayson Feb 08 '17 at 20:27