diff --git a/.all-contributorsrc b/.all-contributorsrc index b69c1ccbf273..400ded52d89f 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -833,6 +833,15 @@ "contributions": [ "doc" ] + }, + { + "login": "terrierscript", + "name": "terrierscript", + "avatar_url": "https://avatars2.githubusercontent.com/u/13282103?v=4", + "profile": "https://terrierscript.com", + "contributions": [ + "code" + ] } ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c4234d0c68f..249f673b1d0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Fix broken new media uploads for Git Gateway ([@tech4him1](https://github.com/tech4him1) in [#1221](https://github.com/netlify/netlify-cms/pull/1221)) * Enable editorial workflow for test backend ([@erquhart](https://github.com/erquhart) in [#1225](https://github.com/netlify/netlify-cms/pull/1225)) + * Add hour, minute, and second slug fields ([@terrierscript](https://github.com/terrierscript) in [#1207](https://github.com/netlify/netlify-cms/pull/1207)) diff --git a/README.md b/README.md index 37d825474536..f0be610548c6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Netlify CMS -[![All Contributors](https://img.shields.io/badge/all_contributors-96-orange.svg)](#contributors) +[![All Contributors](https://img.shields.io/badge/all_contributors-97-orange.svg)](#contributors) [![Open Source Helpers](https://www.codetriage.com/netlify/netlify-cms/badges/users.svg)](https://www.codetriage.com/netlify/netlify-cms) [![](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/netlify/netlifycms) @@ -63,7 +63,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds | [
Edward Betts](http://edwardbetts.com/)
[πŸ“–](https://github.com/netlify/netlify-cms/commits?author=EdwardBetts "Documentation") | [
Josh Hardman](https://github.com/jhardman0830)
[πŸ“–](https://github.com/netlify/netlify-cms/commits?author=jhardman0830 "Documentation") | [
Mantas](https://behance.net/mistermantas)
[πŸ“–](https://github.com/netlify/netlify-cms/commits?author=mistermantas "Documentation") | [
Marco Biedermann](https://www.marcobiedermann.com)
[πŸ“–](https://github.com/netlify/netlify-cms/commits?author=marcobiedermann "Documentation") | [
Max Stoiber](https://mxstbr.blog/newsletter)
[πŸ“–](https://github.com/netlify/netlify-cms/commits?author=mxstbr "Documentation") | [
Vyacheslav Matyukhin](http://berekuk.ru)
[πŸ“–](https://github.com/netlify/netlify-cms/commits?author=berekuk "Documentation") | [
jimmaaay](https://jimmythompson.me)
[πŸ’»](https://github.com/netlify/netlify-cms/commits?author=jimmaaay "Code") | | [
LuΓ­s Miguel](https://github.com/Quicksaver)
[πŸ›](https://github.com/netlify/netlify-cms/issues?q=author%3AQuicksaver "Bug reports") [πŸ’»](https://github.com/netlify/netlify-cms/commits?author=Quicksaver "Code") | [
Chris Swithinbank](http://chrisswithinbank.net/)
[πŸ“–](https://github.com/netlify/netlify-cms/commits?author=delucis "Documentation") | [
remmah](https://github.com/remmah)
[πŸ“–](https://github.com/netlify/netlify-cms/commits?author=remmah "Documentation") | [
Sumeet Jain](http://sumeetjain.com)
[πŸ“–](https://github.com/netlify/netlify-cms/commits?author=sumeetjain "Documentation") | [
Sagar Khatri](https://github.com/ragasirtahk)
[πŸ“–](https://github.com/netlify/netlify-cms/commits?author=ragasirtahk "Documentation") [πŸ’‘](#example-ragasirtahk "Examples") | [
Kevin Doocey](https://www.dooceykev.in)
[πŸ’»](https://github.com/netlify/netlify-cms/commits?author=Doocey "Code") | [
Swieckowski](https://www.linkedin.com/in/arthur-swieckowski/)
[πŸ’»](https://github.com/netlify/netlify-cms/commits?author=Swieckowski "Code") [πŸ“–](https://github.com/netlify/netlify-cms/commits?author=Swieckowski "Documentation") [⚠️](https://github.com/netlify/netlify-cms/commits?author=Swieckowski "Tests") | | [
Tim Carry](http://www.pixelastic.com/)
[πŸ’»](https://github.com/netlify/netlify-cms/commits?author=pixelastic "Code") [🎨](#design-pixelastic "Design") [πŸ“–](https://github.com/netlify/netlify-cms/commits?author=pixelastic "Documentation") | [
Sol Park](https://github.com/solpark)
[πŸ’»](https://github.com/netlify/netlify-cms/commits?author=solpark "Code") | [
Michael Romani](https://github.com/michaelromani)
[πŸ’»](https://github.com/netlify/netlify-cms/commits?author=michaelromani "Code") | [
Xifeng Jin](http://linkedin/in/xifengjin88)
[πŸ›](https://github.com/netlify/netlify-cms/issues?q=author%3Axifengjin88 "Bug reports") [πŸ’»](https://github.com/netlify/netlify-cms/commits?author=xifengjin88 "Code") | [
Pedro Duarte](http://pedroduarte.me)
[πŸ›](https://github.com/netlify/netlify-cms/issues?q=author%3Apeduarte "Bug reports") [πŸ’»](https://github.com/netlify/netlify-cms/commits?author=peduarte "Code") [πŸ“–](https://github.com/netlify/netlify-cms/commits?author=peduarte "Documentation") | [
Antonio Argote](http://antonioargote.com)
[🎨](#design-Strangehill "Design") | [
Kristaps Taube](https://www.ktaube.com)
[πŸ’»](https://github.com/netlify/netlify-cms/commits?author=ktaube "Code") | -| [
David Ko](https://github.com/daveyko)
[πŸ’»](https://github.com/netlify/netlify-cms/commits?author=daveyko "Code") | [
IΓ±aki GarcΓ­a](http://www.txorua.com)
[🎨](#design-igarbla "Design") | [
Sam](https://github.com/gazebosx3)
[πŸ’»](https://github.com/netlify/netlify-cms/commits?author=gazebosx3 "Code") | [
Josh Dzielak](https://dzello.com)
[πŸ“–](https://github.com/netlify/netlify-cms/commits?author=dzello "Documentation") | [
Jeremy Bise](http://thosegeeks.com)
[πŸ“–](https://github.com/netlify/netlify-cms/commits?author=jeremybise "Documentation") | +| [
David Ko](https://github.com/daveyko)
[πŸ’»](https://github.com/netlify/netlify-cms/commits?author=daveyko "Code") | [
IΓ±aki GarcΓ­a](http://www.txorua.com)
[🎨](#design-igarbla "Design") | [
Sam](https://github.com/gazebosx3)
[πŸ’»](https://github.com/netlify/netlify-cms/commits?author=gazebosx3 "Code") | [
Josh Dzielak](https://dzello.com)
[πŸ“–](https://github.com/netlify/netlify-cms/commits?author=dzello "Documentation") | [
Jeremy Bise](http://thosegeeks.com)
[πŸ“–](https://github.com/netlify/netlify-cms/commits?author=jeremybise "Documentation") | [
terrierscript](https://terrierscript.com)
[πŸ’»](https://github.com/netlify/netlify-cms/commits?author=terrierscript "Code") | This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome! diff --git a/src/backends/backend.js b/src/backends/backend.js index 1e60da7f84c0..9c3ab44b4a35 100644 --- a/src/backends/backend.js +++ b/src/backends/backend.js @@ -67,6 +67,12 @@ const slugFormatter = (template = "{{slug}}", entryData, slugConfig) => { return (`0${ date.getMonth() + 1 }`).slice(-2); case "day": return (`0${ date.getDate() }`).slice(-2); + case "hour": + return (`0${ date.getHours() }`).slice(-2); + case "minute": + return (`0${ date.getMinutes() }`).slice(-2); + case "second": + return (`0${ date.getSeconds() }`).slice(-2); case "slug": return getIdentifier(entryData).trim(); default: diff --git a/website/site/content/docs/configuration-options.md b/website/site/content/docs/configuration-options.md index b97793adb003..83fb5d835414 100644 --- a/website/site/content/docs/configuration-options.md +++ b/website/site/content/docs/configuration-options.md @@ -134,6 +134,9 @@ For folder collections where users can create new items, the `slug` option speci - `{{year}}`: 4-digit year of the file creation date - `{{month}}`: 2-digit month of the file creation date - `{{day}}`: 2-digit day of the month of the file creation date +- `{{hour}}`: 2-digit hour of the file creation date +- `{{minute}}`: 2-digit minute of the file creation date +- `{{second}}`: 2-digit second of the file creation date **Example:**