{% import 'gallery_macros.jinja' as gallery_macros %}

<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

  <meta property="og:title" content="{{ gallery_config['title']}}">
  <meta property="og:description" content="{{ gallery_config['description'] }}">
  <meta property="og:image" content="{{ gallery_config['url'] }}/images/photos/{{ background_photo }}">
  <meta property="og:url" content="{{ gallery_config['url'] }}">
  <meta property="og:site_name" content="{{ gallery_config['title']}}">

  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:image:alt" content="{{ gallery_config['title']}}">

  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
  <link rel="stylesheet" href="css/photoswipe.css">
  <link rel="stylesheet" href="css/default-skin.css">
  <link rel="stylesheet" href="css/main.css">

  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200&display=swap" rel="stylesheet">

  <title>{{ gallery_config['title']}}</title>

  {# These definitions are pulled out of the .css file here, so that the background image can be templated. #}
  <style>
    .header-image {
      background: #333366 url("images/photos/{{ background_photo }}");
      background-position: center {{ gallery_config['background_photo_offset'] }}%;
      background-repeat: no-repeat;
      background-size: cover;
    }
  </style>
</head>

<body>

  <div class="jumbotron header-image">
    <div class="header-info">
      <h1>{{ gallery_config['title'] }}</h1>
      <div class="header-info-details">{{ gallery_config['description'] }}</div>
    </div>
  </div>


  <!-- GALLERY DESCRIPTIONS -->

  {{ gallery_macros.section(0, images|length,
                              gallery_config['title'],
                              '',
                              images)}}

  <!-- END GALLERY DESCRIPTIONS -->


  <div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="pswp__bg"></div>
    <div class="pswp__scroll-wrap">
      <div class="pswp__container">
        <div class="pswp__item"></div>
        <div class="pswp__item"></div>
        <div class="pswp__item"></div>
      </div>

      <div class="pswp__ui pswp__ui--hidden">
        <div class="pswp__top-bar">
          <div class="pswp__counter"></div>
          <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
          <button class="pswp__button pswp__button--share" title="Share"></button>
          <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
          <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

          <div class="pswp__preloader">
            <div class="pswp__preloader__icn">
              <div class="pswp__preloader__cut">
                <div class="pswp__preloader__donut"></div>
              </div>
            </div>
          </div>
        </div>

        <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
          <div class="pswp__share-tooltip"></div>
        </div>

        <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)"></button>
        <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)"></button>

        <div class="pswp__caption">
          <div class="pswp__caption__center"></div>
        </div>
      </div>
    </div>
  </div>

  <footer class="container-fluid text-right">
    {% if 'link' in remote_data %}
      <p>The images in this gallery are hosted in a <a href="{{ remote_data['link'] }}">{{ remote_data['text'] }}</a></p>
    {% endif %}
    <p>Created by <a rel="noreferrer" href="https://www.haltakov.net/simple-photo-gallery">Simple Photo Gallery</a></p>
  </footer>

  <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
  <script src="js/photoswipe.min.js"></script>
  <script src="js/photoswipe-ui-default.min.js"></script>
  <script src="js/main.js"></script>
</body>

</html>