.md configuring single page

Hello!

I have been configuring a single-page website, mostly been working inside the .toml file and slowly starting to understand the .toml > .html architecture.

So as a naive and a very enthusiastic coder, I start creating a single page only to find my hopes of editing that the same way as the .toml file being let down.

So the connoisseurs of the Hugo language, I propose my here my problems.

In the .toml file I am able to use parameters like these :

    # Metadata
    [params]
      author = "Cool Name"

And in .html its translated like this:

{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}

Very understandable.

BUT now as for a single page .md file, I cannot in any way seem to replicate this.

You can still do that, with page level params, placed in your one .md file’s frontmatter:

The “body” of the markdown file, under the frontmatter, is accessible via {{ .Content }} in your template (your index).

1 Like