23 Commits

Author SHA1 Message Date
Caleb
d10f97f561 Allow different beginning and ending frontmatter delimiters. 2018-02-21 17:01:13 -05:00
Swieckowski
afce6abbc2 Custom delimiters (#1064)
* frontmatter functions now exported as curried constructors

* changed formats.js to accomodate frontmatter.js changes

* can only use custom delimiters if format is specified

* reverting changes

* updated tests to reflect changes

* created tests for custom delimiters

* updated docs to reflect addition of custom delimiter configuration

* formatByExtension no longer takes custom delimiter

* missed some formatByExtension calls

* Edited the docs according to suggestions

* Throws an error if a custom delimiter is set without declaring frontmatter format

* Throws error if custom delimiter set without explicit and proper frontmatter format being declared

* example config file set to proper defaults

* moved frontmatterFormats to formats

* Update .all-contributorsrc

* updated contributions

* Clarify docs
2018-02-08 18:04:42 -07:00
Caleb
756d562c66 Support writing frontmatter in multiple formats (#933)
* Format JSON files.

Currently we store JSON as a single line in files. We should prettify it
like we do the other formats.

* Add output parsers to the frontmatter list.

* Cleanup frontmatter format parser options.

* Support writing frontmatter in TOML and JSON.

Right now we can read TOML or JSON frontmatter by inferring,
but we can only write frontmatter in YAML. This change allows the
frontmatter format to be explicitly set for reading and writing.

* Fix frontmatter formatter.

* Update Frontmatter formatter tests.

* Update frontmatter format docs.
2018-01-29 17:35:36 -05:00
Caleb
834c5f4942 Throw if cannot infer format from file extension. 2017-12-06 10:23:08 -05:00
Caleb
326dd48cc0 Remove support for markdown and html as explicit formats.
The `frontmatter` format is the correct one to use here.
2017-12-06 10:23:08 -05:00
Caleb
d5ff92e47e Throw config error if unsupported format. 2017-12-06 10:23:08 -05:00
Caleb
864083bc8b Infer format from extension for new entries.
If a collection has no format specified, we try to infer the format from
the file extension when reading. This commit also allows us to infer the
format from the `extension` set in the config, so that we can still
create the correct format when making a new file.
2017-12-06 10:07:07 -05:00
Caleb
0e51cff231 Do not infer file format if collection specified.
Before, we always tried to infer a file's format, even if it was
explicitly specified in the collection's config. This commit makes it so
that we always use the format from the config if it is specified, and
only if it is not set do we try to infer it from the file extension.
2017-12-06 09:53:38 -05:00
Caleb
a72a08f7a2 Add JSON as manually supported format. 2017-11-27 15:37:37 -05:00
Caleb
37a36ffed4 Fix other than markdown editorial workflow entries on dashboard.
When entries were loaded for the editorial workflow dashboard, they were
all assumed to be FrontMatter/MarkDown files. This PR allows them to be
any supported format.
2017-11-11 10:34:29 -05:00
Caleb
1bb2b56366 Cleanup file formatters. (#759)
* Clean up frontmatter formatter.

* Move `formatToExtension`.

* Use plain objects for file formatters.

* Use same parsers for files and frontmatter.

We want to use our file parsers for frontmatter, instead of the builtin
ones, as they process some formats (images, dates) properly.

* Cleanup YAML frontmatter parser code.
2017-10-30 12:48:19 -07:00
Caleb
2ef6556d4a Add support for TOML files. (#740)
* Move `sortKeys` into a helper function.

* Add support for TOML files.
2017-10-26 11:43:28 -07:00
Benaiah Mischenko
30dcc2bdf0 Fix confusing "yaml/yml" distinction in formats.js
Makes "yml" and "yaml" synonyms for both file extensions and format
settings.
2017-08-15 14:42:55 -07:00
Joseph Earl
dc313d157b Rename YamlFrontmatter to just Frontmatter 2017-04-09 19:32:33 +01:00
Mathias Biilmann Christensen
8b82a5b72e Add a script for auto configurating a collection 2016-12-26 17:44:50 -08:00
Mathias Biilmann Christensen
c23b2fb531 Make list widget sortable 2016-10-30 16:01:10 -07:00
Mathias Biilmann Christensen
6b73c39ba8 Support for object widget 2016-10-28 04:51:37 +02:00
Mathias Biilmann Christensen
80a2cefbf0 Add json format support 2016-10-27 15:33:15 +02:00
Mathias Biilmann Christensen
42853f2af8 Handle formats better 2016-09-13 14:53:50 +02:00
Mathias Biilmann Christensen
7cd5d84fa5 Merge remote-tracking branch 'origin/react-pr' into react-ui-updates
Replaced dateFormat with moment

Conflicts:
	package.json
	src/backends/netlify-git/API.js
	src/containers/CollectionPage.js
	src/formats/formats.js
2016-09-12 15:35:56 +02:00
Mathias Biilmann Christensen
fcd0ce718a Support for YAML content 2016-09-11 23:08:18 +02:00
Cássio Zen
f0e608a209 Editorial Workflow skeleton 2016-09-06 13:04:17 -03:00
Mathias Biilmann Christensen
978b7290c5 Test repo can now be used to list entries 2016-02-25 20:40:35 -08:00