diff --git a/layouts/index.html b/layouts/index.html
index c324436..4a2dfca 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -56,10 +56,10 @@
{{ range sort $pages "Params.weight" }}
{{ if ne .Name "contact.md" }}
{{ if .File }}
- {{ if eq .File.Dir "projects/" }}
+ {{ if eq (os.Stat .File.Dir).Name "projects" }}
{{ partial "home/projects.html" . }}
- {{ else if eq .File.Dir "blog/" }}
+ {{ else if eq (os.Stat .File.Dir).Name "blog" }}
{{ partial "home/blog.html" . }}
{{ else }}
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
index 96c841f..58b5e3e 100644
--- a/layouts/partials/nav.html
+++ b/layouts/partials/nav.html
@@ -53,7 +53,7 @@
{{ range sort $pages "Params.weight" }}
{{ if ne .Name "contact.md" }}
- {{ if eq .File.Dir "projects/" }}
+ {{ if eq (os.Stat .File.Dir).Name "projects" }}
{{ if $isHome }}
{{ .Title }}
@@ -69,7 +69,7 @@
{{ end }}
{{ end }}
- {{ else if eq .File.Dir "blog/" }}
+ {{ else if eq (os.Stat .File.Dir).Name "blog" }}
{{ if $isHome }}
{{ .Title }}