header.html 2.3 KB

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