Plebware Control Centre Banner

Creating Header Images Using _config.yml

πŸ–ΌοΈ Creating Header Images Using _config.yml

One of the easiest ways to give a GitHub Pages site a professional appearance is to add a header image. Instead of inserting the same image on every page manually, many Jekyll themes allow you to define a default header image in your _config.yml file.

This creates a consistent look across the entire website and makes site maintenance much easier.


πŸ”‘ What Is _config.yml?

The _config.yml file is the central configuration file for a Jekyll website.

It contains settings such as:

Example:


title: PlebWare

description: Publishing, Learning and Development

When Jekyll builds the site, it reads this file and applies the settings globally.


πŸ”‘ Step 1: Create a Header Image

Create a banner image using your preferred graphics editor.

Good banner sizes include:

Type Recommended Size

| β€”β€”β€”β€”β€”- | β€”β€”β€”β€”β€”- |

Standard Banner 1920 Γ— 400
Wide Hero Image 1920 Γ— 600
Full Screen Hero 1920 Γ— 1080

Save the image as:


header.jpg

or


header.webp


πŸ”‘ Step 2: Store the Image

Place the image inside your assets folder.

Example:


assets/

└── images/

    └── header.jpg


πŸ”‘ Step 3: Add the Header to _config.yml

Many themes support a custom header variable.

Example:


header_image: /assets/images/header.jpg

Your complete configuration might look like:


title: PlebWare

description: Publishing, Learning and Development

header_image: /assets/images/header.jpg


πŸ”‘ Step 4: Display the Header in the Theme

The theme layout must actually use the variable.

Example inside a layout:


<img src="" alt="Site Header">

When the site is generated, Jekyll replaces:




with:


/assets/images/header.jpg


πŸ”‘ Using a Hero Banner

Instead of a simple image, many sites use a hero section.

Example:


<div class="hero">

    <img src="" alt="Header">

</div>

This gives the site a modern appearance and provides room for titles and descriptions.


πŸ”‘ Multiple Header Images

You may wish to use different headers for different sections.

Example:


headers:

  study: /assets/images/study-header.jpg

  linux: /assets/images/linux-header.jpg

  graphics: /assets/images/graphics-header.jpg

Then use:


<img src="">

for specific sections.


πŸ”‘ Page-Specific Headers

A page can override the global header.

Front Matter:


---

layout: post

title: Linux Tips

header_image: /assets/images/linux-banner.jpg

---

Then in your layout:


<img src="">

This tells Jekyll:

  1. Use the page image if one exists.

  2. Otherwise use the site’s default header image.

This is one of the most useful techniques for large websites.


πŸ”‘ PlebWare Example

For a site such as PlebWare, a practical structure could be:


assets/

└── images/

    └── headers/

        β”œβ”€β”€ developer.jpg

        β”œβ”€β”€ linux.jpg

        β”œβ”€β”€ graphics.jpg

        β”œβ”€β”€ study.jpg

        β”œβ”€β”€ ai.jpg

        └── writing.jpg

Configuration:


default_header: /assets/images/headers/developer.jpg

Page example:


---

layout: post

title: Introduction to Bash Scripting

header_image: /assets/images/headers/linux.jpg

---

This creates visual distinction between different areas of the site while maintaining a consistent overall design.


πŸ”‘ Using Background Images Instead

Some themes prefer CSS backgrounds rather than image tags.


layout: post

title: β€œCreating Header Images Using _config.yml”

date: 2026-06-22


πŸ–ΌοΈ Creating Header Images Using _config.yml

One of the easiest ways to give a GitHub Pages site a professional appearance is to add a header image. Instead of inserting the same image on every page manually, many Jekyll themes allow you to define a default header image in your _config.yml file.

This creates a consistent look across the entire website and makes site maintenance much easier.


πŸ”‘ What Is _config.yml?

The _config.yml file is the central configuration file for a Jekyll website.

It contains settings such as:

Example:


title: PlebWare

description: Publishing, Learning and Development

When Jekyll builds the site, it reads this file and applies the settings globally.


πŸ”‘ Step 1: Create a Header Image

Create a banner image using your preferred graphics editor.

Good banner sizes include:

Type Recommended Size

| β€”β€”β€”β€”β€”- | β€”β€”β€”β€”β€”- |

Standard Banner 1920 Γ— 400
Wide Hero Image 1920 Γ— 600
Full Screen Hero 1920 Γ— 1080

Save the image as:


header.jpg

or


header.webp


πŸ”‘ Step 2: Store the Image

Place the image inside your assets folder.

Example:


assets/

└── images/

    └── header.jpg


πŸ”‘ Step 3: Add the Header to _config.yml

Many themes support a custom header variable.

Example:


header_image: /assets/images/header.jpg

Your complete configuration might look like:


title: PlebWare

description: Publishing, Learning and Development

header_image: /assets/images/header.jpg


πŸ”‘ Step 4: Display the Header in the Theme

The theme layout must actually use the variable.

Example inside a layout:


<img src="" alt="Site Header">

When the site is generated, Jekyll replaces:




with:


/assets/images/header.jpg


πŸ”‘ Using a Hero Banner

Instead of a simple image, many sites use a hero section.

Example:


<div class="hero">

    <img src="" alt="Header">

</div>

This gives the site a modern appearance and provides room for titles and descriptions.


πŸ”‘ Multiple Header Images

You may wish to use different headers for different sections.

Example:


headers:

  study: /assets/images/study-header.jpg

  linux: /assets/images/linux-header.jpg

  graphics: /assets/images/graphics-header.jpg

Then use:


<img src="">

for specific sections.


πŸ”‘ Page-Specific Headers

A page can override the global header.

Front Matter:


---

layout: post

title: Linux Tips

header_image: /assets/images/linux-banner.jpg

---

Then in your layout:


<img src="">

This tells Jekyll:

  1. Use the page image if one exists.

  2. Otherwise use the site’s default header image.

This is one of the most useful techniques for large websites.


πŸ”‘ PlebWare Example

For a site such as PlebWare, a practical structure could be:


assets/

└── images/

    └── headers/

        β”œβ”€β”€ developer.jpg

        β”œβ”€β”€ linux.jpg

        β”œβ”€β”€ graphics.jpg

        β”œβ”€β”€ study.jpg

        β”œβ”€β”€ ai.jpg

        └── writing.jpg

Configuration:


default_header: /assets/images/headers/developer.jpg

Page example:


---

layout: post

title: Introduction to Bash Scripting

header_image: /assets/images/headers/linux.jpg

---

This creates visual distinction between different areas of the site while maintaining a consistent overall design.


πŸ”‘ Using Background Images Instead

Some themes prefer CSS backgrounds rather than image tags.

Example:


<div class="hero"

     style="background-image:url('');">

</div>

Benefits include:

Many professional websites use this approach.


πŸ”‘ Common Mistakes

❌ Incorrect Path


header_image: assets/images/header.jpg

Use:


header_image: /assets/images/header.jpg

---

layout: post

title: "Creating Header Images Using _config.yml"

date: 2026-06-22

----------------

# πŸ–ΌοΈ Creating Header Images Using `_config.yml`

One of the easiest ways to give a GitHub Pages site a professional appearance is to add a header image. Instead of inserting the same image on every page manually, many Jekyll themes allow you to define a default header image in your `_config.yml` file.

This creates a consistent look across the entire website and makes site maintenance much easier.

---

# πŸ”‘ What Is `_config.yml`?

The `_config.yml` file is the central configuration file for a Jekyll website.

It contains settings such as:

* Site title

* Description

* Author information

* Theme configuration

* Navigation settings

* Default images

Example:

```yaml

title: PlebWare

description: Publishing, Learning and Development

When Jekyll builds the site, it reads this file and applies the settings globally.


πŸ”‘ Step 1: Create a Header Image

Create a banner image using your preferred graphics editor.

Good banner sizes include:

Type Recommended Size

| β€”β€”β€”β€”β€”- | β€”β€”β€”β€”β€”- |

Standard Banner 1920 Γ— 400
Wide Hero Image 1920 Γ— 600
Full Screen Hero 1920 Γ— 1080

Save the image as:


header.jpg

or


header.webp


πŸ”‘ Step 2: Store the Image

Place the image inside your assets folder.

Example:


assets/

└── images/

    └── header.jpg


πŸ”‘ Step 3: Add the Header to _config.yml

Many themes support a custom header variable.

Example:


header_image: /assets/images/header.jpg

Your complete configuration might look like:


title: PlebWare

description: Publishing, Learning and Development

header_image: /assets/images/header.jpg


πŸ”‘ Step 4: Display the Header in the Theme

The theme layout must actually use the variable.

Example inside a layout:


<img src="" alt="Site Header">

When the site is generated, Jekyll replaces:




with:


/assets/images/header.jpg


πŸ”‘ Using a Hero Banner

Instead of a simple image, many sites use a hero section.

Example:


<div class="hero">

    <img src="" alt="Header">

</div>

This gives the site a modern appearance and provides room for titles and descriptions.


πŸ”‘ Multiple Header Images

You may wish to use different headers for different sections.

Example:


headers:

  study: /assets/images/study-header.jpg

  linux: /assets/images/linux-header.jpg

  graphics: /assets/images/graphics-header.jpg

Then use:


<img src="">

for specific sections.


πŸ”‘ Page-Specific Headers

A page can override the global header.

Front Matter:


---

layout: post

title: Linux Tips

header_image: /assets/images/linux-banner.jpg

---

Then in your layout:


<img src="">

This tells Jekyll:

  1. Use the page image if one exists.

  2. Otherwise use the site’s default header image.

This is one of the most useful techniques for large websites.


πŸ”‘ PlebWare Example

For a site such as PlebWare, a practical structure could be:


assets/

└── images/

    └── headers/

        β”œβ”€β”€ developer.jpg

        β”œβ”€β”€ linux.jpg

        β”œβ”€β”€ graphics.jpg

        β”œβ”€β”€ study.jpg

        β”œβ”€β”€ ai.jpg

        └── writing.jpg

Configuration:


default_header: /assets/images/headers/developer.jpg

Page example:


---

layout: post

title: Introduction to Bash Scripting

header_image: /assets/images/headers/linux.jpg

---

This creates visual distinction between different areas of the site while maintaining a consistent overall design.


πŸ”‘ Using Background Images Instead

Some themes prefer CSS backgrounds rather than image tags.

Example:


<div class="hero"

     style="background-image:url('');">

</div>

Benefits include:

Many professional websites use this approach.


πŸ”‘ Common Mistakes

❌ Incorrect Path


header_image: assets/images/header.jpg

Use:


header_image: /assets/images/header.jpg

instead.


❌ Wrong File Name


header_image: /assets/images/Header.jpg

is different from:


header_image: /assets/images/header.jpg

GitHub Pages is case-sensitive.


❌ Image Not Uploaded

Always verify that the image exists in the repository before publishing.


πŸ”‘ Final Thoughts

Using _config.yml for header images is one of the simplest ways to create a consistent visual identity across a GitHub Pages website. Instead of repeating image code on every page, you define the image once and let Jekyll handle the rest.

For larger projects such as PlebWare, combining global headers, section-specific headers, and page-specific overrides provides a flexible and scalable solution that remains easy to maintain as the site grows.


instead.

---

### ❌ Wrong File Name

```yaml

header_image: /assets/images/Header.jpg

is different from:


header_image: /assets/images/header.jpg

GitHub Pages is case-sensitive.


❌ Image Not Uploaded

Always verify that the image exists in the repository before publishing.


πŸ”‘ Final Thoughts

Using _config.yml for header images is one of the simplest ways to create a consistent visual identity across a GitHub Pages website. Instead of repeating image code on every page, you define the image once and let Jekyll handle the rest.

For larger projects such as PlebWare, combining global headers, section-specific headers, and page-specific overrides provides a flexible and scalable solution that remains easy to maintain as the site grows.

Example:


<div class="hero"

     style="background-image:url('');">

</div>

Benefits include:

Many professional websites use this approach.


πŸ”‘ Common Mistakes

❌ Incorrect Path


header_image: assets/images/header.jpg

Use:


header_image: /assets/images/header.jpg

instead.


❌ Wrong File Name


header_image: /assets/images/Header.jpg

is different from:


header_image: /assets/images/header.jpg

GitHub Pages is case-sensitive.


❌ Image Not Uploaded

Always verify that the image exists in the repository before publishing.


πŸ”‘ Final Thoughts

Using _config.yml for header images is one of the simplest ways to create a consistent visual identity across a GitHub Pages website. Instead of repeating image code on every page, you define the image once and let Jekyll handle the rest.

For larger projects such as PlebWare, combining global headers, section-specific headers, and page-specific overrides provides a flexible and scalable solution that remains easy to maintain as the site grows.

← Back to archive

Previous: Breaking News: The Justification of Otto Brinkmeier

Next: Adding Images to GitHub Pages