We use jekyll static site generator which supports github pages. So this blog is hosted on github.
Create a file in the _posts
folder with the name in the form of YEAR-MONTH-DAY-post_name
. The post name will be a url to this post, so date will be cut and is used only for ordering.
To attach files and images, you can put them in the assets
folder.
When you push to the master
branch, github automagically compile this blog and update data. It may consume 5 minutes.
You need to have docker been installed on you machine. Also we use make
to simplify commands.
make
- run servermake test
- test blog, links, stylesmake build
- build blog. Actually you do not need this.make update
- update gems.make down
- destoy docker container.
You need a ruby installed on your computer - Download ruby. On linux, osx you can do it via package manager, but i recommend to use RVM.
Install bundler: gem install bundler
.
Now go to the project location and run bundle install
to setup requirements.
Just run bundle exec jekyll server
from the command line in the project root. It will start a server with livereload.
See result here localhost:3000.
In the jekyll usually create a theme and customize it. In our case we do not use themes but have our own styles, layouts and so on.
In the assets
are styles, scripts, images, files. Actually you could use sass and even coffeescript.
In the _layouts
are layouts - it's "bacground" pages. In the _posts
you can specify which layout to use for each post.
In the _includes
are partials. For example, header, footer, discuss block and so on.
In the _plugins
are custom tags.
In the _config.yml
you can put some variables, for example email, social network links, domain name and so on.
Post intro:
{% post_intro {"photo":"/assets/images/2018/04/anna.jpg", "name":"Анна Тарасенко","position":"рулевой 7bits","text":"Новый 2018 год начался встречей со студенткой, которую почему-то интересовал мой путь в ИТ.<br>Ну, в общем-то, почему бы и не написать об этом?<br>Думаю, что кое-какие лайфхаки из этого рассказа вы почерпнете."} %}
Post quote:
{% post_quote {"name":"Анна Тарасенко","position":"рулевой 7bits","text":"Это было выживание, потому что зарплата у меня была 1100 рублей в месяц (и это потому, что красный диплом! а то была бы 1000)."} %}