Blog

screenshot of Blog
jekyll

Xmartlabs Blog

Overview

The Xmartlabs Blog is a platform that showcases the work of Xmartlabs and provides insights, tips, and news related to their projects. Built using Jekyll, a simple and static site generator, the blog offers a local setup option as well as a setup using Docker. Additionally, the blog has a staging environment for testing purposes, and it features the latest blog posts in the featured section.

Features

  • Local setup option for cloning the project and installing Ruby and Jekyll.
  • Docker setup option for cloning the project and using docker-compose.
  • Staging environment for testing blog posts.
  • Ability to set featured posts with custom variables.
  • Social images can be defined for blog posts.

Local setup

  1. Clone the project into your machine:
git clone git@github.com:xmartlabs/blog.git
  1. Install Ruby 2.6.3 (you can use rbenv).
  2. Install Jekyll and bundler in this Ruby version by running:
gem install jekyll bundler
  1. Go to the folder for this repository and build the site with jekyll serve or jekyll serve --host=0.0.0.0 (if you want to use it from your phone or other machine).
  2. Now browse to http://localhost:4000 or http://YOUR-IP:4000.

Local setup using Docker

  1. Clone the project into your machine:
git clone git@github.com:xmartlabs/blog.git
  1. Install Docker and docker-compose.
  2. Go to the folder for this repository and build the site with docker-compose up.

Testing the blogpost

To test your blogpost, you have the following options:

Using the Staging environment

The blog has a staging environment hosted at blog-staging.xmartlabs.com, which can be used to test the blogposts you're working on. This environment is the result of deploying the last commit of the staging GitHub repository.

To deploy a new staging version:

  1. Add the staging GitHub repository remote URL.
  2. Push the commit that you want to deploy.
  3. All pull requests are automatically deployed to the staging environment. To exclude a pull request, add the label 'not-deploy'.
  4. To deploy a new version of your pull request, add a new commit or label.

Note: Newest blogposts will be shown on the featured section.

Printing environment variables

You can check if the custom variables are properly set up by running:

printenv | grep MEDIUM

Next time you build or serve the blog locally, it will be sent to Medium as a draft story.

Social Images

Social images can be defined using social_image and twitter_image post variables. The dimensions for social_image should be 1200x627 pixels, while twitter_image should have a proportion of 2:1 (e.g. 1600x800 pixels).

If these variables are not defined, the featured_image is used by default.

Summary

The Xmartlabs Blog is a platform that showcases the work of Xmartlabs and provides insights, tips, and news related to their projects. With options for local setup and Docker setup, as well as a staging environment for testing, the blog allows for easy deployment and customization. It also features the latest blog posts in the featured section and supports social images for better sharing on social media platforms.

jekyll
Jekyll

Jekyll is a static site generator written in Ruby that allows you to create simple, fast, and secure websites without the need for a database.

blog
Blog

Blog websites feature posts written by one or more authors, organized by categories and tags, with a section for comments and archives sorted by date or topic. Additional features may include search bar, social media sharing, subscription or RSS feed, about and contact pages, and visual content.