Hugo does not publish anything

,

I’ve created a new repository with this .gitlab-ci.yml:

image: registry.gitlab.com/pages/hugo:latest

variables:
  GIT_SUBMODULE_STRATEGY: recursive

pages:
  script:
  - hugo
  artifacts:
    paths:
    - public
  only:
  - main 

I’ve seen the pipelines works, you can download the artifacts from here: https://gitlab.com/sincorchetes/echemosunbitstazo-blog/-/jobs/1952532839/artifacts/download

However, if you go to the project, you won’t see anything published:

No pages, no branches…

Any help?

Thanks

Hi @sincorchetes

If you go to Settings → Visibility, project features, permissions in your project, do you have Pages enabled? Also, if you go to Settings → Pages what do you see?

I notice that in your artifact, you are generating a file called public/index.xml, were you intending to generate index.html?

Hi!

I have Pages active and accessible for everyone.
I was updated the .gitlab-ci.yml:

# All available Hugo versions are listed here: https://gitlab.com/pages/hugo/container_registry
image: registry.gitlab.com/pages/hugo/hugo_extended

variables:
  GIT_SUBMODULE_STRATEGY: recursive

test:
  script:
  - hugo
  rules:
    - if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH

pages:
  script:
  - hugo
  artifacts:
    paths:
    - public
  rules:
    - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH

I’ve created a themes folder, content and I installed a theme.

This is the config.toml

baseURL = 'https://sincorchetes.gitlab.io/echemosunbitstazo-blog/'
languageCode = 'en-us'
title = 'My New Hugo Site'
theme = "m10c"
[[menu.main]]
  identifier = "tags"
  name = "Tags"
  url = "/tags/"

[[params.social]]
  icon = "github"
  name = "My Github"
  url = "https://github.com/vaga"

[params.style]
  darkestColor = "#d35050"
  darkColor = "#212121"
  lightColor = "#f5e3e0"
  lightestColor = "#f5f5f5"
  primaryColor = "#ffffff"

That’s solved! :smiley:

Glad you fixed it! Just to be clear (for future readers of this thread), the problem was with the Hugo config?

1 Like

Yes! @snim2

1 Like

Hi!
this is my error…

`ERROR 2022/07/09 07:12:50 render of "page" failed: "/builds/rdfleay/rdfleay.gitlab.io/themes/beautifulhugo/layouts/_default/baseof.html:3:5": execute of template failed: template: _default/single.html:3:5: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/builds/rdfleay/rdfleay.gitlab.io/themes/beautifulhugo/layouts/partials/head.html:33:38": execute of template failed: template: partials/head.html:33:38: executing "partials/head.html" at <.URL>: can't evaluate field URL in type *hugolib.pageState`

i edited my yml

image: registry.gitlab.com/pages/hugo/hugo_extended

i have installed ‘go’ and ’ hugo’… cloned ‘ananke’ into dir’s… etc etc…
please help, i just want to get the hugo website running from my gitalb as ALL the posts say its so EASY TO DO…
thanks

Hi @rdfleay I’m not sure, but that looks like an issue with Hugo. Can you build the site locally?

Hi @snim2 ! T4reply!! Yes, hugo actually does its job… it build, downloads new themes, connects to submodules etc… Building ‘out of the box’ on gitlab, keeping website domain and git project label the same (config & git-proj settings) it builds!
But when trying to change themes, i tried ananke, and then tranquil peak, the code fails AND if you simply change the required bits back to ‘beautifulhugo’ (out of the box theme) i had to change the yaml from latest release to 0.92 (from memory) and it built… but then it failed when changing theme again… and cannot get it back…
Its sad because i want to connect my git work to my website, with a nice theme, AND to also simply have it work …just like ALL the people write that its so easy … very frustrating!
I have downloaded and built a hundred times now… i get how easy it should be…
I have git projects, i can start new hugo page, i can enter my local computer dir and clone my hugo-proj and pull-push for version control… just would like a nice theme to build AND continue to work.
Possible to get some direct help /assessment on my git?
Thanks!!!