okkur / syna

Highly customizable open source theme for Hugo based static websites
https://syna.okkur.org/demo/
Apache License 2.0
250 stars 133 forks source link

Contents of all pages is displayed on main page #824

Closed symlevelbamboo2 closed 3 years ago

symlevelbamboo2 commented 3 years ago

Is this a BUG REPORT or FEATURE REQUEST?: bug

What happened: I've tried add new page in the contents folder of the syna-start example as described in the documentation. But hugo does not create page in the output but displays its contents on the main page. Maybe I'm doing something wrong?

How to reproduce it (as minimally and precisely as possible):

  1. Clone the syna-start example: git clone --recurse-submodules https://git.okkur.org/syna-start
  2. cd to the syna-start directory
  3. Create content/my-page directory
  4. Create content/my-page/index.md file with the following contents:
    +++
    title = "My Page"
    date = "2020-08-30"
    +++
  5. Create content/my-page/content.md file with the following contents:
    
    +++
    fragment = "content"
    date = "2020-08-30"
    +++

This is my page


6. Start hugo server

After I open localhost:1313 in my browser, I see contents of the my-page ("This is my page" text) on the main page at the top before the navigation bar. If I try open localhost:1313/my-page then I get the "404 page not found" error.

Note: The same happens with about page. I see all contents of the about page on the main page, and if click "About Us" in the main menu then I get the "404 page not found" error.

**Environment**:
- Syna Theme version:  0.17.3
- Hugo version:  v0.74.3-DA0437B4/extended linux/amd64 BuildDate: 2020-07-23T16:30:30Z
stp-ip commented 3 years ago

This seems like a bug. Rename content/index.md to content/_index.md, that should resolve the issues. Happy for a PR, if you want to fix this in the main repo as well before we have are able to get to this.

aesilevich commented 3 years ago

Renaming content/index.md to content/_index.md solved all issues. Thank you! I've created PR #41 in the syna-start repo.