Hello world! That’s the term you would normally see in the very first post of a Blog. What then is this text doing in a blog filled with 2 year older articles you ask?
When the DMU started and our big boss Anders Härén started his work here we joined the blog system of the rest of the company, shared some articles from time to time and ended up forgetting it. Last spring we had to device a way to share our job offers and after some nifty Swedish (The Swedes seem to have a tendency to discuss a lot) discussions it was decided to put dmu.mittmedia.se online. But with that question rose if we as a team couldn’t have a place where we could present ourselves, our work and combine that with the job offers.
A Wordpress blog?
no! After years of working with Ruby, NodeJS, cutting-edge tech on hackneys and being awesome people in general, going back to the world of PHP and Wordpress felt like some kind of technological stone-age. Time for something new that we could show off with. Time for Jekyll. and Github pages because those are awesome!
How does that work?
Github pages are build and compiled with jekyll. This awesome framework allows markdown and html to be merged and uses liquid for some programming (with a swish of yml). Jekyll will build a static website when a repository is pushed.
Check Jekylls site for more info.
Let’s write a blogpost here.
First of all we need to make a new file in the
name this file like this:
Before we can start writing we need to prepare some stuff. First on the list is the header with important information. Copy the block bellow to get started. I’ll try to explain how everything works.
--- describes that we start or stop our description. In markdown this is one of the ways to start a “table”
The layout describes which container html file should be loaded with our blog post. in this case we need the
post.html from the
the title defines the title of our article in the article listing an on top of the page in our browser tab
This represents the date of your article. It also notes time. So you could post multiple times a day.
This is one of the items that we added ourselves. It is behaviour that differs a bit from Jekyll’s normal ways.
_config.yml a list of users is defined with matching id’s.
My user id for example is 2. All articles marked with that userid will automatically get my fancy picture and name on top of them. Scroll up to check it out.
Pictures are important and we give all our blog posts a nice picture in both the header and the list pages. Make the title look like your date (but without the dashes). You don’t need to include the jpg
file extension name as we use the name to build a full file path in the code.
make to pictures in the images folder:
You are allowed to make the pictures a bit bigger if you want. Css will automatically crop them in place. do remember that bigger files equal longer loading times to the end-users.
Do you want to use additional pictures in your post? upload them via Imgur or put them in a date-tagged folder in the
Write your categories here (separated by a spacebar). The first category will be used to query other articles and put them in the more section. Try to downcase categories as we use the namespace to formulate the word “mer [category name here]” extra capitols would look messy (unless were referring names, places, etc. here)
So what now?
If you as one of our fellow readers think “Why did I just read an instruction manifest for the team?”. You are in luck. Do you have a cool story for us or a piece of research that we should mention here?
Fork this repo, write your own cool story and do a pull request here. Guest users like you can use userid: 0. Don’t forget to include your real name somewhere and email if you want to share that kind of stuff. We’d love to give credit to the right people.