1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <header>
- <nav class="navbar navbar-expand-lg navbar-dark p-0">
- <div class="container-fluid p-0">
- <div class="mx-auto">
- <a class="navbar-brand home" href="/">
- {{ if default false .Site.Params.disabled_logo }}
- <h4>{{ .Site.Params.logo_text }}</h4>
- {{ else }}
- <img src="{{ .Site.Params.logo_mobile | relURL }}" alt="{{ .Title }} logo" height="70px" alt="" />
- {{ end }}
- <span class="sr-only">{{ .Title }} - {{ i18n "navHome" }}</span>
- </a>
- </div>
- <button onclick="changeIcon(this)" class="navbar-toggler" type="button" data-bs-toggle="collapse"
- data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
- aria-label="Toggle navigation">
- <span data-toggle-class="icon" class="navbar-toggler-icon"></span>
- </button>
- <div class="collapse navbar-collapse" id="navbarSupportedContent">
- <ul class="navbar-nav align-items-lg-center mx-auto mb-2 mb-lg-0">
- <li class="navbar-logo">
- <a href="/">
- {{ if default false .Site.Params.disabled_logo }}
- <h4>{{ .Site.Params.logo_text }}</h4>
- {{ else }}
- <img src="{{ .Site.Params.logo | relURL }}" alt="{{ .Title }} logo" height="50px" alt=""
- style="image-rendering: -webkit-optimize-contrast;" />
- {{ end }}
- <span class="sr-only">{{ .Title }} - {{ i18n "navHome" }}</span>
- </a>
- </li>
- {{ $current := . }}
- {{ range .Site.Menus.main.ByWeight }}
- {{ $topLevel := replace .URL "/" "" }}
- {{ $active := "" }}
- {{ if eq $current.RelPermalink .URL }}
- {{ $active = "active" }}
- {{ end }}
- {{ if eq $current.Type $topLevel }}
- {{ $active = "active" }}
- {{ end }}
- {{ if and (or (eq $current.RelPermalink .URL) (eq "term" $current.Kind)) (in (slice "page" "term")
- $current.Kind) }}
- {{ range (split .URL "/") }}
- {{ if eq "blog" . }}
- {{ $active = "active" }}
- {{ end }}
- {{ end }}
- {{ end }}
- <li class="nav-item {{ $active }}">
- <a class="navbar-link" href="{{ .URL }}">{{ .Name }}</a>
- </li>
- {{ end }}
- <!-- <li class="">
- <a class="navbar-link" href="/collection.html">成家故事作品集</a>
- </li>
- <li class="nav-item">
- <a class="navbar-link" href="/room_planner.html">成家設計服務</a>
- </li>
- <li class="nav-item">
- <a class="navbar-link" href="/frequently_asked_questions.html">服務常見QA</a>
- </li>
- <li class="nav-item">
- <a class="navbar-link" href="/categories.html">成家知識專欄</a>
- </li>
- <li class="nav-item">
- <a class="navbar-link" href="/furniture_design.html">小寶設計單品</a>
- </li>
- <li class="nav-item">
- <a class="navbar-link" href="/store.html">小寶優居門市</a>
- </li> -->
- </ul>
- </div>
- </div>
- </nav>
- </header>
- <script>
- // Navbar Icon
- function changeIcon(e) {
- const item = document.querySelector('[data-toggle-class]');
- item.className === "close-btn" ? item.className = "navbar-toggler-icon" : item.className = "close-btn";
- }
- </script>
- <!-- *** NAVBAR END ***-->
|