templates/news/list.html.twig line 1

  1. {% extends 'base.html.twig' %}
  2. {% import 'macros/post.html.twig' as article %}
  3. {% block title %}News & Events{% endblock %}
  4. {% block body %}
  5.   <section class="relative overflow-hidden bg-neutral-100 mx-auto">
  6.     <div class="py-20 md:py-28 lg:px-8">
  7.       <div class="mx-auto md:px-8 px-6">
  8.         <div class="relative grid mx-auto lg:gap-8 xl:gap-x-6 lg:grid-cols-12">
  9.           <div class="lg:mt-0 lg:col-span-6 relative">
  10.             <div class="relative mx-auto md:mr-0">
  11.               <span class="absolute top-2 right-2 z-10 bg-brand text-white shadow-lg text-sm text-center px-5 py-1 rounded-full">Featured</span>
  12.               <img
  13.                 class="w-full h-full object-cover object-center rounded-2xl relative"
  14.                 src="{{ asset('/uploads/news/news_6_1.jpeg') }}"
  15.                 alt="{{ pagination.items[0].title }}"
  16.               />
  17.             </div>
  18.           </div>
  19.           <div class="lg:order-first self-center lg:col-span-6 lg:px-6 lg:py-0 py-16">
  20.             <span class="inline-block text-sm font-medium text-gray-500">
  21.               {{ pagination.items[0].updated | date('F d, Y')|upper }}
  22.             </span>
  23.             <h1 class="text-brand capitalize mt-1 mb-4 text-2xl font-semibold tracking-normal !leading-tight md:text-3xl xl:text-5xl">
  24.               {{ pagination.items[0].title }}
  25.             </h1>
  26.             <p class="mb-6 font-normal leading-relaxed text-gray-500 lg:mb-8 text-base">
  27.               {{ pagination.items[0].description }}
  28.             </p>
  29.             <a
  30.               href="/news/{{ pagination.items[0].urlTitle }}"
  31.               class="
  32.                 rounded-full
  33.                 shadow-lg
  34.                 bg-white
  35.                 px-6
  36.                 py-2
  37.                 inline-flex
  38.                 items-center
  39.                 justify-center
  40.                 md:text-base
  41.                 text-sm
  42.                 group
  43.                 font-semibold
  44.                 transition-all
  45.                 duration-500
  46.                 relative
  47.                 overflow-hidden
  48.                 after:content=['']
  49.                 after:w-0
  50.                 after:h-full
  51.                 after:absolute
  52.                 after:block
  53.                 after:inset-0
  54.                 hover:after:w-full
  55.                 after:transition-all
  56.                 after:duration-500
  57.                 after:bg-brand
  58.                 after:text-white
  59.               "
  60.             >
  61.               <span class="z-10 group-hover:text-white text-brand transition-all duration-700">
  62.                 Read More
  63.               </span>
  64.             </a>
  65.           </div>
  66.         </div>
  67.       </div>
  68.     </div>
  69.   </section>
  70.   <section class="bg-white px-6 py-24 mx-auto bg-[#fafaf3]">
  71.     <div class="grid md:grid-cols-2 lg:grid-cols-3 gap-10 py-8 lg:px-6">
  72.       {% for page in pagination.items|slice(1) %}
  73.         {{
  74.             article.post(
  75.               page.title,
  76.               page.description,
  77.               page.updated,
  78.               asset('/images/news-' ~ (loop.index + 1) ~ '.jpeg'),
  79.               page.urlTitle
  80.             )
  81.           }}
  82.       {% endfor %}
  83.     </div>
  84.   </section>
  85.     <div class="w-full flex items-center justify-center">
  86.       {{ knp_pagination_render(pagination) }}
  87.     </div>
  88. {% endblock %}