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

_index.en.adoc is not getting recognized at the homepage level: /content #4166

Closed
pgorod opened this issue Dec 15, 2017 · 6 comments
Closed

Comments

@pgorod
Copy link

pgorod commented Dec 15, 2017

When I changed my homepage file from content/_index.en.md to .adoc extension, I started seeing a message on my homepage instructing me on how to start building my site. I investigated, and it’s my theme’s welcome message, because it’s testing content like this:

{{if .Site.Home.Content }} 
{{.Site.Home.Content}}	
{{else}} 
       <h1>Customize your own home page</h1>
       (etc...)

It seems it's a bug, _index.en.md is correctly recognized as Home page content, but _index.en.adoc isn’t.

This change from .md to .adoc worked perfectly in the rest of my site, through all the different sub-directories.

@pgorod pgorod changed the title _index.en.adoc is not getting recongized at the homepage level: /content _index.en.adoc is not getting recognized at the homepage level: /content Dec 15, 2017
@bep bep added the Bug label Dec 15, 2017
@bep bep modified the milestones: v0.32, v0.33 Dec 15, 2017
@bep bep modified the milestones: v0.32, v0.33 Dec 29, 2017
@bep
Copy link
Member

bep commented Dec 29, 2017

I have now added tests for this, but this works as I expected. Could you have another look at this and see if it still is a problem?

@pgorod
Copy link
Author

pgorod commented Dec 29, 2017

Hi. Thanks for working on this.

I tried changes to the .adoc file and in fact I can get a _index.en.adoc Homepage displayed correctly with this content:

---
title: "SuiteCRM Documentation"
---

= Welcome to the SuiteCRM Documentation site

Hi, are you there?

So I changed things back to how they were and I lost my Homepage again, with this content:

---
title: "SuiteCRM Documentation"
---

= Welcome to the SuiteCRM Documentation site

Now, I know my Theme does tricks with the main title (level =) - it removes it from content and shows it with a special treatment on top. So I tested to see if that was the culprit, and it was.

So this works well:

---
title: "SuiteCRM Documentation"
---

== Welcome to the SuiteCRM Documentation site

The theme doesn't play with this level of title, so the page appears correctly.

As far as Hugo is concerned. it seems the problem is empty content. Do you think this is anything that needs to be improved in Hugo, or simply something the theme needs to improve?

@bep
Copy link
Member

bep commented Dec 29, 2017

Do you think this is anything that needs to be improved in Hugo, or simply something the theme needs to improve?

OK, now I understand. No, that is not something we want to do. You can always add a len check to the content check to check that it has some length to it.

@bep bep closed this as completed Dec 29, 2017
@bep
Copy link
Member

bep commented Dec 29, 2017

Also, there is .RawContent that you could check.

@pgorod
Copy link
Author

pgorod commented Dec 29, 2017

I am not proficient enough in these things to work on it myself, yet but I'll take it up with my Theme author to see if he thinks he can improve handling of this situation. Thank you for your help and advice.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants