diff --git a/composer.json b/composer.json index ad16e19..61b64f7 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,8 @@ "cebe/php-openapi": "^1.4", "illuminate/config": "^8.21", "illuminate/view": "^8.26", - "league/commonmark": "^1.5" + "league/commonmark": "^1.5", + "spatie/yaml-front-matter": "^2.0" }, "extra": { "laravel": { diff --git a/composer.lock b/composer.lock index 15e64e4..90eb036 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "be668d2d48d5edfbd719ed32fa1c5133", + "content-hash": "59a962967faa300a334e0759075be34a", "packages": [ { "name": "brick/math", @@ -1984,6 +1984,59 @@ ], "time": "2020-08-18T17:17:46+00:00" }, + { + "name": "spatie/yaml-front-matter", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/spatie/yaml-front-matter.git", + "reference": "efb5170a92216b8d2f40874301db8eb51b8e73cc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/yaml-front-matter/zipball/efb5170a92216b8d2f40874301db8eb51b8e73cc", + "reference": "efb5170a92216b8d2f40874301db8eb51b8e73cc", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "symfony/yaml": "^3.0|^4.0|^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\YamlFrontMatter\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sebastian De Deyne", + "email": "sebastian@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "A to the point yaml front matter parser", + "homepage": "https://github.com/sebastiandedeyne/yaml-front-matter", + "keywords": [ + "front matter", + "jekyll", + "spatie", + "yaml" + ], + "support": { + "issues": "https://github.com/spatie/yaml-front-matter/issues", + "source": "https://github.com/spatie/yaml-front-matter/tree/master" + }, + "time": "2019-12-02T20:50:50+00:00" + }, { "name": "symfony/console", "version": "v5.2.1", diff --git a/resources/views/components/page.blade.php b/resources/views/components/page.blade.php index b0e32a4..bcde2c4 100644 --- a/resources/views/components/page.blade.php +++ b/resources/views/components/page.blade.php @@ -1,11 +1,11 @@
-

- {{ $title() }} +

+ {{ $page->title() }}

-
{!! trim($content()) !!}
+
{!! $content() !!}
diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index 115da53..169200e 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -13,12 +13,12 @@ @section('content')
- @foreach($pages as $title => $content) - + @foreach($pages as $page) + @endforeach @foreach ($groups as $name => $endpoints) - + @endforeach
@endsection diff --git a/resources/views/partials/navigation.blade.php b/resources/views/partials/navigation.blade.php index 9e0d0b3..ff890e1 100644 --- a/resources/views/partials/navigation.blade.php +++ b/resources/views/partials/navigation.blade.php @@ -11,17 +11,18 @@ brightness_auto -
- + @unless ($pages->isEmpty()) + + @endunless