hanwenguo / hugo-theme-nostyleplease

a (nearly) no-CSS, fast, minimalist Hugo theme ported from riggraz/no-style-please.
MIT License
189 stars 78 forks source link

[Help] How to reference an html file WITHOUT making it go straight to content #8

Closed Janus01010 closed 1 year ago

Janus01010 commented 1 year ago

Hello,

Super newb in every way. I can easily add files into my blog content automatically, however I am trying to reference an html file on the site that is not included on the content/posts/blog list.

I tried doing:

[[entries]]

title = "Recommendations"

url = "[insert full file path here]"
But when I click the link, it puts me to a 404.

I know that it’s not impossible within the theme because I have seen other websites using the theme do it (ex. https://riggraz.dev/, notice how the link to the newsletter is its own static page without being listed on posts).

Thanks!

hanwenguo commented 1 year ago

Hey I checked your github.io repo and it appears that the format of your menu.toml is incorrect. There are a few points that I would like to bring to your attention:

  1. TOML is a format that requires strict indentation. The key-value pairs in each array of tables (i.e. the foo = bar lines under each [[entries...]]) should have the same indentation as the head of their respective tables.
  2. It is not necessary to encapsulate the links with <a> tags. Simply using the link itself will suffice.
  3. Regarding the file issue you mentioned, please try using the relative path, i.e., the path of the file relative to content/.

If what above is not clear, the following is an example:

[[entries]]
title = "About"

  [[entries.entries]]
  title = "reader, artist, wannabe-thinker"

  [[entries.entries]]
  title = "current (new) interests"

    [[entries.entries.entries]]
    title = "judaism"

    [[entries.entries.entries]]
    title = "painting"

[[entries]]
title = "Blog"

  [[entries.entries]]
  title = "link to file"
  url = "path/relative/to/content/of/file"

  [entries.post_list]
  limit = 10
  show_more = true
  show_more_text = "everything"
  show_more_url = "posts"

[[entries]]
title = "Socials"

  [[entries.entries]]
  title = "instagram"
  url = "https://www.instagram.com/jere.mee.as/"

  [[entries.entries]]
  title = "linkedin"
  url = "https://www.linkedin.com/in/jeremias-sur-5a6b321b8/"

  [[entries.entries]]
  title = "github (old blog)"
  url = "https://github.com/Janus01010"