Projekat

Općenito

Profil

Akcije

Podrška #16766

Zatvoren

blogging with jekyll static blogs generator

Dodano od Ernad Husremović prije oko 16 godina. Izmjenjeno prije skoro 15 godina.

Status:
Zatvoreno
Prioritet:
Normalan
Odgovorna osoba:
Kategorija:
-
Početak:
20.03.2009
Završetak:
% završeno:

10%

Procjena vremena:


Povezani tiketi 1 (0 otvoreno1 zatvoren)

korelira sa developer toolbox - Podrška #19037: webby, hernad.bring.out.baZatvorenoErnad Husremović05.12.2009

Akcije
Akcije #2

Izmjenjeno od Ernad Husremović prije oko 16 godina

http://www.oiledmachine.com/posts/2008/12/27/overview-of-jekyll--a-static-site-generator-written-in-ruby.html

GitHub Pages was announced a couple of weeks ago and seemed to be received quite well. Although I find this service extremely awesome, especially now that they’ve gone even further with it than their initial announcement, the bit of news that excited me more was released much earlier: Jekyll. In fact, I used Jekyll to generate this site for me.

The connection between GitHub Pages and Jekyll is that each Pages-bound repo is piped through Jekyll automatically, allowing you to create a site and host it at GitHub. The beauty of this system is that all your posts and site changes are stored in your Git repo allowing your site the benefits of a distributed VCS such as the ability to sync your site on any machine, pull or push changes to the GitHub repo and publishing posts remotely by pushing new posts in raw markdown form to GitHub.

Of course you can choose not to use Jekyll with GitHub and opt for another VCS or eschew VCS altogether. So far you may be thinking that these benefits don’t seem like much compared to a typical Wordpress install and you’d be right! After all Wordpress offers version controlled posts, the ability to submit new posts from any web browser and import/export tools for your posts. People who choose to use Jekyll will probably have these requirements:
1. Limited hosting facilities such as lack of a DBMS.
2. Command-line junkies.
3. Need to merge changes and track revisions VCS style.

In fact, the latter point seems ideal for software projects with large groups of people contributing to the site documentation and is what looks to be addressed by the latest GitHub Pages generation feature for existing hosted projects.

As one redditor commented, the barrier to entry for Jekyll with a VCS is high. You must have knowledge of VCS’s as well as being very comfortable in the command line. If you are happy with that, the end gain and primary advantage of Jekyll + a VCS seems to be an efficient and transparent way of storing your version controlled posts, plus it lets you blog like a hacker.
Templating Troubles

The worst aspect in setting up this site was dealing with the templating engine Liquid. For example I could not find a way to loop over the site topics like so:

{% for topics in site.topic_list %}
        {% for post in site.topics.topic %}
                {{ post.date | date_to_long_string }} » {{ post.url }} {{ post.title }}
        {% endfor %}
{% endfor %}

(Just a note: there is no site.topic_list attribute. I forked the project and added it in /lib/site.rb. Also, there is no site.topics attribute in v0.3.0. If you wish to use it we’ll have to see if Tom accepts my pull request. Or you can apply my patch, or you can clone the forked repo.)

.topic_list was just a list of all topics belonging to a site. In this case, I was using Jekyll’s topics as tags and foregoing categories. The difference seems to me to be semantical and as I don’t require 2 levels of categorisation for posts, I chose the latter as it appears to me to be a cleaner way of organising posts in terms of directory structure, i.e.

/_posts/tag1/tag2/yyyy-mm-dd-post-title.markdown

as opposed to

/cat1/cat2/_posts/yyyy-mm-dd-post-title.markdown

So I wanted a method of tagging posts and the ability to display all tags with corresponding posts in a site. For this, I used the pre-existing topics functionality and added the .topics attribute to the Site Liquid object. This now allows me to display my posts (use the ‘topics’ link in this page’s header) organised by tag/topic.

The disadvantage of this comes back to Liquid. I could not figure out a way to use the enumerator inside the Liquid for loop tags as an attribute name (see above). So currently this means I must specify the topic name manually like so:

{% for post in site.topics.TOPICNAME %} {{ post.date | date_to_long_string }} » {{ post.url }} {{ post.title }} {% endfor %}

Where TOPICNAME is ruby or github (i.e. the topics for this post, and all the topics currently in use for this site).

This was the only issue that came up and was not a dealbreaker. That is as complicated as the Liquid markup got.
How do I get started with Jekyll?

So from all this, you can see that Jekyll is still a young project but showing promise and has the ability right now to publish fully blown blogs. It will appeal to people who like to get their hands dirty. However once you have set up the infrastructure of your site, the process of creating and pushing your posts should be very simple.

Dr Nic has created a generator that creates a simple Jekyll site structure for you with a choice of 2 themes. It even includes the Disqus and Lighthouse code you need. Unfortunately he didn’t count on the agile skills of the GitHub team who released something even more polished a couple days later in the shape of their very own Pages generator which allows existing hosted repo owners to generate a project page from the Admin tab of their account.

The way in which you get started depends on the initial level of control you wish to have over the site.

1. You can install the tool on your own server sudo gem install mojombo-jekyll -s http://gems.github.com/ and generate a Jekyll site structure with Dr Nic’s generator and then tweak it to your liking.
2. If you already have a hosted project on GitHub, you can generate a project page from the Admin tab of your repo. (Note: this feature is currently unavailable. In place of the generate link is this text: ‘Page generation is disabled while we sort out a bug.’.)
3. Or you can create a GitHub account if you don’t have one already, set up a new repo called your_username.github.com and push your Jekyll structure to it in the master branch.

Static-site generators

Having only used Jekyll, I found the whole process very satisfying. There is a minimalist simplicity in the ability to serve pre-generated static pages instead of relying on a DBMS to store content for you. As well, all your posts are in simple text files stored in a logical directory structure which is (hopefully) backed up to a VCS in the cloud, minimising the chance that you could ever lose your posts.

The Unix-like approach of storing everything in text seems to suit this particular application because in essence, there is little that needs to be done to produce content, able to be rendered by web browsers. As well, I am using Vim to author this post - it almost doesn’t feel like I’m writing text. It feels like I’m doing some sort of sysadmin task and that is probably part of the appeal and why I like it so much.

Akcije #4

Izmjenjeno od Ernad Husremović prije oko 16 godina

lijep jekyll blog http://jonasboner.com/

Akcije #6

Izmjenjeno od Ernad Husremović prije oko 16 godina

evo ga! ovaj blog tražim više od sahat http://metajack.im/

Akcije #7

Izmjenjeno od Ernad Husremović prije oko 16 godina

ovo je članak http://metajack.im/2009/01/23/blogging-with-git-emacs-and-jekyll/

ovaj metajack.im ima tagcloud napravljen

Akcije #8

Izmjenjeno od Ernad Husremović prije oko 16 godina

Akcije #10

Izmjenjeno od Ernad Husremović prije oko 16 godina

joj jesam brizgonja :(

na mom delicious bookmark sistemu to je zadnji tag http://delicious.com/hernad

Akcije #11

Izmjenjeno od Ernad Husremović prije oko 16 godina

  • % završeno promijenjeno iz 0 u 10

razmišljam da jekyll bude krovni sadržaj za bring.out.ba ... ne mora jekyll ali mi se sviđa ideja tog statičkog generatora stranica, unutar koga možemo ugnijezditi klasične dinamičke sadržaje ala redmine, zimbru itd

Akcije #12

Izmjenjeno od Ernad Husremović prije skoro 15 godina

  • Status promijenjeno iz Dodijeljeno u Zatvoreno
Akcije

Također dostupno kao Atom PDF