Skip to content

Commit

Permalink
🚀🚀🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
atmonshi committed Apr 17, 2022
1 parent 5c3a956 commit 1fbc907
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 78 deletions.
2 changes: 1 addition & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Changelog
weight: 10
weight: 100
---

All changes to `sky` are documented on GitHub [changelog](https://github.com/lara-zeus/sky/blob/main/CHANGELOG.md)
50 changes: 0 additions & 50 deletions docs/installation-and-setup.md

This file was deleted.

11 changes: 8 additions & 3 deletions docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ title: Introduction
weight: 1
---

Lara-zeus sky, is a contact form provides a simple contact form manager, with the ability to store the messages in the database, and you can reply to them from a dashboard.
## Introduction
@zeus sky, is a simple CMS for your website. it includes posts, pages, tags, and categories, with a frontend scaffolding.

**[Demo](https://sky.larazeus.com) · [Github](https://github.com/lara-zeus/sky)**
**[Demo](https://demo.larazeus.com) · [Github](https://github.com/lara-zeus/sky)**

## features
- 🔥 built with [TALL stack](https://tallstack.dev/)
Expand All @@ -22,4 +23,8 @@ Lara-zeus sky, is a contact form provides a simple contact form manager, with th
- multiple tags and categories
- Featured Image

and more in the way.
and more in the way:
- authers
- menus
- comments
- and more!
2 changes: 1 addition & 1 deletion docs/update.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: update
weight: 3
weight: 99
---

## Composer
Expand Down
2 changes: 1 addition & 1 deletion resources/views/themes/zeus/category.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@unless($posts->isEmpty())
<div class="mt-10 grid grid-cols-3 gap-4">
@foreach($posts as $post)
@include('zeus-sky::themes.'.config('zeus-sky.theme').'.partial.sticky')
@include($theme.'.partial.sticky')
@endforeach
</div>
@endunless
Expand Down
10 changes: 5 additions & 5 deletions resources/views/themes/zeus/home.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@unless($stickies->isEmpty())
<div class="mt-10 grid @if($stickies->count() > 1) grid-cols-3 @endif gap-4">
@foreach($stickies as $post)
@include('zeus-sky::themes.'.config('zeus-sky.theme').'.partial.sticky')
@include($theme.'.partial.sticky')
@endforeach
</div>
@endunless
Expand All @@ -16,16 +16,16 @@
<div class="flex items-center justify-between">
<h1 class="text-xl font-bold text-gray-700 md:text-2xl">Posts</h1>
</div>
@each('zeus-sky::themes.'.config('zeus-sky.theme').'.partial.post', $posts, 'post')
@each($theme.'.partial.post', $posts, 'post')
@else
@include('zeus-sky::themes.'.config('zeus-sky.theme').'.partial.empty')
@include($theme.'.partial.empty')
@endunless
</div>
<div class="w-1/4">
@include('zeus-sky::themes.'.config('zeus-sky.theme').'.partial.sidebar')
@include($theme.'.partial.sidebar')
</div>
@else
@include('zeus-sky::themes.'.config('zeus-sky.theme').'.partial.empty')
@include($theme.'.partial.empty')
@endunless
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/themes/zeus/page.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<span class="font-light text-gray-600">{{ optional($post->published_at)->diffForHumans() ?? '' }}</span>
<div>
@unless ($post->tags->isEmpty())
@each('zeus-sky::themes.'.config('zeus-sky.theme').'.partial.tag', $post->tags->where('type','category'), 'tag')
@each($theme.'.partial.tag', $post->tags->where('type','category'), 'tag')
@endunless
</div>
</div>
Expand Down Expand Up @@ -54,7 +54,7 @@

<div class="grid grid-cols-3 gap-4">
@foreach($children as $post)
@include('zeus-sky::themes.'.config('zeus-sky.theme').'.partial.children-pages')
@include($theme.'.partial.children-pages')
@endforeach
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/themes/zeus/partial/post.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<span class="font-light text-sm text-gray-600">{{ optional($post->published_at)->diffForHumans() ?? '' }}</span>
<div>
@unless ($post->tags->isEmpty())
@each('zeus-sky::themes.'.config('zeus-sky.theme').'.partial.tag', $post->tags->where('type','category'), 'tag')
@each($theme.'.partial.tag', $post->tags->where('type','category'), 'tag')
@endunless
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/themes/zeus/partial/related.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="p-4 absolute bottom-0 ltr:left-0 rtl:right-0 z-20">
<div>
@unless ($post->tags->isEmpty())
@each('zeus-sky::themes.'.config('zeus-sky.theme').'.partial.tag', $post->tags->where('type','category'), 'tag')
@each($theme.'.partial.tag', $post->tags->where('type','category'), 'tag')
@endunless
</div>
<a href="{{ route('post',$post->slug) }}" class="text-4xl font-semibold text-gray-100 leading-tight">
Expand Down
8 changes: 4 additions & 4 deletions resources/views/themes/zeus/partial/sidebar.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{--@include('zeus-sky::themes.'.config('zeus-sky.theme').'.partial.authors')--}}
@include('zeus-sky::themes.'.config('zeus-sky.theme').'.partial.sidebar.categories')
@include('zeus-sky::themes.'.config('zeus-sky.theme').'.partial.sidebar.recent')
@include('zeus-sky::themes.'.config('zeus-sky.theme').'.partial.sidebar.pages')
{{--@include($theme.'.partial.authors')--}}
@include($theme.'.partial.sidebar.categories')
@include($theme.'.partial.sidebar.recent')
@include($theme.'.partial.sidebar.pages')
4 changes: 2 additions & 2 deletions resources/views/themes/zeus/post.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<span class="font-light text-gray-600">{{ optional($post->published_at)->diffForHumans() ?? '' }}</span>
<div>
@unless ($post->tags->isEmpty())
@each('zeus-sky::themes.'.config('zeus-sky.theme').'.partial.tag', $post->tags->where('type','category'), 'tag')
@each($theme.'.partial.tag', $post->tags->where('type','category'), 'tag')
@endunless
</div>
</div>
Expand Down Expand Up @@ -51,7 +51,7 @@

<div class="grid grid-cols-3 gap-4">
@foreach($related as $post)
@include('zeus-sky::themes.'.config('zeus-sky.theme').'.partial.related')
@include($theme.'.partial.related')
@endforeach
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Livewire/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function render()
->description($this->page->description)
->twitter();

return view('zeus-sky::themes.'.config('zeus-sky.theme').'.page')
return view(app('theme') . '.page')
->with([
'post' => $this->page,
'children' => Post::with('parent')->where('parent_id', $this->page->id)->get(),
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Livewire/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function render()
->description($this->post->description)
->twitter();

return view('zeus-sky::themes.'.config('zeus-sky.theme').'.post')
return view(app('theme').'.post')
->with('post', $this->post)
->with('related', postModel::related($this->post)->take(4)->get())
->layout(config('zeus-sky.layout'));
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Livewire/Posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Posts extends Component
{
public function render()
{
return view('zeus-sky::themes.'.config('zeus-sky.theme').'.home')
return view(app('theme').'.home')
->with([
'posts' => Post::NotSticky()->orderBy('published_at', 'desc')->get(),
'pages' => Post::page()->orderBy('published_at', 'desc')->whereNull('parent_id')->get(),
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Livewire/Tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public function render()
->description('Show All posts in '.$this->tag->name)
->twitter();

return view('zeus-sky::themes.'.config('zeus-sky.theme').'.category')
return view(app('theme').'.category')
->with([
'posts' => Post::withAllTags([$this->slug], $this->type)->get(),
'posts' => $this->tag->postsPublished,
])
->layout(config('zeus-sky.layout'));
}
Expand Down
5 changes: 5 additions & 0 deletions src/Models/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ public function posts()
return $this->morphedByMany(Post::class, 'taggable');
}

public function postsPublished()
{
return $this->morphedByMany(Post::class, 'taggable')->published();
}

protected function generateSlug(string $locale): string
{
if ($this->slug !== null) {
Expand Down
12 changes: 10 additions & 2 deletions src/SkyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace LaraZeus\Sky;

use Filament\PluginServiceProvider;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\View;
use LaraZeus\Sky\Filament\Resources\PageResource;
use LaraZeus\Sky\Filament\Resources\PostResource;
use LaraZeus\Sky\Filament\Resources\TagResource;
Expand All @@ -18,11 +20,17 @@ public function boot()
->site(config('app.name', 'Laravel'))
->title(config('zeus-sky.site_title'))
->description(config('zeus-sky.site_description'))
->rawTag('favicon', '<link rel="icon" type="image/x-icon" href="'.asset('favicon/favicon.ico').'">')
->rawTag('<meta name="theme-color" content="'.config('zeus-sky.site_color').'" />')
->rawTag('favicon', '<link rel="icon" type="image/x-icon" href="' . asset('favicon/favicon.ico') . '">')
->rawTag('<meta name="theme-color" content="' . config('zeus-sky.site_color') . '" />')
->withUrl()
->twitter();

View::share('theme', 'zeus-sky::themes.' . config('zeus-sky.theme'));

App::singleton('theme', function () {
return 'zeus-sky::themes.' . config('zeus-sky.theme');
});

return parent::boot();
}

Expand Down

0 comments on commit 1fbc907

Please sign in to comment.