{{-- resources/views/wiki/page.blade.php --}} @php $meta = $meta ?? []; $tabTitle = $meta['name'] ?? $meta['title'] ?? null; if (!$tabTitle) { $sec = isset($section) ? ucfirst(str_replace('-', ' ', (string) $section)) : 'Wiki'; $slg = isset($slug) ? ucfirst(str_replace('-', ' ', (string) $slug)) : ''; $tabTitle = trim($sec . ($slg ? ' / ' . $slg : '')); } $rawDesc = $meta['description'] ?? $meta['summary'] ?? ''; if (is_array($rawDesc)) { $rawDesc = implode(' ', array_filter(array_map('trim', $rawDesc))); } $seoDescription = trim((string) $rawDesc); if ($seoDescription === '') { $seoDescription = 'Learn more about ' . $tabTitle . ' on the Vortex Sky X Wiki.'; } $seoTitle = $tabTitle . ' • Vortex Sky X Wiki'; $icon = (string) ($meta['icon'] ?? ''); $seoImage = $icon !== '' ? (str_starts_with($icon, 'http') ? $icon : url($icon)) : asset('images/WebLogo.png'); @endphp {{ $seoTitle }} @include('wiki.partials.seo', [ 'title' => $seoTitle, 'description' => $seoDescription, 'image' => $seoImage, 'type' => 'article', 'game' => $game ?? null, ]) @vite(['resources/css/app.css', 'resources/js/app.js']) @if((string) ($section ?? '') === 'pages' && (string) ($slug ?? '') === 'guides-contributor-formatting-reference') @endif @include('wiki.partials.header', ['databaseMenu' => $databaseMenu]) @php $isItemDetail = (isset($section) && strtolower((string) $section) === 'items') && !empty($category) && !empty($slug); $entityName = $meta['name'] ?? $meta['title'] ?? null; $icon = $meta['icon'] ?? null; $rar = strtolower((string) ($meta['rarity'] ?? '')); $rarClass = $rar ? 'wk-q-' . $rar : ''; $fac = (string) ($meta['faction'] ?? ''); $facClass = $fac ? 'wk-f-' . strtolower($fac) : ''; $lvl = $meta['level_requirement'] ?? null; $stats = $meta['stats'] ?? []; $effects = $meta['effects'] ?? []; $sources = $meta['sources'] ?? []; // Description can be a string or a list (array) $desc = $meta['description'] ?? null; $descLines = []; if (is_array($desc)) { $descLines = array_values(array_filter(array_map('trim', $desc))); } elseif (is_string($desc) && trim($desc) !== '') { $descLines = [trim($desc)]; } $pageTitle = $isItemDetail ? ($entityName ?? 'Item Details') : ($meta['title'] ?? ucfirst(str_replace('-', ' ', (string) ($slug ?? '')))); // Only strip duplicate H1/img on item detail pages (never on home) $renderHtml = $html ?? ''; if ($isItemDetail) { $renderHtml = preg_replace('/]*>.*?<\/h1>\s*/is', '', $renderHtml, 1); $renderHtml = preg_replace('/

\s*]*>\s*<\/p>\s*/is', '', $renderHtml, 1); $renderHtml = preg_replace('/]*>\s*]*>\s*(?:]*>.*?<\/figcaption>\s*)?<\/figure>\s*/is', '', $renderHtml, 1); } // Guide content pages: translate the leading H1 to the active locale. // __() on the canonical English title yields the translation; an // already-translated title falls through unchanged (no matching key). elseif ((string) ($section ?? '') === 'pages' && str_starts_with((string) ($slug ?? ''), 'guides-')) { $guideTitle = trim((string) ($meta['title'] ?? '')); if ($guideTitle !== '') { $renderHtml = preg_replace_callback( '/]*>.*?<\/h1>/is', fn() => '

' . e(__($guideTitle)) . '

', $renderHtml, 1 ); } } $modelUrl = $meta['model_url'] ?? null; $typeLabel = $meta['type'] ?? null; $modelAllowed = ['npcs', 'monsters', 'weapons', 'armors', 'boots', 'capes']; // Prefer frontmatter "category" if present, otherwise fall back to "type" $modelKeyRaw = $meta['category'] ?? ($meta['type'] ?? ''); $modelKey = strtolower(trim((string) $modelKeyRaw)); $allowModelButton = in_array($modelKey, $modelAllowed, true); @endphp
@if($isItemDetail)
@if($icon) {{ $entityName ?? $pageTitle }} @endif
@if($allowModelButton) @endif
@if($entityName)
{{ $entityName }}
@endif
@if($fac)
{{ $fac }}
@endif @if($lvl !== null && $lvl !== '')
{{ __('Req. Lv') }}: {{ (int) $lvl }}
@endif @if(!empty($typeLabel))
{{ __('Type') }}: {{ ucfirst(str_replace('-', ' ', (string) $typeLabel)) }}
@endif
@if(count($descLines))
{{ __('Description') }}:
@foreach($descLines as $line)
{{ $line }}
@endforeach
@endif @if(is_array($stats) && count($stats))
@foreach($stats as $k => $v)
{{ str_replace('_', ' ', ucfirst((string) $k)) }} {{ $v }}
@endforeach
@endif @if(is_array($effects) && count($effects))
{{ __('Effects') }}
    @foreach($effects as $e)
  • {{ $e }}
  • @endforeach
@endif @if(is_array($sources) && count($sources))
{{ __('Sources') }}
    @foreach($sources as $s)
  • {{ $s }}
  • @endforeach
@endif
@endif @if((string) ($section ?? '') === 'pages' && (string) ($slug ?? '') === 'guides')

{{ __('Available Guides') }}

@php $guideCategories = $guideCategories ?? []; $selectedGuideCategory = (string) ($selectedGuideCategory ?? ''); @endphp @if(!empty($guideCategories))
@foreach($guideCategories as $categoryName) @endforeach
@if($selectedGuideCategory !== '') @endif
@endif @if(empty($guidePages))

{{ __('No guide markdown files found yet.') }}

@else
{{ __('Guide') }}
{{ __('Category') }}
@foreach($guidePages as $guide) @php $guideCategoryKey = (string) ($guide['category_key'] ?? 'uncategorized'); @endphp
{{ __($guide['label'] ?? ($guide['slug'] ?? 'Guide')) }}
{{ __($guide['category'] ?? 'Uncategorized') }}
@endforeach
@endif
@endif @if((string) ($section ?? '') === 'pages' && (string) ($slug ?? '') === 'guides-contributor-formatting-reference')

{{ __('Local Markdown Preview') }}

{!! __('Select a local .md file to preview how it will look on the website. The file is read in your browser only and is not uploaded.') !!}

{{ __('No file loaded.') }}

{{ __('Load a local markdown file to preview it here.') }}

@endif {{-- Markdown content (home carousels live here) --}}
{!! $renderHtml !!}
@if($isItemDetail) @endif