Here are some developer-oriented thoughts from Solita Oy. Our stories have not yet been told. More will come. Stay tuned at http://dev.solita.fi.
We use a combination of Jekyll and Github Pages to run the site.
If you want to write a post, here's how:
- Fork this project to yourself (upper right corner)
- You need a Github account to do this
- Clone your own fork to your computer (git clone)
- Add your author info to
_config.yml
- The email value is a MD5 hash of your email
- Optional: Make sure you have a gravatar account (www.gravatar.com) with solita.fi email address and photo of yourself.
- Write a new post under the
_posts
folder using Markdown, look at other posts for example of what to write there - Optionally preview your post locally (instructions below, Docker included)
- Create a pull request at https://github.com/solita/solita.github.com/pull/new/master
- Choose your fork on the right
- Write some info about the post
- Wait for comments and publish!
Normally the publication date of a post is read from the filename of the post (YYYY-MM-DD-post-name.md, e.g. 2016-03-02-elasticon.md). In this case the puslishing time will show up as 00:00:00.
If you want to specify the exact time your post was published, you can add a date-field to your post. In the date field you can specify the publication time in the format YYYY-MM-DD HH:MM:SS +/-TTTT.
For example:
---
...
date: 2016-04-25 13:30:00 +0200
...
---
You need Ruby and Jekyll if you want to preview your posts locally on the blog. If you're fine with just previewing the Markdown, you can use a Markdown preview script, like this one for Sublime Text or this one for VS Code. You can also choose to preview post in GitHub.
Super-fast, live-reload for posts, sass and templates.
- You have docker installed? Right?
- Run
docker/init.sh
, this can take a while but should be run only once - Run
docker/start.sh
(note: if you use fish, you need to replacepwd
with $(pwd)), keep it running, stop with ctrl+c - Head to http://localhost:4444
- Edit post with your favourite editor and check changes via browser
Next time when conjuring new post, only docker/start.sh
should do it.
Troubleshooting:
docker rmi solita-blag
-> Delete image
docker/troubleshoot.sh
-> Opens bash to container without starting jekyl and compass
Windows? Help wanted!
- Install Vagrant
- Install Virtualbox
cd vagrant
vagrant up blag
- Wait patiently as the ruby goodness is downloaded and configured
- http://localhost:4444 now should serve your version of the blog
If anything goes wrong, good luck. vagrant ssh blag and try figure it out.
When you're done you might want to shutdown the virtual machine. vagrant destroy or something like that.
For Windows, download & install the latest Ruby 2.x and Development Kit from http://rubyinstaller.org/downloads/
Note: Make sure to tick the checkbox "Add Ruby to PATH" (or something). You can also try: https://github.com/vertiginous/pik/
For Debian (Jessie), the easiest path seems to be:
sudo apt-get install bundler zlib1g-dev
bundle install
bundle exec jekyll serve --watch
For OSX, use the instructions below. If you have installed Xcode, you might have ruby already. No guarantees about this working with that so use RVM
curl -L https://get.rvm.io | bash -s stable --ruby=2.2.1
- fork this repo
- go to your working copy of solita.github.com
rvm use 2.2.1
- verify that 2.2.1 used by
ruby -v
(On linux you might need to fix gnome-termina: http://rvm.io/integration/gnome-terminal) gem install bundler
- Run
bundle install
for depencies - Make sure the installation succeeds
- Type in:
bundle exec foreman start
- Open browser to: http://localhost:4000/
For development, you need Ruby and Jekyll. If you want to tweak the CSS, you need Compass. Also, if you want to make stuff easier, install foreman.
- Install Ruby (above)
- Go to your cloned copy of solita.github.com
- To install Jekyll, Compass and foreman, type into a command prompt or terminal:
bundle install
- Make sure the install succeeds
- Type in:
bundle exec foreman start
- Jekyll and Compass should start!
Note: This concerns only people who forked this repo when it was still running Jekyll 2 (prior to 25.4.2016).
GitHub has recently moved from using Jekyll 2 to Jekyll 3. Starting from 1.5.2016 GitHub will only support Jekyll 3, so this repository has been updated to use the new version also.
If you're interested in the changes the update brings, you can read about them here https://github.com/blog/2100-github-pages-now-faster-and-simpler-with-jekyll-3-0. The way posts are written does not change at all, so for a blog author the changes are practically unnoticable.
First thing to do is to synch your fork with the changes in the main repository. If you don't know how to do this, GitHub has good instructions. First you need to add the main repository as a remote (https://help.github.com/articles/configuring-a-remote-for-a-fork/) after which you can sync your fork (https://help.github.com/articles/syncing-a-fork).
To add upstream named remote and sync changes with your fork you want to do something like this.
git remote add upstream https://github.com/solita/solita.github.com.git
git checkout master
git fetch upstream
git merge upstream/master
git push origin master
If you're using Vagrant, you're already done! Just start vagrant with vagrant up blag
like before.
Jekyll 3 only supports Ruby 2. First check which version you have with ruby -v
.
If already have Ruby 2.x, simply update the local gems with bundle update
.
If you currently have Ruby 1.x, you must first install Ruby 2 and then install the packages in the gemfile. For Windows, you can get Ruby 2 from http://rubyinstaller.org/downloads/. For OSX, you can install Ruby 2 with RVM:
rvm install 2.2.1
rvm use 2.2.1
gem install bundler
bundle install
/dev/solita is built using all the hippiest hip technologies available:
git, Github Pages, Ruby, Jekyll, Markdown, Sass, Compass, foreman, jQuery, Gravatar, disqus, Google Analytics, AddThis