Skip to content

Commit

Permalink
Simplify tags
Browse files Browse the repository at this point in the history
  • Loading branch information
breadthe committed Jan 31, 2024
1 parent 3d04e5a commit 5bb4895
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 32 deletions.
25 changes: 4 additions & 21 deletions source/_components/tag.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,16 @@

@php
use function App\helpers\tagSize;
use Illuminate\Support\Str;
@endphp

<a
href="{{ $href }}"
title="{{ $title }}"
class="category--tag group inline-flex items-center gap-2 font-mono bg-teal-400 hover:shadow-md no-underline rounded"
title="{{ $count }} {{ Str::plural('post', $count) }} in {{ $title }}"
class="category--tag font-mono font-light text-teal-700"
@if($isTagCloud)
style="font-size: {{ tagSize($count) }}px;"
@endif
>
<span @class([
'px-2',
'rounded',
'rounded-r-none' => $count,
'bg-teal-100',
'group-hover:bg-teal-400',
'text-teal-700',
'group-hover:text-white',
'font-light',
'shadow-inner',
])>
{{ $slot }}
</span>

@if($count)
<small class="font-light text-right pr-2 bg-teal-400 text-white rounded-r">
{{ $count }}
</small>
@endif
{{ $slot }}
</a>
18 changes: 7 additions & 11 deletions source/archive.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@
@endpush

@section('hero')
<x-hero title="Blog Archive" description="{{'A yearly archive of all the articles posted on ' . $page->siteName}}" />
<x-hero title="Blog Archive" description="A yearly archive of all the blog posts" />
@endsection

@section('body')
<div class="grid grid-cols-1 sm:grid-cols-12 sm:gap-4">
<section class="sm:col-span-10 order-last sm:order-first w-full p-4 sm:p-6 bg-white rounded">
<div class="flex flex-col gap-4">
<aside class="px-4 mb-4">
<x-tag-cloud :tags="$tags" :posts="$posts" />
</aside>

<section class="p-4 sm:p-6 bg-white rounded">
@foreach ($posts->groupBy(function ($post) { return $post->getDate()->format('Y'); }) as $year => $yearPosts)
<div class="mb-8">
<h2 class="flex items-center justify-between text-teal-700">
Expand All @@ -40,13 +44,5 @@ class="underline underline-offset-2 decoration-teal-200 hover:decoration-teal-40
</div>
@endforeach
</section>

<aside class="sm:col-span-2 order-first sm:order-last flex flex-col gap-4 sm:flex-1 px-4 mb-8">
<h2 class="flex items-center justify-between text-teal-700">
Tags
</h2>

<x-tag-cloud :tags="$tags" :posts="$posts" />
</aside>
</div>
@stop

0 comments on commit 5bb4895

Please sign in to comment.