diff options
author | Pablo Martin Viva <pmviva@gmail.com> | 2018-04-08 07:22:34 +0300 |
---|---|---|
committer | Pablo Martin Viva <pmviva@gmail.com> | 2018-04-08 07:22:34 +0300 |
commit | 11d409bed6dc0e37af0acd83c9f7e7cb14e9cc75 (patch) | |
tree | d2230d22a1caa8ab22ded5a5f29ae8f21e9df80b | |
parent | f42bb2af7ad9ceb4b68bc47af8e95f0d275afc6e (diff) |
Multilingual support, fixed issues with URLs that didn't need absLangURL / relLangURL
25 files changed, 77 insertions, 20 deletions
diff --git a/exampleSite/content/post/post.1.md b/exampleSite/content/post/post.1.en.md index 0a70435..0a70435 100644 --- a/exampleSite/content/post/post.1.md +++ b/exampleSite/content/post/post.1.en.md diff --git a/exampleSite/content/post/post.1.es.md b/exampleSite/content/post/post.1.es.md new file mode 100644 index 0000000..99591e5 --- /dev/null +++ b/exampleSite/content/post/post.1.es.md @@ -0,0 +1,7 @@ ++++ +title = 'Primis eget imperdiet lorem - Versión Español' +slug = 'post1' +image = 'images/pic03.jpg' +date = "2017-04-22T00:00:00" +description = 'Donec eget ex magna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis magna etiam.' ++++ diff --git a/exampleSite/content/post/post.2.md b/exampleSite/content/post/post.2.en.md index a3c9972..a3c9972 100644 --- a/exampleSite/content/post/post.2.md +++ b/exampleSite/content/post/post.2.en.md diff --git a/exampleSite/content/post/post.2.es.md b/exampleSite/content/post/post.2.es.md new file mode 100644 index 0000000..fda80b1 --- /dev/null +++ b/exampleSite/content/post/post.2.es.md @@ -0,0 +1,7 @@ ++++ +title = 'Ante mattis interdum dolor - Versión Español' +slug = 'post2' +image = 'images/pic04.jpg' +date = "2017-04-18T00:00:00" +description = 'Donec eget ex magna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis magna etiam.' ++++ diff --git a/exampleSite/content/post/post.3.md b/exampleSite/content/post/post.3.en.md index b38eda0..b38eda0 100644 --- a/exampleSite/content/post/post.3.md +++ b/exampleSite/content/post/post.3.en.md diff --git a/exampleSite/content/post/post.3.es.md b/exampleSite/content/post/post.3.es.md new file mode 100644 index 0000000..9c3b9d0 --- /dev/null +++ b/exampleSite/content/post/post.3.es.md @@ -0,0 +1,7 @@ ++++ +title = 'Augue lorem primis vestibulum - Versión Español' +slug = 'post3' +image = 'images/pic07.jpg' +date = "2017-04-07T00:00:00" +description = 'Donec eget ex magna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis magna etiam.' ++++ diff --git a/exampleSite/content/post/post.6.md b/exampleSite/content/post/post.6.en.md index 20847e5..20847e5 100644 --- a/exampleSite/content/post/post.6.md +++ b/exampleSite/content/post/post.6.en.md diff --git a/exampleSite/content/post/post.6.es.md b/exampleSite/content/post/post.6.es.md new file mode 100644 index 0000000..e8b37f8 --- /dev/null +++ b/exampleSite/content/post/post.6.es.md @@ -0,0 +1,7 @@ ++++ +title = 'Primis eget imperdiet lorem - Versión Español' +slug = 'post6' +image = 'images/pic03.jpg' +date = "2017-03-22T00:00:00" +description = 'Donec eget ex magna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis magna etiam.' ++++ diff --git a/exampleSite/content/post/post.7.md b/exampleSite/content/post/post.7.en.md index 982860a..982860a 100644 --- a/exampleSite/content/post/post.7.md +++ b/exampleSite/content/post/post.7.en.md diff --git a/exampleSite/content/post/post.7.es.md b/exampleSite/content/post/post.7.es.md new file mode 100644 index 0000000..05723d0 --- /dev/null +++ b/exampleSite/content/post/post.7.es.md @@ -0,0 +1,7 @@ ++++ +title = 'Ante mattis interdum dolor - Versión Español' +slug = 'post7' +image = 'images/pic04.jpg' +date = "2017-03-18T00:00:00" +description = 'Donec eget ex magna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis magna etiam.' ++++ diff --git a/exampleSite/content/post/post.8.md b/exampleSite/content/post/post.8.en.md index 06b1047..06b1047 100644 --- a/exampleSite/content/post/post.8.md +++ b/exampleSite/content/post/post.8.en.md diff --git a/exampleSite/content/post/post.8.es.md b/exampleSite/content/post/post.8.es.md new file mode 100644 index 0000000..8783fe3 --- /dev/null +++ b/exampleSite/content/post/post.8.es.md @@ -0,0 +1,7 @@ ++++ +title = 'Augue lorem primis vestibulum - Versión Español' +slug = 'post8' +image = 'images/pic07.jpg' +date = "2017-03-07T00:00:00" +description = 'Donec eget ex magna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis magna etiam.' ++++ diff --git a/exampleSite/content/post/post.9.md b/exampleSite/content/post/post.9.en.md index 8397ee2..8397ee2 100644 --- a/exampleSite/content/post/post.9.md +++ b/exampleSite/content/post/post.9.en.md diff --git a/exampleSite/content/post/post.9.es.md b/exampleSite/content/post/post.9.es.md new file mode 100644 index 0000000..f3811b4 --- /dev/null +++ b/exampleSite/content/post/post.9.es.md @@ -0,0 +1,8 @@ ++++ +title = 'Comments example - Versión Español' +slug = 'comments-example' +image = 'images/pic04.jpg' +date = "2018-02-20T00:00:00" +description = 'Donec eget ex magna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis magna etiam.' +disqusid = '9' ++++ diff --git a/exampleSite/content/post/post.md b/exampleSite/content/post/post.en.md index 50647d8..50647d8 100644 --- a/exampleSite/content/post/post.md +++ b/exampleSite/content/post/post.en.md diff --git a/exampleSite/content/post/post.es.md b/exampleSite/content/post/post.es.md new file mode 100644 index 0000000..ae0708e --- /dev/null +++ b/exampleSite/content/post/post.es.md @@ -0,0 +1,7 @@ ++++ +title = 'first post - Versión Español' +slug = 'post' +image = 'images/pic02.jpg' +date = "2012-02-06T00:00:00" +description = 'Donec eget ex magna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis magna etiam.' ++++ diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 66c35b3..f1b3f27 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -20,7 +20,7 @@ <p>{{ .Description }}</p> </header> {{ if .Params.image }} - <div class="image main"><img src="{{ .Params.image | absURL }}" alt="" /></div> + <div class="image main"><img src="{{ .Params.image | relURL }}" alt="" /></div> {{ end }} {{ .Content }} diff --git a/layouts/index.html b/layouts/index.html index 1548e75..237d062 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -37,15 +37,15 @@ <footer> <div class="pagination"> {{ if $postsPaging.HasPrev }} - <a href="{{ $postsPaging.Prev.URL | absLangURL }}" class="previous"></a> + <a href="{{ $postsPaging.Prev.URL }}" class="previous"></a> {{ end }} {{ range $postsPaging.Pagers }} {{ if lt .PageNumber 10 }} - <a href="{{ .URL | absLangURL }}" class="page{{ if eq .PageNumber $postsPaging.PageNumber }} active{{ end }}">{{ .PageNumber }}</a> + <a href="{{ .URL }}" class="page{{ if eq .PageNumber $postsPaging.PageNumber }} active{{ end }}">{{ .PageNumber }}</a> {{ end }} {{ end }} {{ if $postsPaging.HasNext }} - <a href="{{ $postsPaging.Next.URL | absLangURL }}" class="next">{{ i18n "NEXT" . }}</a> + <a href="{{ $postsPaging.Next.URL }}" class="next">{{ i18n "NEXT" . }}</a> {{ end }} </div> </footer> diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 7628a7b..475dd94 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,4 +1,4 @@ <!-- Header --> <header id="header"> - <a href='{{ "/" | absLangURL }}' class="logo">{{ .Site.Title }}</a> + <a href='{{ "/" | relLangURL }}' class="logo">{{ .Site.Title }}</a> </header> diff --git a/layouts/partials/htmlhead.html b/layouts/partials/htmlhead.html index 5193ba4..c8ae9d8 100644 --- a/layouts/partials/htmlhead.html +++ b/layouts/partials/htmlhead.html @@ -9,6 +9,6 @@ <title>{{ if eq (.Site.Title) (.Title) }}{{ .Site.Title }}{{ else }}{{ .Title }} · {{ .Site.Title }}{{ end }}</title> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" /> - <link rel="stylesheet" href='{{ "assets/css/main.css" | absURL }}' /> - <noscript><link rel="stylesheet" href='{{ "assets/css/noscript.css" | absURL }}' /></noscript> + <link rel="stylesheet" href='{{ "assets/css/main.css" | relURL }}' /> + <noscript><link rel="stylesheet" href='{{ "assets/css/noscript.css" | relURL }}' /></noscript> </head> diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index fbd1301..1e127d0 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -2,9 +2,9 @@ {{ $data := index .Site.Data .Site.Language.Lang }} <nav id="nav"> <ul class="links"> - <li class="active"><a href='{{ "/" | absLangURL }}'>{{ .Site.Title }}</a></li> + <li class="active"><a href='{{ "/" | relLangURL }}'>{{ .Site.Title }}</a></li> {{ with $data.contactinfo }} - <li><a href='{{ "#footer" | absLangURL }}'>{{ i18n "NAV_CONTACT" . }}</a></li> + <li><a href='{{ "#footer" | relLangURL }}'>{{ i18n "NAV_CONTACT" . }}</a></li> {{ end }} {{ if .IsTranslated }} {{ range .AllTranslations }} diff --git a/layouts/partials/posts/featured.html b/layouts/partials/posts/featured.html index 9687ceb..53ad713 100644 --- a/layouts/partials/posts/featured.html +++ b/layouts/partials/posts/featured.html @@ -10,7 +10,7 @@ <p>{{ .Description }}</p> </header> {{ if .Params.image }} - <a href="{{ .Permalink }}" class="image main"><img src="{{ .Params.image | absURL }}" alt="" /></a> + <a href="{{ .Permalink }}" class="image main"><img src="{{ .Params.image | relURL }}" alt="" /></a> {{ end }} <ul class="actions"> <li><a href="{{ .Permalink }}" class="button big">{{ $data.post.linktext }}</a></li> diff --git a/layouts/partials/posts/list.html b/layouts/partials/posts/list.html index 45f12e5..9bdfebc 100644 --- a/layouts/partials/posts/list.html +++ b/layouts/partials/posts/list.html @@ -10,7 +10,7 @@ <h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2> </header> {{ if .Params.image }} - <a href="{{ .Permalink }}" class="image fit"><img src="{{ .Params.image | absURL }}" alt="" /></a> + <a href="{{ .Permalink }}" class="image fit"><img src="{{ .Params.image | relURL }}" alt="" /></a> {{ end }} <p>{{ .Description }}</p> <ul class="actions"> diff --git a/layouts/partials/posts/pagination.html b/layouts/partials/posts/pagination.html index b43965e..e67a900 100644 --- a/layouts/partials/posts/pagination.html +++ b/layouts/partials/posts/pagination.html @@ -3,15 +3,15 @@ <footer> <div class="pagination"> {{ if .paging.HasPrev }} - <a href="{{ .paging.Prev.URL | absLangURL }}" class="previous">{{ i18n "PAGINATION_PREVIOUS" . }}</a> + <a href="{{ .paging.Prev.URL }}" class="previous">{{ i18n "PAGINATION_PREVIOUS" . }}</a> {{ end }} {{ range .paging.Pagers }} {{ if lt .PageNumber 10 }} - <a href="{{ .URL | absLangURL }}" class="page{{ if eq .PageNumber .paging.PageNumber }} active{{ end }}">{{ .PageNumber }}</a> + <a href="{{ .URL }}" class="page{{ if eq .PageNumber .paging.PageNumber }} active{{ end }}">{{ .PageNumber }}</a> {{ end }} {{ end }} {{ if .paging.HasNext }} - <a href="{{ .paging.Next.URL | absLangURL }}" class="next">{{ i18n "PAGINATION_NEXT" . }}</a> + <a href="{{ .paging.Next.URL }}" class="next">{{ i18n "PAGINATION_NEXT" . }}</a> {{ end }} </div> </footer> diff --git a/layouts/partials/scripts/index.html b/layouts/partials/scripts/index.html index 2ef0ce0..92c8ed9 100644 --- a/layouts/partials/scripts/index.html +++ b/layouts/partials/scripts/index.html @@ -1,10 +1,10 @@ <!-- Scripts --> -<script src='{{ "assets/js/jquery.min.js" | absURL }}'></script> -<script src='{{ "assets/js/jquery.scrollex.min.js" | absURL }}'></script> -<script src='{{ "assets/js/jquery.scrolly.min.js" | absURL }}'></script> -<script src='{{ "assets/js/skel.min.js" | absURL }}'></script> -<script src='{{ "assets/js/util.js" | absURL }}'></script> -<script src='{{ "assets/js/main.js" | absURL }}'></script> +<script src='{{ "assets/js/jquery.min.js" | relURL }}'></script> +<script src='{{ "assets/js/jquery.scrollex.min.js" | relURL }}'></script> +<script src='{{ "assets/js/jquery.scrolly.min.js" | relURL }}'></script> +<script src='{{ "assets/js/skel.min.js" | relURL }}'></script> +<script src='{{ "assets/js/util.js" | relURL }}'></script> +<script src='{{ "assets/js/main.js" | relURL }}'></script> {{ partial "scripts/googleanalytics" . }} {{ partial "scripts/disqus" . }} |