lukeorth / poison

Professional Hugo theme for dev bloggers. Based on Mdo's classic Hyde theme.
https://poison.lukeorth.com
GNU General Public License v3.0
209 stars 101 forks source link

About page not showing up in the sidebar when using about/_index.md or about/about.md #147

Closed wasserman closed 11 months ago

wasserman commented 11 months ago

I'm using Hugo on Ubuntu via snap and I can't get the About page to show up on the left bar despite including it in the menu (using your exact sample config) and creating a page through two different attempts, both with and without layout: single.

hugo new content about/_index.md
hugo new content about/about.md

I even cloned your demo site to see if that worked but got shortcode not found errors, but even by just looking at your configs I couldn't sort out what I was doing wrong with my attempt for my own site.

hugo v0.119.0-b84644c008e0dc2c4b67bd69cccf87a41a03937e+extended linux/amd64 BuildDate=2023-09-24T15:20:17Z VendorInfo=snap:0.119.0

Built in 2 ms
Error: error building site: assemble: "/my/local/path/to/hugo/stuff/poison-demo-site/content/posts/introducing-poison.md:88:1": failed to extract shortcode: template for shortcode "tabs" not found

Is this something 119 compatibility or do you have any idea what I am doing wrong?

Thanks!

lukeorth commented 11 months ago

Hi @wasserman - I'm sorry to hear you're experiencing issues.

I tried replicating the issue by:

  1. Updating Hugo to the same version (v0.119.0)
  2. Creating a new site with hugo new site <site_name>
  3. Cloning the Poison theme into /themes
  4. Copying the example Poison config file into hugo.toml
  5. Creating a new post with hugo new content posts/my-first-post.md and setting draft = false
  6. Creating an about page with hugo new content about/about.md and setting draft = false
  7. Running the server with hugo server

That said, everything built and ran fine for me. Would it be possible to upload your project to GitHub so I can clone the repository and take a closer look? That might help me troubleshoot a bit better. :)

tehpola commented 11 months ago

I'm experiencing this issue as well. Things worked well for me when I was using the content/about/about.html location. However, when I wanted to add images to the page bundle, I settled on content/about/index.md. Though another similar, stand-alone (non-post) page worked, I couldn't get About to show up.

I wound up adding a hack to menu.html if eq (lower $menu_item.Name) "about" because I couldn't figure out what was special about the About page.

lukeorth commented 11 months ago

Thank you for helping to report this, @tehpola. It gives me more data to work with.

As you noted, the "About" page is a little different. This is because I've created a custom layout for it (i.e. pages contained in the /content/about/.. directory). Unlike other single pages, the "About" page does not display the authorship date, comments, or a table of contents. The code for it can be found here.

With your help, I did find an issue in the custom layout that I've fixed. So it should work for "About" pages located in either of these locations:

  1. /content/about/about.md
  2. /content/about/_index.md

Note: It will not work if the page is located at: /content/about/index.md

I also created this bare bones repo to help with troubleshooting. Once you clone it, you'll need to also clone the Poison theme into /themes, then just run hugo server --disableFastRender.

Hopefully that helps! Please let me know if you experience any issues and we can troubleshoot further.

wasserman commented 11 months ago

Thanks @lukeorth. I've been out of town on a different device, but I do plan to test this out when I return tomorrow to validate my configuration and validate your update.

wasserman commented 11 months ago

@lukeorth I was able to confirm that everything is working after testing with your bare bones repo and then applying the same config to my working copy of my blog.

FYI - My Hugo copy is using the default of toml for the front matter. The layout mode isn't valid and it fails to compile.

+++
title = 'About'
date = 2023-10-27T05:24:41-05:00
draft = false
layout = single
+++

About me.                                                                                                                                                                        

The error is as follows:

Error: error building site: assemble: "/path/to/my/hugo/stuff/poison_issue_147/content/about/about.md:5:10": unmarshal failed: toml: incomplete number

I am new to Hugo so I don't know where Hugo ends and Poison begins. Your repo is using yaml for the front matter and I'm happy to move to that format. I just build pages using hugo new content ... so I believe I just need to update my archetype config, but I wanted you to be aware in case this is something that was missed and easy to fix for the next new user.

Thank you for taking the time to look into this. I'm looking forward to building a blog with Hugo and Poison.

georgek commented 11 months ago

In TOML it needs to be layout = "single" as it doesn't support "bare" strings like YAML.

pjones commented 9 months ago

@lukeorth Is there a particular reason this doesn't work when using /content/about/index.md?

I'm new to Hugo and trying to wrap my head around sections. It seems to me that using index.md should work from Hugo's perspective. What am I missing?

Amiyah14 commented 2 months ago

With your help, I did find an issue in the custom layout that I've fixed. So it should work for "About" pages located in either of these locations:

1. `/content/about/about.md`

2. `/content/about/_index.md`

Just letting you know that 1. is not working. Only 2. works