_header.liquid 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <header>
  2. <nav class="navbar navbar-expand-lg navbar-dark bg-orange">
  3. <div class="container">
  4. {% if site.dist.logo %}
  5. <a class="header-logo position-absolute start-0 translate-middle-y" style="top:50%; z-index: 1000" href="/"><img src="{{ site.image_base_url }}{{ site.dist.logo }}" height="115px"></a>
  6. {% endif %}
  7. <div class="navbar-toggler-container position-absolute ">
  8. <button class="navbar-toggler " type="button"
  9. data-bs-toggle="collapse"
  10. data-bs-target="#navbarNav"
  11. aria-controls="navbarNav"
  12. aria-expanded="false"
  13. aria-label="切换导航">
  14. <span class="navbar-toggler-icon"></span>
  15. </button>
  16. </div>
  17. <div class="collapse navbar-collapse" id="navbarNav">
  18. <ul class="navbar-nav">
  19. {% for menu in site.menus_header %}
  20. <li class="nav-item {% if menu.children and menu.children.size > 0 %}dropdown{% endif %}">
  21. {% if menu.children and menu.children.size > 0 %}
  22. <a class="nav-link dropdown-toggle" id="protetoresTelasDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false" href="{% if menu.children and menu.children.size > 0 %}#{% else %}{{ menu.uri }}{% endif %}">
  23. {{ menu.title }}
  24. </a>
  25. {% else %}
  26. <a class="nav-link" href="{% if menu.children and menu.children.size > 0 %}#{% else %}{{ menu.uri }}{% endif %}">
  27. {{ menu.title }}
  28. </a>
  29. {% endif %}
  30. {% if menu.children and menu.children.size > 0 %}
  31. <ul class="dropdown-menu w-100 p-0">
  32. <div class="container py-3" style="max-width: 90%; margin: 0 auto;">
  33. <div class="row g-4">
  34. {% for child in menu.children %}
  35. <div class="col-4">
  36. <div class="d-flex align-items-start">
  37. <div class="flex-shrink-0">
  38. {% if child.image_url %}
  39. <img src="{{ site.asset_base_url }}{{ child.image_url }}"
  40. class="img-fluid rounded"
  41. style="width: 100%; height: 100%; object-fit: cover;">
  42. {% else %}
  43. <img src="{{ site.asset_base_url }}static/tpl/screen_protector_solutions/image/product_default.jpg"
  44. class="img-fluid rounded"
  45. style="width: 100%; height: 100%; object-fit: cover;">
  46. {% endif %}
  47. </div>
  48. <div class="flex-grow-1 ms-3">
  49. <h6 class="mb-2 fw-bold"><a href="{{ child.uri }}" class="text-decoration-none text-reset">{{ child.title }}</a></h6>
  50. <div class="d-flex flex-column">
  51. {% for item in child.children %}
  52. <a href="{{ item.uri }}" class="text-decoration-none text-reset mb-1 small">{{ item.title }}</a>
  53. {% endfor %}
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. {% endfor %}
  59. </div>
  60. </div>
  61. </ul>
  62. {% endif %}
  63. </li>
  64. {% endfor %}
  65. </ul>
  66. </div>
  67. </div>
  68. </nav>
  69. </header>