Menu

How to create a blog with GitLab Pages
📰

How to create a blog with GitLab Pages

DEV Community: gitlab·Noan·7 months ago
#rn5UThtO
#dev#subdomains#class#code#highlight
Reading 0:00
15s threshold

If you to need to host a blog, GitLab can help to build and host it with GitLab Pages. In this tutorial we'll use GitLab CI and Jekyll to deploy your blog. This is the configuration I use for my personal website .

Prerequisites

Have a project hosted on GitLab

1. Create and build your blog locally

1.1 Create a homepage and an article

cd my-project

In index.html

--- --- <!DOCTYPE html> <html lang= "en" > <head> <meta charset= "UTF-8" > <meta name= "viewport" content= "width=device-width, initial-scale=1.0" > <title> My first blog </title> </head>

<body> <section> <h2> <!-- {{ link | absolute_url}} is a 'Liquid' expression Jekyll will interpret to prefix the link with the url and the base_url previously defined --> <a href= "{{'/articles/my-first-article.html' | absolute_url}}" > My first article </a> </h2> </section> </body> </html>

The 2 dashed lines at the top of the markdown file define your Front Matter , this is a .yml configuration section for your page we will talk about later

In…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.