header.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!-- TODO this file has become a mess, refactor it -->
  2. {% assign date_format = site.date_format | default: "%B %-d, %Y" %}
  3. {% if page.cover-img or page.title %}
  4. {% if page.cover-img %}
  5. <div id="header-big-imgs" data-num-img={% if page.cover-img.first %}{{ page.cover-img.size }}{% else %}1{% endif %}
  6. {% for bigimg in page.cover-img %}
  7. {% assign imgnum = forloop.index %}
  8. {% for imginfo in bigimg %}
  9. {% if imginfo[0] %}
  10. data-img-src-{{ imgnum }}="{{ imginfo[0] | absolute_url }}"
  11. data-img-desc-{{ imgnum }}="{{ imginfo[1] }}"
  12. {% else %}
  13. data-img-src-{{ imgnum }}="{{ imginfo | absolute_url }}"
  14. {% endif %}
  15. {% endfor %}
  16. {% endfor %}
  17. ></div>
  18. {% endif %}
  19. <header class="header-section {% if page.cover-img %}has-img{% endif %}">
  20. {% if page.cover-img %}
  21. <div class="big-img intro-header">
  22. <div class="container-md">
  23. <div class="row">
  24. <div class="col-xl-8 offset-xl-2 col-lg-10 offset-lg-1">
  25. <div class="{{ include.type }}-heading">
  26. <h1>{% if page.title %}{{ page.title }}{% else %}<br/>{% endif %}</h1>
  27. {% if page.subtitle %}
  28. {% if include.type == "page" %}
  29. <hr class="small">
  30. <span class="{{ include.type }}-subheading">{{ page.subtitle }}</span>
  31. {% else %}
  32. <h2 class="{{ include.type }}-subheading">{{ page.subtitle }}</h2>
  33. {% endif %}
  34. {% endif %}
  35. {% if include.type == "post" %}
  36. <span class="post-meta">Posted on {{ page.date | date: date_format }}</span>
  37. {% if page.readtime %}
  38. {% include readtime.html %}
  39. {% endif %}
  40. {% endif %}
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <span class='img-desc'></span>
  46. </div>
  47. {% endif %}
  48. <div class="intro-header no-img">
  49. <div class="container-md">
  50. <div class="row">
  51. <div class="col-xl-8 offset-xl-2 col-lg-10 offset-lg-1">
  52. <div class="{{ include.type }}-heading">
  53. <h1>{% if page.title %}{{ page.title }}{% else %}<br/>{% endif %}</h1>
  54. {% if page.subtitle %}
  55. {% if include.type == "page" %}
  56. <hr class="small">
  57. <span class="{{ include.type }}-subheading">{{ page.subtitle }}</span>
  58. {% else %}
  59. <h2 class="{{ include.type }}-subheading">{{ page.subtitle }}</h2>
  60. {% endif %}
  61. {% endif %}
  62. {% if include.type == "post" %}
  63. <span class="post-meta">Posted on {{ page.date | date: date_format }}</span>
  64. {% if page.readtime %}
  65. {% include readtime.html %}
  66. {% endif %}
  67. {% endif %}
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </header>
  74. {% else %}
  75. <div class="intro-header"></div>
  76. {% endif %}