Beginner Question: How do I replace the Gargoyles

I don’t see where the image of the Gargoyle is being called. If I simply want to replace that, how do I do it?

Which theme are you using? What Gargoyles?

Following this tutorial the top image is a Gargoyle above Paris. I’d like to replace that image. That would be a nice intro to styling.

You are using Anake theme. The Gargoyle image is in themes\gohugo-theme-ananke\static\images.

You can also use the theme instructions on changing the background here:

In short, remove featured_image from your config file.

I appreciate your help! Could you be more specific? For instance, if I had an image called hugo-noob.jpg, where would I put it and how would I get it into that slot?

Okay, here is a start, I created /content/_index.md and added

---
featured_image: 'images/ls.jpg'
---
Hi, I'm content.  Are you?

This makes the Gargoyles disappear faster than a priest with a crossbow, but it did NOT bring in my image ls.jpg under /images/ls.jpg That directory is right under the root, not sure if that is correct.

GOT IT! I appreciate the tips. My above was almost there. First, you need to put the images under /static/images/ls.jpg and then refer to them via

---
featured_image: '/images/ls.jpg'
---
Hi, I'm content.  Are you?

The /static folder in your project, merges in to / in your site, so /static/css for instance would be https://mysite.com/css.

1 Like

Should my index go in /content/_index.md or in /static/index.html then?

Hugo generates index.html and other pages from templates and content files in your project, when you run the hugo command. The static folder is for things like your shared images, css files, javascript files, or maybe things like downloadable PDFs etc.

I find that even when I don’t define the featured_image, its there on the front page.
How would I go about removing it from there?

The code in site-header.html (https://github.com/budparr/gohugo-theme-ananke/blob/7b5196ad18b65ead0ec3157d28aaf3a0b02b0a30/layouts/partials/site-header.html) has:
{{ $featured_image := .Param "featured_image" | default "images/gohugo-default-sample-hero-image.jpg" }}
{{ if $featured_image }}
header with image code
{{ else }}
header without image code

If I’m understanding this code correctly, featured_image will always be defined, because of the default… or am I missing something about how this works? It’s referenced in the Quick Start and ananke docs, but doesn’t explicitly say how to not have the image.

1 Like

@dangelovich - A default image is being set for $featured_image by this part:

| default "images/gohugo-default-sample-hero-image.jpg"

Try removing that part if you are happy modifying the theme.
Or, if you want to preserve the theme, create your own corresponding partial in your layouts folder and copy the code and then remove the part in your copy - or even set your own default featured image.

1 Like