diff options
author | Chip Senkbeil <chip.senkbeil@gmail.com> | 2015-10-01 05:29:03 +0300 |
---|---|---|
committer | Chip Senkbeil <chip.senkbeil@gmail.com> | 2015-10-01 05:29:03 +0300 |
commit | 519bdcc5d7ca6c9ff51268d6a1134082e4488b60 (patch) | |
tree | 5c08cac5132ab257bac3a605c5a580763aa4f8eb | |
parent | 56675bc3f98949480bc56b7202ca7de4dff3ff6a (diff) |
Fixed bad example site where base url not set - note, forced to remove some partials due to limitations
-rw-r--r-- | exampleSite/config.toml | 2 | ||||
-rw-r--r-- | layouts/partials/extra/categories.html | 3 | ||||
-rw-r--r-- | layouts/partials/extra/pagination.html | 7 | ||||
-rw-r--r-- | layouts/partials/extra/tags.html | 3 | ||||
-rw-r--r-- | layouts/partials/extra/video.html | 13 | ||||
-rw-r--r-- | layouts/partials/homepage/cell.html | 39 | ||||
-rw-r--r-- | layouts/partials/homepage/header-scrolling.html | 14 | ||||
-rw-r--r-- | layouts/partials/homepage/single.html | 57 | ||||
-rw-r--r-- | layouts/partials/post/page-item.html | 3 | ||||
-rw-r--r-- | layouts/partials/project/item.html | 4 |
10 files changed, 75 insertions, 70 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index b9d17b0..45224fb 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -1,4 +1,4 @@ -# Site settings +# Site settings (baseurl must end with a trailing slash!) baseurl = "http://replace-this-with-your-hugo-site.com/" languageCode = "en-us" title = "Grid Side" diff --git a/layouts/partials/extra/categories.html b/layouts/partials/extra/categories.html index 78007f9..4b6349b 100644 --- a/layouts/partials/extra/categories.html +++ b/layouts/partials/extra/categories.html @@ -1,9 +1,10 @@ +{{ $baseUrl := .Site.BaseURL }} <ul class="categories"> <li> <i class="fa fa-book"></i> </li> {{ range .Params.categories }} - <li><a href="/categories/{{ . | urlize }}">{{ . }}</a></li> + <li><a href="{{ $baseUrl }}categories/{{ . | urlize }}">{{ . }}</a></li> {{ end }} </ul> diff --git a/layouts/partials/extra/pagination.html b/layouts/partials/extra/pagination.html index 2fa4a82..23d92ba 100644 --- a/layouts/partials/extra/pagination.html +++ b/layouts/partials/extra/pagination.html @@ -1,19 +1,20 @@ +{{ $baseUrl := .Site.BaseURL }} {{ if .IsNode }} <ul class="pagination"> {{ with .Paginator }} <li class="{{ if .HasPrev }}waves-effect{{ else }}disabled{{ end }}"> - <a href="{{ if .HasPrev }}{{ .Prev.URL }}{{ else }}#!{{ end }}"> + <a href="{{ if .HasPrev }}{{ $baseUrl }}{{ .Prev.URL }}{{ else }}#!{{ end }}"> <i class="fa fa-angle-left"></i> </a> </li> {{ $currentPageNumber := .PageNumber }} {{ range .Pagers }} <li class="{{ if eq $currentPageNumber .PageNumber }}active{{ else }}waves-effect{{ end }}"> - <a href="{{ .URL }}">{{ .PageNumber }}</a> + <a href="{{ $baseUrl }}{{ .URL }}">{{ .PageNumber }}</a> </li> {{ end }} <li class="{{ if .HasNext }}waves-effect{{ else }}disabled{{ end }}"> - <a href="{{ if .HasNext }}{{ .Next.URL }}{{ else }}#!{{ end }}"> + <a href="{{ if .HasNext }}{{ $baseUrl }}{{ .Next.URL }}{{ else }}#!{{ end }}"> <i class="fa fa-angle-right"></i> </a> </li> diff --git a/layouts/partials/extra/tags.html b/layouts/partials/extra/tags.html index cd79d5d..a53fea9 100644 --- a/layouts/partials/extra/tags.html +++ b/layouts/partials/extra/tags.html @@ -1,9 +1,10 @@ +{{ $baseUrl := .Site.BaseURL }} <ul class="tags"> <li> <i class="fa fa-tags"></i> </li> {{ range .Params.tags }} - <li><a href="/tags/{{ . | urlize }}">{{ . }}</a></li> + <li><a href="{{ $baseUrl }}tags/{{ . | urlize }}">{{ . }}</a></li> {{ end }} </ul> diff --git a/layouts/partials/extra/video.html b/layouts/partials/extra/video.html index 75629f2..8c59d36 100644 --- a/layouts/partials/extra/video.html +++ b/layouts/partials/extra/video.html @@ -1,18 +1,19 @@ -<video preload="auto" autoplay loop muted {{ with .Params.video_fallback }}poster="{{ . }}"{{ end }} class="{{ .Scratch.Get "class" }}"> +{{ $baseUrl := .Site.BaseURL }} +<video preload="auto" autoplay loop muted {{ with .Params.video_fallback }}poster="{{ $baseUrl }}{{ . }}"{{ end }} class="{{ .Scratch.Get "class" }}"> {{ with .Params.video_webm }} - <source src="{{ . }}" type='video/webm; codecs="vp8.0, vorbis"'> + <source src="{{ $baseUrl }}{{ . }}" type='video/webm; codecs="vp8.0, vorbis"'> {{ end }} {{ with .Params.video_ogv }} - <source src="{{ . }}" type='video/ogg; codecs="theora, vorbis"'> + <source src="{{ $baseUrl }}{{ . }}" type='video/ogg; codecs="theora, vorbis"'> {{ end }} {{ with .Params.video_mp4 }} - <source src="{{ . }}" type='video/mp4; codecs="avc1.4D401E, mp4a.40.2"'> + <source src="{{ $baseUrl }}{{ . }}" type='video/mp4; codecs="avc1.4D401E, mp4a.40.2"'> {{ end }} {{ with .Params.video_3gp }} - <source src="{{ . }}" type='video/3gp'> + <source src="{{ $baseUrl }}{{ . }}" type='video/3gp'> {{ end }} {{ with .Params.video_fallback }} - <img src="{{ . }}"> + <img src="{{ $baseUrl }}{{ . }}"> {{ end }} </video> diff --git a/layouts/partials/homepage/cell.html b/layouts/partials/homepage/cell.html deleted file mode 100644 index bca321e..0000000 --- a/layouts/partials/homepage/cell.html +++ /dev/null @@ -1,39 +0,0 @@ -<a href="{{ if .disable }}#!{{ else }}{{ .link }}{{ end }}" class="flex-item"> - <div class="cell - fill-container - no-padding - {{ if or .grayscale .disable }}grayscale{{ end }} - {{ if .disable }}no-change-on-hover{{ end }} - {{ if .image }}fullsize-background-image{{ end }} - " style=" - {{ with .image }} - background-image: url({{ . }}); - {{ else }} - background-color: {{ .color }}; - {{ end }} - - {{ with .image_position }} - background-position: {{ . }}; - {{ end }} - - height: {{ with .height }} - {{ . }} - {{ else }} - 33.33vh - {{ end }}; - "> - <!-- Show text permanently --> - {{ if eq .always_show_text true }} - <div class="center-items center-text fill-container black-overlay"> - <h3 class="white-text">{{ .name }}</h3> - </div> - {{ end }} - - {{ if not (or (eq .no_highlight true) .disable) }} - <div class="highlight-block"> - <h3 class="white-text">{{ .name }}</h3> - </div> - {{ end }} - </div> -</a> - diff --git a/layouts/partials/homepage/header-scrolling.html b/layouts/partials/homepage/header-scrolling.html deleted file mode 100644 index 401d9bb..0000000 --- a/layouts/partials/homepage/header-scrolling.html +++ /dev/null @@ -1,14 +0,0 @@ -<!-- NOTE: Must be at root level for firefox to work (cannot wrap in header) --> -<div class="parallax__group"> - <div class="parallax__layer parallax__layer--base"> - {{ partial "homepage/header-logo.html" . }} - </div> - <div class="parallax__layer parallax__layer--back {{ if .image }}fullsize-background-image{{ end }}" - {{ if .image }} - style="background-image: url('{{ .image }}'); {{ with .image_position }}background-position: {{ . }};{{ end }}" - {{ else }} - style="background-color: {{ .color }}" - {{ end }} - ></div> -</div> - diff --git a/layouts/partials/homepage/single.html b/layouts/partials/homepage/single.html index 01567b0..a6fb8da 100644 --- a/layouts/partials/homepage/single.html +++ b/layouts/partials/homepage/single.html @@ -2,10 +2,23 @@ {{ partial "core/head.html" . }} +{{ $baseUrl := .Site.BaseURL }} <body class="page-colors"> <div class="parallax"> {{ with .Site.Params.Header }} - {{ partial "homepage/header-scrolling.html" . }} + <!-- NOTE: Must be at root level for firefox to work (cannot wrap in header) --> + <div class="parallax__group"> + <div class="parallax__layer parallax__layer--base"> + {{ partial "homepage/header-logo.html" . }} + </div> + <div class="parallax__layer parallax__layer--back {{ if .image }}fullsize-background-image{{ end }}" + {{ if .image }} + style="background-image: url('{{ $baseUrl }}{{ .image }}'); {{ with .image_position }}background-position: {{ . }};{{ end }}" + {{ else }} + style="background-color: {{ .color }}" + {{ end }} + ></div> + </div> {{ end }} <div class="parallax__group parallax__group--auto-height"> @@ -21,7 +34,47 @@ <div class="flex-container"> {{ range .Site.Params.Cells.List }} - {{ partial "homepage/cell.html" . }} + <!-- + Note: The link and contents must be here since we + cannot pass .Site.BaseURL as part of the context + --> + <a href="{{ if .disable }}#!{{ else }}{{ $baseUrl }}{{ .link }}{{ end }}" class="flex-item"> + <div class="cell + fill-container + no-padding + {{ if or .grayscale .disable }}grayscale{{ end }} + {{ if .disable }}no-change-on-hover{{ end }} + {{ if .image}}fullsize-background-image{{ end }} + " style=" + {{ with .image }} + background-image: url('{{ $baseUrl }}{{ . }}'); + {{ else }} + background-color: {{ .color }}; + {{ end }} + + {{ with .image_position }} + background-position: {{ . }}; + {{ end }} + height: {{ with .height }} + {{ . }} + {{ else }} + 33.33vh + {{ end }}; + "> + <!-- Show text permanently --> + {{ if eq .always_show_text true }} + <div class="center-items center-text fill-container black-overlay"> + <h3 class="white-text">{{ .name }}</h3> + </div> + {{ end }} + + {{ if not (or (eq .no_highlight true) .disable) }} + <div class="highlight-block"> + <h3 class="white-text">{{ .name }}</h3> + </div> + {{ end }} + </div> + </a> {{ end }} </div> diff --git a/layouts/partials/post/page-item.html b/layouts/partials/post/page-item.html index 3aac325..5062595 100644 --- a/layouts/partials/post/page-item.html +++ b/layouts/partials/post/page-item.html @@ -1,6 +1,7 @@ +{{ $baseUrl := .Site.BaseURL }} <div class="page-item-container"> {{ with .Params.image }} - <img src="{{ . }}" class="page-item-image"></img> + <img src="{{ $baseUrl }}{{ . }}" class="page-item-image"></img> {{ end }} <div class="page-item-content"> <header> diff --git a/layouts/partials/project/item.html b/layouts/partials/project/item.html index c63152b..3aa52ca 100644 --- a/layouts/partials/project/item.html +++ b/layouts/partials/project/item.html @@ -1,5 +1,5 @@ -{{ $url := $.Site.BaseURL }} +{{ $baseUrl := $.Site.BaseURL }} {{ if isset .Params "image" }} {{ $.Scratch.Set "image" .Params.image }} {{ else }} @@ -20,7 +20,7 @@ {{ .Scratch.Set "class" "rounded-corners-top fill-container-width" }} {{ partial "extra/video.html" . }} {{ else }} - <img src="{{ $image }}" class="fill-container-width rounded-corners-top" /> + <img src="{{ $baseUrl }}{{ $image }}" class="fill-container-width rounded-corners-top" /> {{ end }} </div> <div class="rounded-corners-bottom center-text project-container-title"> |