Repeated section hidden in html

#1

I have raised this with the thememaintainer but just in case it is a general hugo question.

I have a work.md on the content folder this contains:

+++
title = “Clients and Partners”
id = “work”
+++

In my layout folder: /themes/airspace-hugo/layouts/partials/work.html looks like this. (I added the second clients2 section).

{{ partial “global-header.html” . }}

{{ range .Site.Data.work.clients }}
Features
{{ end }}
{{ range .Site.Data.work.clients2 }}
Features
{{ end }}

{{ if isset .Site.Data.work “call” }}
{{ partial “call-to-action.html” .Site.Data.work.call }}
{{ end}}

The file located in /themes/airspace-hugo/data/work.yml note I manually created the clients2 section referred to in the html above.

enable: true
title: Working with you.
subtitle: These are some of the companies, institutions and communities we have worked for in the past.

clients:

Now the HTML generated shows as https://amunizp.gitlab.io/c4ad-hugo/work/ but for some reason the second section of “client-section-logo” does not show. Even though the HTML code is all there.

What have I done wrong? Do I need to create a copy of the css as well?

#2

Please follow the advice at Requesting Help and share your project’s code.

#3

I had not seen that post. Thank you for the link! But the code is on the theme of the maintainer:

With the quoted modifications above.

Or if it helps, here is my project.https://gitlab.com/amunizp/c4ad-hugo

#4

https://owlcarousel2.github.io/OwlCarousel2/docs/started-faq.html

Says:

Can i use many owls on one page?

Yes, however remember that you can use only one unique ID on single page.

Does this mean I have to work out something in the CSS or can hugo bypass this in some way?

#5

I’m afraid the limit for owls on one page in Hugo is 3, though there is an issue in the tracker about making it a config parameter.

That was a joke, I don’t know what that has to do with the issue you are having. :slight_smile:

Your content is in your theme. That is unusual. If you need to edit anything in your theme, override the theme templates in your site’s layouts directory.

For instance, you added the second client section to /themes/airspace-hugo/layouts/partials/work.html, but the site uses layouts/partials/work.html for that page, per the template lookup order.

If I were you, I’d move the stuff out of the theme into your site’s layouts, content and static. :slight_smile:

#6

Thank you!

I now understand the lookup order better! I have updated the project I think I have taken into account all your feedback.

:wink: I am ashamed to say I searched for the config issue.

I still have the issue on the hidden bit.

If I point my browser to https://amunizp.gitlab.io/c4ad-hugo/work/ and use the inspect element I see that the

is greyed out. So only one OWL-carousel is there even though the id is different.
#7

Glad it kinda worked out! I see from the source there is a second section rendered in the HTML. Awesome!

Unfortunately, I don’t load scripts from Google domains, so I bowing out of assisting with script stuff. My advice would be to ask the theme author about it. :slight_smile:

#8

Thanks for your help regardless.

I was unaware I was loading a script from google. I must have missed it in the source?

I thought it was only CSS. I’d like my page with as little JS as possible and I thought I was doing that.

#9

OK used plain CSS with a plain marquee effect. That does what I need. I am sure there is a more elegant way to do N number of sections so that I don’t have to create a new data section.

But this is the best I could do in the time I had.

Git repo and website updated. Now to find out if there is still google scripts from google as @maiki said.

1 Like
#10

Line 34 of https://amunizp.gitlab.io/c4ad-hugo/work/

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
1 Like