-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for yaml lists #12
Comments
Nevermind, I figured it out: content:
- name: posts
label: Posts
type: collection
path: content/posts
fields:
- {name: draft, label: Draft, type: boolean, default: true}
- {name: title, label: Title, type: string}
- {name: date, label: Date, type: date}
- name: resources
label: Resources
type: object
----> list: true
fields:
- name: name
type: string
hidden: true
default: featured-image
- name: src
label: Featured Image
type: image
filename: index.md
view:
fields: [title, draft, date] |
Sorry, I was slow to respond. Glad you got that sorted out. |
No problem, I figured there had to be some way I just wasn't seeing it and I imagine you're swamped. Now, if could figure out how to get pages to output resources:
- name: featured-image
src: featured-image.jpg instead of resources:
- name: featured-image
src: /content/posts/2024-02-24-green-eggs/featured-image.jpg I'd really be in business! With various ways of configuring media and images, it's not super clear how their setting all interact. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How would I configure this frontmatter in pages? It seems like there needs
to be an array object in the schema besides select. There isn't anything in the configuration help for yaml lists unless I'm missing something.
I tried...
...which outputs something like...
... when I select an image in the UI an save.
I also tried...
...which outputs something like...
This would better support resources metadata in Hugo. I highly suggest reading the spec to get a better sense of the capabilities beyond specifying one metadata entry. In this simple use-case, Hugo uses this frontmatter to insert the feature image into the post. If there is an additional
feature-image-preview
entry, then that will be displayed on the posts page as a small preview image above the link to the post.I also use page bundles with Hugo, which is why filenames of my posts are index.md, similar to #10 which works fine (but there is no limit to how many entries you can make which is what the issue is about). The parent directory of index.md I like to name
{year}-{month}-{day}-{primary}
for example, but could be named anything.Thanks for the great tool!
The text was updated successfully, but these errors were encountered: