|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Lichtenwallner (https://lichtenwallner.at) |
|
4
|
|
|
* |
|
5
|
|
|
* @see https://github.com/jolicht/markdown-cms for the canonical source repository |
|
6
|
|
|
* @license https://github.com/jolicht/markdown-cms/blob/master/LICENSE MIT |
|
7
|
|
|
* @copyright Copyright (c) Johannes Lichtenwallner |
|
8
|
|
|
*/ |
|
9
|
|
|
declare(strict_types = 1); |
|
10
|
|
|
namespace Jolicht\MarkdownCms; |
|
11
|
|
|
|
|
12
|
|
|
use Mni\FrontYAML\Parser; |
|
13
|
|
|
use Jolicht\MarkdownCms\Markdown\FrontYamlParserFactory; |
|
14
|
|
|
use Jolicht\MarkdownCms\Markdown\MarkdownDocumentParser; |
|
15
|
|
|
use Jolicht\MarkdownCms\Markdown\MarkdownDocumentParserFactory; |
|
16
|
|
|
use Jolicht\MarkdownCms\ContentType\PageCreator; |
|
17
|
|
|
use Jolicht\MarkdownCms\ContentType\BlogEntryCreator; |
|
18
|
|
|
use Jolicht\MarkdownCms\Iterator\MarkdownFileIterator; |
|
19
|
|
|
use Jolicht\MarkdownCms\Iterator\MarkdownFileIteratorFactory; |
|
20
|
|
|
use Jolicht\MarkdownCms\ContentType\ContentCreator; |
|
21
|
|
|
use Jolicht\MarkdownCms\ContentType\ContentCreatorFactory; |
|
22
|
|
|
use Jolicht\MarkdownCms\Parser\ContentParser; |
|
23
|
|
|
use Jolicht\MarkdownCms\Parser\ContentParserFactory; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* Configuration provider for module Jolicht\MarkdownCms |
|
27
|
|
|
*/ |
|
28
|
|
|
class ModuleConfig |
|
29
|
|
|
{ |
|
30
|
|
|
/** |
|
31
|
|
|
* Get module config |
|
32
|
|
|
*/ |
|
33
|
|
|
public function __invoke() |
|
34
|
|
|
{ |
|
35
|
|
|
return [ |
|
36
|
|
|
'markdown_cms' => [ |
|
37
|
|
|
'options' => [ |
|
38
|
|
|
'content_dir' => 'data/content', |
|
39
|
|
|
'content_type_default' => 'blogEntry', |
|
40
|
|
|
'content_types' => [ |
|
41
|
|
|
'page' => [ |
|
42
|
|
|
'creator' => PageCreator::class, |
|
43
|
|
|
'default_template' => 'app:page.twig' |
|
44
|
|
|
], |
|
45
|
|
|
'blogEntry' => [ |
|
46
|
|
|
'creator' => BlogEntryCreator::class, |
|
47
|
|
|
'default_template' => 'app:blog-entry.twig' |
|
48
|
|
|
] |
|
49
|
|
|
] |
|
50
|
|
|
] |
|
51
|
|
|
], |
|
52
|
|
|
'dependencies' => [ |
|
53
|
|
|
'factories' => [ |
|
54
|
|
|
ContentCreator::class => ContentCreatorFactory::class, |
|
55
|
|
|
ContentParser::class => ContentParserFactory::class, |
|
56
|
|
|
MarkdownDocumentParser::class => MarkdownDocumentParserFactory::class, |
|
57
|
|
|
MarkdownFileIterator::class => MarkdownFileIteratorFactory::class, |
|
58
|
|
|
Parser::class => FrontYamlParserFactory::class, |
|
59
|
|
|
] |
|
60
|
|
|
] |
|
61
|
|
|
]; |
|
62
|
|
|
} |
|
63
|
|
|
} |