I’m fairly new to using Netlify for deployments and well deployments in general.
I’m building my portfolio using Hugo and everything is working just fine locally. I’ve added the bootstrap library and a few NPM packages which I’ve removed from my commit’s to Git. Everything has been properly initialized, however when I build locally and view on localhost:1313/ my hamburger expands and collapses just fine. Looking at my site live, not so much. Clicking on the hamburger icon produces no console error, it really does nothing and I’m inclined to believe that its a problem between my deployment and live sight - either something is being omitted in the deployment or I’m missing something.
If code helps here’s what my navigation bar looks like:
{{ $isHome := .Page.IsHome }}
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria- controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
{{ if not $isHome }}
<li class="nav-item">
<a class="nav-link" href="{{ "" | relLangURL }}">{{ i18n "nav_main" . }}</a>
</li>
{{ end }}
{{ with .Site.GetPage "/home" }}
{{ $pages := .Resources.ByType "page" }}
{{ with .Site.GetPage "/blog" }}
{{ $pages = $pages | append . }}
{{ end }}
{{ with .Site.GetPage "/projects" }}
{{ $pages = $pages | append . }}
{{ end }}
{{ range sort $pages "Params.weight" }}
{{ if ne .Name "contact.md" }}
{{ if eq (os.Stat .File.Dir).Name "projects" }}
<li class="nav-item">
{{ if $isHome }}
<a class="nav-link" href="{{ printf "#%s" ( .Title | urlize) | relLangURL }}">>{{ .Title | markdownify }}</a>
{{ else }}
{{ $pageIsInProjects := eq $.Page.Section "projects"}}
{{ if not (and $pageIsInProjects (eq $.Page.Kind "section")) }}
<a class="nav-link" href="{{ .Permalink }}">
{{ if $pageIsInProjects }}
{{ i18n "nav_backToSection" . }}
{{ else }}
<!-- fix-224 -->
{{ .Title }}
<!-- end fix-224 -->
{{ end }}
</a>
{{ end }}
{{ end }}
</li>
{{ else if eq (os.Stat .File.Dir).Name "blog" }}
<li class="nav-item">
{{if $isHome }}
<a class="nav-link" href="{{ printf "#%s" ( .Title | urlize) | relLangURL }}">{{ .Title | markdownify }}</a>
{{ else }}
{{ $pageIsInBlog := eq $.Page.Section "blog"}}
{{ if not (and $pageIsInBlog (eq $.Page.Kind "section")) }}
<a class="nav-link" href="{{ .Permalink }}">
{{ if $pageIsInBlog }}
{{ i18n "nav_backToSection" . }}
{{ else }}
{{ .Title | singularize}}
{{ end }}
</a>
{{ end }}
{{ end }}
{{else}}
<a class="nav-link" href="{{ if $isHome }}#{{ .File.TranslationBaseName }}{{ else }}{{ printf "#%s" (.File.TranslationBaseName | urlize) | relLangURL }}{{ end }}">{{ .Title | markdownify }}</a>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</li>
</ul>
</div>
</nav>
I’ve crossposted this to stackoverflow and netlifys deployment community. Just trying to find some answers.
Thanks!