diff --git a/.gitignore b/.gitignore index a265103..65cd7e5 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ package-lock.json /build_staging/ /build_production/ /source/assets/build/ -/build_local/ \ No newline at end of file +/build_local/ +/source/_posts/ diff --git a/README.md b/README.md index 38e67f9..c07bc3e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ # Nikus Blog Template -Here is the template of my blog, released under the MIT license. \ No newline at end of file +Here is the template of my blog, released under the MIT license. + +Format Date for Posts like here +https://unicode-org.github.io/icu/userguide/format_parse/datetime/#date-field-symbol-table \ No newline at end of file diff --git a/composer.json b/composer.json index c76d91c..530ce0b 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,6 @@ { "require": { - "tightenco/jigsaw": "^1.3" + "tightenco/jigsaw": "^1.3", + "ext-intl": "*" } } diff --git a/config.php b/config.php index 5aa1813..e11ef72 100644 --- a/config.php +++ b/config.php @@ -1,9 +1,33 @@ false, 'baseUrl' => '', - 'title' => 'Jigsaw', - 'description' => 'Website description.', - 'collections' => [], + 'language' => 'de', + 'title' => 'Nikus Blog', + 'owner' => 'Niku', + 'email' => 'publicmail [at] [thisDomain] [dot] de', + 'description' => 'Blogs über IT-Stuff, meine Projekte und allem was sonst so anfällt.', + 'locale' => 'de_DE', + 'dateFormat' => 'd. MMMM yyyy', + 'collections' => [ + 'posts' => [ + 'excerpt' => function ($page, $length = 75) { + if (count(explode(' ', strip_tags($page->getContent()))) <= $length){ + return strip_tags($page->getContent()); + } else { + return implode(' ', array_slice(explode(' ', strip_tags($page->getContent())), 0, $length)) . '...'; + } + } + ] + ], + 'dateTranslated' => function ($page, $date) { + $format = new IntlDateFormatter( + $page->locale, + IntlDateFormatter::NONE, + IntlDateFormatter::NONE, + Null, + Null, + $page->dateFormat); + return datefmt_format($format, $date); + } ]; diff --git a/source/_assets/css/main.css b/source/_assets/css/main.css index d622059..1450552 100644 --- a/source/_assets/css/main.css +++ b/source/_assets/css/main.css @@ -1,6 +1,6 @@ @font-face { font-family: 'Custom'; - src: url("JetBrainsMono[wght].ttf"); + src: url("/assets/fonts/JetBrainsMono[wght].ttf"); } * { @@ -83,4 +83,56 @@ main hr { main hr:last-of-type { display: none; -} \ No newline at end of file +} + +section.paginationNavigation { + margin-top: 1rem; + display: flex; + justify-content: center; +} + +footer { + margin-top: 4rem; + border-top: thin solid; +} + +footer div { + max-width: 950px; + margin: 0 auto; + padding: 1rem; + display: flex; + gap: 3rem; +} + +footer div section:first-child { + flex: 1; +} + +footer div section:last-child { + flex: .8; +} + +footer div section p { + font-size: .8rem; + margin: .2rem 0; +} + +@media (max-width: 500px) { + footer div { + display: block; + } + + footer div section:last-child { + margin-top: 1rem; + } +} + +@media (max-width: 750px) { + article section { + display: block; + } + + article section h2 { + padding-bottom: .5rem; + } +} diff --git a/source/_layouts/main.blade.php b/source/_layouts/main.blade.php index 35a02b6..c021ae6 100644 --- a/source/_layouts/main.blade.php +++ b/source/_layouts/main.blade.php @@ -6,17 +6,17 @@ - {{ $page->title }} + {{ $page->owner }}s Blog
-

Nikus Blog

+

{{ $page->owner }}s Blog

@@ -24,7 +24,27 @@ @yield('body') diff --git a/source/_layouts/post.blade.php b/source/_layouts/post.blade.php new file mode 100644 index 0000000..47cc2a8 --- /dev/null +++ b/source/_layouts/post.blade.php @@ -0,0 +1,7 @@ +@extends('_layouts.main') + +@section('body') +

{{ $page->title }}

+ {{ $page->dateTranslated($page->date) }} + @yield('content') +@endsection \ No newline at end of file diff --git a/source/_posts/my-second-post.md b/source/_posts/my-second-post.md new file mode 100644 index 0000000..c0382fb --- /dev/null +++ b/source/_posts/my-second-post.md @@ -0,0 +1,6 @@ +--- +extends: _layouts.post +title: My second Blog Post +date: 2017-03-27 +--- +Non interesting post QwQ \ No newline at end of file diff --git a/source/about.blade.php b/source/about.blade.php new file mode 100644 index 0000000..477771f --- /dev/null +++ b/source/about.blade.php @@ -0,0 +1,6 @@ +@extends('_layouts.main') + +@section('body') +

Hello World

+

{{ $page->getPath() }}

+@endsection \ No newline at end of file diff --git a/source/assets/images/enby.png b/source/assets/images/enby.png new file mode 100644 index 0000000..2bce7b9 Binary files /dev/null and b/source/assets/images/enby.png differ diff --git a/source/assets/images/html5.png b/source/assets/images/html5.png new file mode 100644 index 0000000..36c23e6 Binary files /dev/null and b/source/assets/images/html5.png differ diff --git a/source/assets/images/nocookie.gif b/source/assets/images/nocookie.gif new file mode 100644 index 0000000..c0dd092 Binary files /dev/null and b/source/assets/images/nocookie.gif differ diff --git a/source/assets/images/nottracked.png b/source/assets/images/nottracked.png new file mode 100644 index 0000000..faad93c Binary files /dev/null and b/source/assets/images/nottracked.png differ diff --git a/source/assets/images/pride.gif b/source/assets/images/pride.gif new file mode 100644 index 0000000..412ed9b Binary files /dev/null and b/source/assets/images/pride.gif differ diff --git a/source/assets/images/programmingsocks.gif b/source/assets/images/programmingsocks.gif new file mode 100644 index 0000000..5c54864 Binary files /dev/null and b/source/assets/images/programmingsocks.gif differ diff --git a/source/index.blade.php b/source/index.blade.php index 2fd1a2f..01397be 100644 --- a/source/index.blade.php +++ b/source/index.blade.php @@ -1,7 +1,45 @@ +--- +pagination: + collection: posts + perPage: 5 +--- + @extends('_layouts.main') @section('body') -
-

Hello world!

-
+@foreach($pagination->items as $post) +
+
+

{{ $post->title }}

{{ $page->dateTranslated($post->date) }} +
+
+

+ {{ $post->excerpt() }} +

+
+
+
+@endforeach +
+ @if ($previous = $pagination->previous) + <<  + <  + @else + << <  + @endif + + @foreach ($pagination->pages as $pageNumber => $path) + @if($pageNumber !== 1) @endif + {{ $pageNumber }} + @endforeach + + @if ($next = $pagination->next) +  >  + >> + @else +  > >> + @endif +
+ @endsection diff --git a/source/projects.blade.php b/source/projects.blade.php new file mode 100644 index 0000000..477771f --- /dev/null +++ b/source/projects.blade.php @@ -0,0 +1,6 @@ +@extends('_layouts.main') + +@section('body') +

Hello World

+

{{ $page->getPath() }}

+@endsection \ No newline at end of file