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
Settings for HTML files #15
Comments
Yes you can in the latest version. If you omit the fields property, it will show the name of the file in the collection view.: content:
- name: shortcodes
label: Shortcodes
type: collection
path: layouts/shortcodes
filename: shortcode-{year}-{month}-{day}-{hour}-{minute}-{second}.html
subfolders: false This should work now for you. You'll notice I provided a custom filename, that is because right now y ou can rename the file once it's created, but you can't customize the filename on creation. I intend to adjust this moving forward, allowing users to change the filename when editing/creating, I'm just not 100% sure about the UX yet. Maybe allow to expose the filename in a field. Let me know if it's working for you now. |
It works! I understand the issue about customising the filename on creation/editing. Would like to report a tiny feature request about that – Currently when I create a new file it gets named using the Also, sharing my complete config for any future passerby – media:
input: static
output: /
content:
- name: pages
label: Pages
type: collection
path: 'content'
subfolders: false
view:
fields: [ title, date ]
fields:
- name: title
label: Title
type: string
required: true
- name: date
label: Date
type: date
required: true
options:
time: true
format: DD-MM-YYYY HH:mm:ss Z
- name: lastmod
label: Last Modified
type: date
required: true
options:
time: true
format: DD-MM-YYYY HH:mm:ss Z
- name: layout
label: Layout
type: select
required: true
options:
values:
- value: page
label: Page
- name: author
label: Author
type: string
- name: hiddenFromHomePage
label: Hidden from Home Page
type: boolean
default: true
- name: description
label: Description
type: string
- name: keywords
label: Keywords
type: string
- name: categories
label: Categories
type: string
- name: tags
label: Tags
type: string
- name: body
label: Body
type: rich-text
- name: posts
label: Posts
path: 'content/posts'
subfolders: false
type: collection
view:
fields: [ title, draft, date ]
primary: title
fields:
- name: title
label: Title
type: string
required: true
- name: date
label: Date
type: date
required: true
options:
time: true
format: DD-MM-YYYY HH:mm:ss Z
- name: lastmod
label: Last Modified
type: date
required: true
options:
time: true
format: DD-MM-YYYY HH:mm:ss Z
- name: layout
label: Layout
type: select
required: true
options:
values:
- value: single
label: Single
- value: newsletter
label: Newsletter
- name: draft
label: Draft
type: boolean
default: true
required: true
- name: author
label: Author
type: string
- name: description
label: Description
type: string
- name: keywords
label: Keywords
type: string
- name: categories
label: Categories
type: string
- name: tags
label: Tags
type: string
- name: body
label: Body
type: rich-text
- name: newsletter
label: Newsletter
path: 'content/newsletter'
type: collection
view:
fields: [ title, date ]
primary: title
fields:
- name: title
label: Title
type: string
required: true
- name: date
label: Date
type: date
required: true
options:
time: true
format: DD-MM-YYYY HH:mm:ss Z
- name: lastmod
label: Last Modified
type: date
required: true
options:
time: true
format: DD-MM-YYYY HH:mm:ss Z
- name: draft
label: Draft
type: boolean
default: true
required: true
- name: layout
label: Layout
type: select
options:
values:
- value: newsletter
label: Newsletter
required: true
- name: author
label: Author
type: string
- name: description
label: Description
type: string
- name: keywords
label: Keywords
type: string
- name: categories
label: Categories
type: select
options:
values:
- value: newsletter
label: Newsletter
- name: tags
label: Tags
type: string
- name: body
label: Body
type: rich-text
- name: shortcodes
label: Shortcodes
type: collection
path: 'layouts/shortcodes'
filename: shortcode-{year}-{month}-{day}-{hour}-{minute}-{second}.html
subfolders: false |
First: Great work here! I have tried several CMS for Jekyll/Hugo and this one comes the closest to winning for me. So I really want to make it work for me as well!
I have a Hugo blog with posts and pages that I have been able to set up.
I was hoping I would also be able to add my
shortcodes
directory to the CMS. I tried the following –And it shows me this screen –
Clicking on an entry, shows me the
code
block as intended –I am wondering if it is possible to edit/create files that do not have a YAML frontmatter? As is the case with my shortcodes here, I would like –
Is that possible? Will it be possible in a later version?
Related Issue: #13
The text was updated successfully, but these errors were encountered: