Drone

Drone - Hugo Plugin Question

Hi,
I’ve upgraded recently to a new version of hugo and migrated from the cbrgm/drone-hugo to the plugins/hugo plugin.

I’m having an issue where the _index.md file is not rendering any markdown in the /content directory. There are other _index.md files successfully being rendered in other directories below the /content directory - e.g. content/welcome/_index.md does render everything correctly.

The issue seems to be specific to files in the /content root directory.

On my local desktop testing it works fine under 0.59.1 but the plugins/hugo plug-in is running 0.58.3. I’m having an issue recreating the issue locally on my desktop - since it seems 0.58.3 isn’t available to install via brew.

Any help/suggestions much appreciated.
Thanks!

I have faced similar issues due to hugo making some breaking changes. Your best option is to configure the plugin to use the same hugo version that you use locally:

kind: pipeline
name: default

steps:
- name: build
  image: plugins/hugo
  settings:
    hugo_version: 0.59.1
    validate: true

Thanks for the reply @bradrydzewski

Right that was a good idea. I had tried to set the version explicitly to 0.59.1 but still get the content rendered with 0.58.3 for some reason. This is from the rendered page.

 <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <meta name="generator" content="Hugo 0.58.3" /> . <--- 
     <meta name="description" content="">

So not sure why this is happening - my drone has the following:

  build:
    image: plugins/hugo
    settings:
      hugo_version: 0.59.1
      pull: always
      config: ./config.toml
      validate: true
      buildDrafts: true

your yaml is a mix of 0.8 and 1.x which likely causing the problem. I have provided samples of valid 0.8 and 1.x configuration below, however, please note that 0.8 is end of life. We recommend using the latest stable version of Drone (1.6.4 at the time of writing this comment) and the 1.x yaml format.

here is a valid 0.8 yaml

pipeline:
  build:
    image: plugins/hugo
    hugo_version: 0.59.1

here is a valid 1.0 yaml:

kind: pipeline
name: default

steps:
  - name: build
    image: plugins/hugo
    settings:
      hugo_version: 0.59.1

@bradrydzewski thanks much! I made that change you suggested for 0.8 and it did render with hugo 0.59.1 (hopefully our team upgrades to 1.x soon).

Unfortunately I didn’t get my _index.md rendering in the root content directory however so there must be some other reason for that not rendering for just that one _index.md in the root content directory but doesn’t seem to be related to the hugo version so will keep working on trying to figure that out.