fix for link encoding issue

small bug where links in the archive and tag templates where being
rendered as url encoded strings, so that needed to be decoded so it
displays as normal text
This commit is contained in:
ro 2024-10-29 12:05:50 -06:00
parent a7354da38f
commit 9c432db209
No known key found for this signature in database
GPG key ID: 29B551CDBD4D3B50
2 changed files with 7 additions and 4 deletions

View file

@ -90,7 +90,7 @@ class SortingService
if (isset($page['tags'])) { if (isset($page['tags'])) {
if (strpos($page['tags'], $tag) !== false) { if (strpos($page['tags'], $tag) !== false) {
array_push($tagged, [ array_push($tagged, [
'title' => $page['title'], 'title' => urldecode($page['title']),
'slug' => $page['slug'], 'slug' => $page['slug'],
'path' => $page['path'], 'path' => $page['path'],
'feature' => $page['feature'], 'feature' => $page['feature'],

View file

@ -14,14 +14,17 @@
<div role="archive-month"> <div role="archive-month">
<h3>{{ $data['full_month'] }}</h3> <h3>{{ $data['full_month'] }}</h3>
@foreach($data['pages'] as $page) @foreach($data['pages'] as $page)
@php
$title = urldecode($page['title']);
@endphp
@if(isset($dynamicRender)) @if(isset($dynamicRender))
@if($dynamicRender == 'true') @if($dynamicRender == 'true')
<a href="{{ "/".$item['year']."/".$data['month']."/".$page['slug'] }}">{{ $page['title'] }}</a><br/> <a href="{{ "/".$item['year']."/".$data['month']."/".$page['slug'] }}">{{ $title }}</a><br/>
@else @else
<a href="{{ "/".$item['year']."/".$data['month']."/".$page['slug'].".html" }}">{{ $page['title'] }}</a><br/> <a href="{{ "/".$item['year']."/".$data['month']."/".$page['slug'].".html" }}">{{ $title }}</a><br/>
@endif @endif
@else @else
<a href="{{ "/".$item['year']."/".$data['month']."/".$page['slug'] }}">{{ $page['title'] }}</a><br/> <a href="{{ "/".$item['year']."/".$data['month']."/".$page['slug'] }}">{{ $title }}</a><br/>
@endif @endif
@endforeach @endforeach
</div> </div>