ORIGIN
The Making of EngieBenji.com
Creating my personal blog, EngieBenji.com, has been an exciting journey. Here’s a behind-the-scenes look at how I built the site using Jekyll and GitHub Pages.
Why Jekyll?
I chose Jekyll for its simplicity and efficiency. As a static site generator, it allows me to create fast, secure, and easily maintainable websites. It’s perfect for blogs and personal projects because it converts plain text into static websites and blogs. Plus, it integrates seamlessly with GitHub Pages.
Setting Up with GitHub Pages
GitHub Pages is a free service provided by GitHub that allows you to host your website directly from a GitHub repository. Here’s a brief overview of the steps I took:
-
Creating the Repository: I started by creating a new repository on GitHub named
engiebenji.github.io
. This naming convention is important as GitHub Pages uses it to serve the site. -
Installing Jekyll: On my local machine, I installed Jekyll by following the official Jekyll installation guide. Once installed, I used the
jekyll new
command to create a new Jekyll site.gem install bundler jekyll jekyll new engiebenji cd engiebenji
-
Customizing the Site: I customized the default template by editing the
_config.yml
file and creating my own layouts, includes, and posts. I focused on creating a clean, professional design that reflects my personal brand and showcases my engineering projects and ideas. -
Pushing to GitHub: After making my changes, I pushed the local Jekyll site to the GitHub repository.
git init git add . git commit -m "Initial commit" git remote add origin https://github.com/engiebenji/engiebenji.github.io.git git push -u origin main
-
Enabling GitHub Pages: In the repository settings on GitHub, I enabled GitHub Pages and selected the
main
branch as the source. GitHub automatically built and deployed the site.
Benefits of GitHub Pages over Website Generators
While services like Squarespace and Wix offer user-friendly interfaces and customization options, GitHub Pages paired with Jekyll provides several distinct advantages:
-
Cost: GitHub Pages is completely free, making it an excellent choice for personal projects and blogs without any hosting fees.
-
Version Control: With GitHub’s version control system, every change made to the site is tracked. This makes it easy to roll back changes, collaborate with others, and maintain a history of your site’s development.
-
Performance: GitHub Pages delivers static sites, which are faster to load compared to dynamically generated pages from platforms like Squarespace and Wix. This improves user experience and SEO.
-
Flexibility: Jekyll allows for extensive customization and does not limit you to predefined templates and structures. You have full control over your site’s design and functionality.
-
Learning Opportunity: Building a site with Jekyll and GitHub Pages is a great way to improve your web development skills, offering a hands-on experience with HTML, CSS, and Markdown.
Theming with Jekyll
One of the great aspects of Jekyll is the ability to use themes, which provide a base design that you can customize to fit your needs. Here’s how you can use and customize a Jekyll theme:
-
Choosing a Theme: Browse the Jekyll Themes site to find a theme that fits your style. Popular themes are also available on GitHub.
-
Installing the Theme: Once you’ve chosen a theme, follow the installation instructions provided by the theme’s documentation. Typically, you can install a theme by adding it to your
Gemfile
and updating the_config.yml
file.# Gemfile gem "jekyll-theme-name"
# _config.yml theme: jekyll-theme-name
-
Customizing the Theme: After installing the theme, you can customize it by overriding the default files. Create corresponding files in your project’s directory to override the theme’s layouts, includes, and styles.
For example, to customize the theme’s main layout, copy the layout file from the theme’s repository to your
_layouts
directory and edit it to suit your taste.cp $(bundle show jekyll-theme-name)/_layouts/default.html _layouts/
-
Editing Styles: Modify the CSS or SCSS files to change the look and feel of your site. Place your custom styles in the
assets
directory and link them in your layouts. -
Content Updates: Continue to add your content in the
_posts
directory, and push the changes to GitHub. Jekyll will regenerate your site with the customized theme.
Getting a Custom Domain
Using a custom domain for your GitHub Pages site adds a professional touch. Here’s how you can set it up:
-
Purchase a Domain: Purchase a domain name from a domain registrar such as Namecheap, GoDaddy, or any other registrar of your choice.
-
Configure DNS Settings: In your domain registrar’s settings, configure the DNS records to point to GitHub Pages. You will need to create
A
records pointing to GitHub’s IP addresses and aCNAME
record pointing to your GitHub Pages URL.A 192.30.252.153 A 192.30.252.154 CNAME yourusername.github.io
-
Add CNAME File: In your GitHub Pages repository, create a file named
CNAME
in the root directory and add your custom domain name to this file.www.yourcustomdomain.com
-
Verify the Setup: It may take some time for the DNS changes to propagate. Once they do, your site should be accessible via your custom domain.
Maintaining the Blog
Maintaining the blog is straightforward. I write my posts in Markdown, place them in the _posts
directory, and push the changes to GitHub. Jekyll and GitHub Pages handle the rest, regenerating the site and publishing the new content seamlessly.
Conclusion
Using Jekyll and GitHub Pages has made creating and maintaining EngieBenji.com an enjoyable experience. It’s a powerful combination that provides a lot of flexibility without the overhead of managing a server or dealing with complex configurations. Adding a custom domain and theming capabilities further enhances the professional look of the site.