Remove support for markdown and html as explicit formats.
The `frontmatter` format is the correct one to use here.
This commit is contained in:
parent
d5ff92e47e
commit
326dd48cc0
@ -4,19 +4,19 @@ import jsonFormatter from './json';
|
||||
import FrontmatterFormatter from './frontmatter';
|
||||
|
||||
export const supportedFormats = [
|
||||
'markdown',
|
||||
'yml',
|
||||
'yaml',
|
||||
'toml',
|
||||
'json',
|
||||
'html',
|
||||
'frontmatter',
|
||||
];
|
||||
|
||||
export const formatToExtension = format => ({
|
||||
markdown: 'md',
|
||||
yml: 'yml',
|
||||
yaml: 'yml',
|
||||
toml: 'toml',
|
||||
json: 'json',
|
||||
html: 'html',
|
||||
frontmatter: 'md',
|
||||
}[format]);
|
||||
|
||||
export function formatByExtension(extension) {
|
||||
@ -37,9 +37,6 @@ function formatByName(name) {
|
||||
yaml: yamlFormatter,
|
||||
toml: tomlFormatter,
|
||||
json: jsonFormatter,
|
||||
md: FrontmatterFormatter,
|
||||
markdown: FrontmatterFormatter,
|
||||
html: FrontmatterFormatter,
|
||||
frontmatter: FrontmatterFormatter,
|
||||
}[name];
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ function validateCollection(configCollection) {
|
||||
const selectors = {
|
||||
[FOLDER]: {
|
||||
entryExtension(collection) {
|
||||
return collection.get('extension') || formatToExtension(collection.get('format') || 'markdown');
|
||||
return collection.get('extension') || formatToExtension(collection.get('format') || 'frontmatter');
|
||||
},
|
||||
fields(collection) {
|
||||
return collection.get('fields');
|
||||
|
Loading…
x
Reference in New Issue
Block a user