@extends('layouts.app')

@section('title', '首页')

@section('content')
    <!-- mian -->
    <div class="container child">
        <!-- 侧边导航 -->
        <div class="child-nav">
            <div class="kj-bjt">
                <b>{{ $parent->title }}</b>
                <p>{{ $parent->description }}</p>
            </div>
            <ul class="child-nav-ul">
                @if ($parent->childrens->isNotEmpty())
                    @foreach ($parent->childrens()->orderBy('order','asc')->get() as $child)

                        <li>
                            <a href="{{ $child->link }}" @if($category->id==$child->id) class="show" @endif>{{ $child->title }}</a>
                        </li>
                    @endforeach
                @endif
            </ul>
        </div>
        <!-- content -->
        <div class="child-content">
            <ul class="spiritual-ul jlhz-border">
                @if ($articles->isNotEmpty())
                    @foreach ($articles as $article)
                        <li class="spiritual-ul-li">
                            <a href="{{ $article->link }}">
                                <h3 class="spiritual-title nowrap">{{ $article->title }}</h3>
                                <p class="spiritual-info nowrap-multi">
                                    {{ $article->description }}
                                </p>
                            </a>
                        </li>
                    @endforeach
                @endif
            </ul>
            <div class="pages">
                @if ($articles->isNotEmpty())
                    {{ $articles->links('layouts.pagination') }}
                @endif
            </div>
        </div>

    </div>
    <!-- end mian -->
@endsection
