<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;

/* articles/latest */
class __TwigTemplate_b3fa4f440b123ba75023f1858700f5823a3b3ce688f3775bdb93d918eccf9b1d extends Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->blocks = [
            'content' => [$this, 'block_content'],
        ];
    }

    protected function doGetParent(array $context)
    {
        // line 1
        return "layouts/_main";
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        craft\helpers\Template::beginProfile("template", "articles/latest");
        $this->parent = $this->loadTemplate("layouts/_main", "articles/latest", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
        craft\helpers\Template::endProfile("template", "articles/latest");
    }

    // line 4
    public function block_content($context, array $blocks = [])
    {
        $macros = $this->macros;
        craft\helpers\Template::beginProfile("block", "content");
        // line 5
        echo "  <div class=\"container first-container\"> 
    <div class=\"container mt-4\">
      <div class=\"row mb-2 align-items-center\">
        <div class=\"col-lg-6 text-center mx-auto\">
          <h2 class=\"font-weight-bold text-primary heading\">
              Latest Articles 
          </h2>
        </div>
      </div>
    </div>

    <section class='my-5'>

          ";
        // line 18
        $context["articles"] = craft\helpers\Template::attribute($this->env, $this->source, craft\helpers\Template::attribute($this->env, $this->source, craft\helpers\Template::attribute($this->env, $this->source, craft\helpers\Template::attribute($this->env, $this->source, (isset($context["craft"]) || array_key_exists("craft", $context) ? $context["craft"] : (function () { throw new RuntimeError('Variable "craft" does not exist.', 18, $this->source); })()), "entries", []), "section", [0 => "articles"], "method"), "status", [0 => [0 => "live"]], "method"), "limit", [0 => 15], "method");
        // line 19
        echo "          
          ";
        // line 20
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["articles"]) || array_key_exists("articles", $context) ? $context["articles"] : (function () { throw new RuntimeError('Variable "articles" does not exist.', 20, $this->source); })()));
        foreach ($context['_seq'] as $context["_key"] => $context["article"]) {
            // line 21
            echo "          <div class=\"card\">
            <div class=\"card-body\">
              <div class=\"row\">
                <div class=\"col-4\">
                  ";
            // line 25
            $context["imgUrl"] = craft\helpers\Template::attribute($this->env, $this->source, craft\helpers\Template::attribute($this->env, $this->source, craft\helpers\Template::attribute($this->env, $this->source, $context["article"], "mainImage", []), "one", [], "method"), "getUrl", [], "method");
            // line 26
            echo "                  
                  ";
            // line 27
            if ((isset($context["imgUrl"]) || array_key_exists("imgUrl", $context) ? $context["imgUrl"] : (function () { throw new RuntimeError('Variable "imgUrl" does not exist.', 27, $this->source); })())) {
                // line 28
                echo "                    <div class=\"p-2\"><img src=\"";
                echo twig_escape_filter($this->env, (isset($context["imgUrl"]) || array_key_exists("imgUrl", $context) ? $context["imgUrl"] : (function () { throw new RuntimeError('Variable "imgUrl" does not exist.', 28, $this->source); })()), "html", null, true);
                echo "\" class=\"img-fluid\"></div>
                  ";
            }
            // line 30
            echo "                </div>
                <div class=\"col-8\">
                  <a href=\"";
            // line 32
            echo twig_escape_filter($this->env, craft\helpers\Template::attribute($this->env, $this->source, $context["article"], "slug", []), "html", null, true);
            echo "\" class=\"h4\">
                  ";
            // line 33
            echo twig_escape_filter($this->env, craft\helpers\Template::attribute($this->env, $this->source, $context["article"], "title", []), "html", null, true);
            echo "</a>
                  <div class=\"small text-muted mb-2\">";
            // line 34
            echo twig_escape_filter($this->env, $this->extensions['craft\web\twig\Extension']->dateFilter($this->env, craft\helpers\Template::attribute($this->env, $this->source, $context["article"], "postDate", []), "j M Y"), "html", null, true);
            echo "</div>
                  ";
            // line 35
            echo twig_escape_filter($this->env, $this->extensions['craft\web\twig\Extension']->truncateFilter(twig_striptags(craft\helpers\Template::attribute($this->env, $this->source, $context["article"], "mainText", [])), 1000), "html", null, true);
            echo "
                </div>
              </div>
            </div>
          </div>
          ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['article'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 40
        echo "          
    </section>

  </div>
";
        craft\helpers\Template::endProfile("block", "content");
    }

    public function getTemplateName()
    {
        return "articles/latest";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  124 => 40,  112 => 35,  108 => 34,  104 => 33,  100 => 32,  96 => 30,  90 => 28,  88 => 27,  85 => 26,  83 => 25,  77 => 21,  73 => 20,  70 => 19,  68 => 18,  53 => 5,  48 => 4,  35 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("{% extends 'layouts/_main' %}


{% block content %}
  <div class=\"container first-container\"> 
    <div class=\"container mt-4\">
      <div class=\"row mb-2 align-items-center\">
        <div class=\"col-lg-6 text-center mx-auto\">
          <h2 class=\"font-weight-bold text-primary heading\">
              Latest Articles 
          </h2>
        </div>
      </div>
    </div>

    <section class='my-5'>

          {% set articles = craft.entries.section('articles').status(['live']).limit(15) %}
          
          {% for article in articles %}
          <div class=\"card\">
            <div class=\"card-body\">
              <div class=\"row\">
                <div class=\"col-4\">
                  {% set imgUrl = article.mainImage.one().getUrl() %}
                  
                  {% if imgUrl %}
                    <div class=\"p-2\"><img src=\"{{imgUrl}}\" class=\"img-fluid\"></div>
                  {% endif %}
                </div>
                <div class=\"col-8\">
                  <a href=\"{{ article.slug }}\" class=\"h4\">
                  {{article.title}}</a>
                  <div class=\"small text-muted mb-2\">{{ article.postDate | date('j M Y') }}</div>
                  {{ article.mainText | striptags | truncate(1000) }}
                </div>
              </div>
            </div>
          </div>
          {% endfor %}          
    </section>

  </div>
{% endblock %}", "articles/latest", "/home/addons/atweb.space/sub/craft-demo/cms/templates/articles/latest.twig");
    }
}
