Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant edit landing page #143

Open
2 tasks done
0xprune opened this issue Dec 9, 2023 · 14 comments · May be fixed by #148
Open
2 tasks done

Cant edit landing page #143

0xprune opened this issue Dec 9, 2023 · 14 comments · May be fixed by #148
Assignees
Labels
bug Something isn't working
Milestone

Comments

@0xprune
Copy link

0xprune commented Dec 9, 2023

Past Issues Searched

  • I have searched open and closed issues to make sure that the bug has not yet been reported

Issue is a Bug Report

  • This is a bug report and not a feature request, nor asking for support

Describe the bug

I already edit landing.yml on data but its nothing change, i have problem on feature grid and image compare section. I also tried to change enable to false but its still showing them, thank you

Expected behavior

Fix so i can edit landing page and its not being templated again

Screenshots

Screenshot_11
Screenshot_12

Environment

- OS: Windows
- Browser: Chrome
- Browser Version: 119
@colinwilson
Copy link
Owner

Have you tried deleting the theme's landing.yaml file?

@colinwilson colinwilson self-assigned this Dec 11, 2023
@rusinikita
Copy link

rusinikita commented Dec 18, 2023

I added theme as a module. So I can't delete theme data file. It seems like it combines theme data and my project data.

Hero and "what can i do" sections is mine, but other is sample. It happened when I had updated theme to last commit version.

Workaround: Disabling keys from sample helps.

featureGrid:
  enable: false
imageCompare:
  enable: false
Screenshot 2023-12-18 at 20 28 13

@rusinikita
Copy link

Only one problem. ctaButton button always leads to root. No matter ctaButton.url setting. So I was forced to use cta2Button

https://github.com/rusinikita/changes/pull/6/files

@colinwilson
Copy link
Owner

I added theme as a module. So I can't delete theme data file. It seems like it combines theme data and my project data.

Ah ha. Yes this is a problem. I'll look at resolving this very soon (next update).

@colinwilson colinwilson added the bug Something isn't working label Dec 18, 2023
@colinwilson colinwilson added this to the v0.2.0 milestone Dec 18, 2023
@indrora
Copy link

indrora commented Dec 21, 2023

The workaround doesn't work, by the way. It crashes out saying that a partial failed:

image

This sucks.

Followup: https://gohugo.io/templates/data-templates/ -- There's a note about this specifically:

Therefore, theme authors should be careful not to include data files that could be easily overwritten by a user who decides to customize a theme. For theme-specific data items that shouldn’t be overridden, it can be wise to prefix the folder structure with a namespace.

@rusinikita
Copy link

I guess, there is something inside your configuration. Can you provide file.

@indrora
Copy link

indrora commented Dec 23, 2023

Here's the most minimal repro:

hero:
  enable: false

featureGrid:
  enable: false

The full error I get:

ERROR Rebuild failed: render: failed to render pages: render of "home" failed: "/Users/indrora/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/colinwilson/lotusdocs@v0.1.0/layouts/index.html:19:11": execute of template failed at <partialCached $path ($indexContext.Get "indexContext")>: error calling partialCached: partial "landing/featureGrid.html" not found

This tells me that it's making a guess as to what template, but moreover not checking if the section has enable set to true.

But wait, the plot thickens!

The following raises a New and Interesting error:

hero: 
  enable: false

mycoolsection:
  enable: false
  template: asdf

this causes a NEW bug to show up:

ERROR Rebuild failed: render: failed to render pages: render of "home" failed: "/Users/indrora/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/colinwilson/lotusdocs@v0.1.0/layouts/index.html:19:11": execute of template failed at <partialCached $path ($indexContext.Get "indexContext")>: error calling partialCached: partial "landing/mycoolsection.html" not found

There's actually multiple bugs here:

  • The template provides data that is being used, and instead should supply at most some filler data that gets set aside if there is a site-specific dataset
  • The template does not check to see if the enable field is set
  • The template is derived from the key rather than from the template field

Edit: it appears I was on an older version. Once I forced Hugo to use the release branch, it worked.

@indrora indrora linked a pull request Dec 26, 2023 that will close this issue
4 tasks
@aMytho
Copy link

aMytho commented Jan 8, 2024

What version or git commit did you use to get the workaround functional? I'm on version v0.121.1-00b46fed8e47f7bb0a85d7cfc2d9f1356379b740+extended and I get the same error you showed when I disable the feature grid and image compare sections.

@rusinikita
Copy link

@aMytho
Copy link

aMytho commented Jan 9, 2024

That worked for me, thank you!

@aMytho Here is my version that works

https://github.com/rusinikita/changes/blob/main/docs/go.mod https://rusinikita.github.io/changes/

@chapimenge3
Copy link

I think this problem happens only when you use lotus docs as a submodule? I faced the same problem today my configuration is like the below

hero:
    ....
    badge:
    text: custom text
    color: primary # primary, secondary, success, danger, warning, info, light, dark
    pill: false # boolean
    soft: true # boolean

featureGrid:
  enable: true
  weight: 20
  template: feature grid

  title: This is updated.
  subtitle: Lotus Docs is a highly configurable Hugo documentation theme. 

Hero page was working fine it override it, but feature grid just won't work.

but what I used this repo as a template, and everything started working.

@ManuelLevi
Copy link

ManuelLevi commented Feb 21, 2024

I'm facing the same issue.

I've installed this as a Hugo Module following the instructions here.

When I add my data/landing.yaml I can edit Hero and it works, everything else doesn't.

I've tried the workaround but also didn't work. I can provide more information on my context, if you tell me what you need :)

@chapimenge3
Copy link

Use the template from the repo of the docs itself @ManuelLevi

@ManuelLevi
Copy link

ManuelLevi commented Feb 22, 2024

Thanks @chapimenge3

I've copied the contents of these files (one at a time):

  • /data/landing.yaml
  • /exampleSite/data/landing.yaml

to my /data/landing.yaml.

Neither of them worked. I can change the Hero, but nothing else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants