I'm using Hugo as a content generator. Hugo allow for audio and videos front matter fields for populating the corresponding opengraph values (see Configure Open Graph).
According to Hugo documentation:
audio and videos are URL arrays like images for the audio and video metadata tags, respectively.
The audio and videos fields definition should be:
// an array of paths to audio files related to the page;
// used by the opengraph internal template to populate og:audio.
{
"title": "Audio",
"name": "audio",
"type": "file",
"multiple": true
},
// an array of paths to videos files related to the page;
// used by the opengraph internal template to populate og:video.
{
"title": "Videos",
"name": "v ideos",
"type": "file",
"multiple": true
}
with the file type working like the image type for any file type.
Additionally, a mime type or file extension filter for selected files should be possible:
I'm using Hugo as a content generator. Hugo allow for `audio` and `videos` front matter fields for populating the corresponding opengraph values (see [Configure Open Graph](https://gohugo.io/templates/internal#configure-open-graph)).
According to Hugo documentation:
> audio and videos are URL arrays like images for the audio and video metadata tags, respectively.
The `audio` and `videos` fields definition should be:
```
// an array of paths to audio files related to the page;
// used by the opengraph internal template to populate og:audio.
{
"title": "Audio",
"name": "audio",
"type": "file",
"multiple": true
},
// an array of paths to videos files related to the page;
// used by the opengraph internal template to populate og:video.
{
"title": "Videos",
"name": "v ideos",
"type": "file",
"multiple": true
}
```
with the file type working like the image type for any file type.
Additionally, a mime type or file extension filter for selected files should be possible:
```
{
"title": "Audio",
"name": "audio",
"type": "file",
"multiple": true,
allowed-mime-type: [ "audio/*", "audio/mp3" ],
allowed-extensions: [ "mp3", "m4a", "wav", "flac" ],
},
```
<!-- github-sync-id:1190907644 -->
The new field type will be available for testing in the latest beta version.
The first implementation of the new `File` field is completed.
Sample field configuration:
```json
{
"title": "Attachments",
"name": "attachments",
"type": "file",
"multiple": true,
"fileExtensions": ["pdf", "mp4", "wav"]
}
```
**Empty field**

**Single value**

**Multiple files - single selection**

**Multiple files**

The new field type will be available for testing in the latest beta version.
<!-- github-comment-id:1103686746 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I'm using Hugo as a content generator. Hugo allow for
audioandvideosfront matter fields for populating the corresponding opengraph values (see Configure Open Graph).According to Hugo documentation:
The
audioandvideosfields definition should be:with the file type working like the image type for any file type.
Additionally, a mime type or file extension filter for selected files should be possible:
Thank you @landure for the suggestion! It would definitely make sense to get this enhancement.
The first implementation of the new
Filefield is completed.Sample field configuration:
Empty field
Single value
Multiple files - single selection
Multiple files
The new field type will be available for testing in the latest beta version.