Content adapters: path and content

  1. Does changing .Summary to .Content matter? Or what’s the difference here? (Data is remote)
  2. Some edits have been made to Content adapters | Hugo, but one example few days ago showed a path with a .md extension. Is the extension necessary? (URLs ended up with the extension).

I’m not aware of that, and I wrote it.

I don’t understand the question.

Do not include an extension.

{{ .AddPage (dict "title" "foo" "path" "foo.md") }}

Published with v0.126.0:

public/
├── foo/
│   └── index.html
└── index.html

Published with v0.126.1:

public/
├── foo.md/
│   └── index.html
└── index.html

The difference is due to https://github.com/gohugoio/hugo/pull/12498 that addressed https://github.com/gohugoio/hugo/issues/12493.

Ignore that! I just saw I copied the path with the extension from the previous implementation (by Regis) while converting…

Like what’s the .Summary for? Does the remote content only show as summary here?

  {{ $content := dict "mediaType" "text/markdown" "value" .summary }}

.summary (lower case) is just a key in the remote data file. It has nothing to do with the .Summary method that you would use in layouts/_default/list.html or similar.

Interesting…my content does not have that value. So, I assume I can remove the "value" .summary part? (My content relies purely on the .Params)

Per the documentation for the map you pass to .AddPage, the only required entry is path, though I would always add title as well.

I’ve updated the description (do not include file extension) of the path value passed into .AddPage:

The page’s logical path relative to the content adapter. Do not include a leading slash or file extension.

1 Like

thanks. I will experiment more and see…

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.