diff options
author | Max le Fou <buttbadger@gmail.com> | 2020-03-11 13:16:09 +0300 |
---|---|---|
committer | Max le Fou <buttbadger@gmail.com> | 2020-03-11 13:16:09 +0300 |
commit | 3bf4288b9ea5dbab7903290680108f15a27a0799 (patch) | |
tree | 4f4ea701055e184ef7aae52e07c567444ba825fe | |
parent | 91868e1b282c27c2b66fc109136eb9fa00f3b017 (diff) |
more features
-rw-r--r-- | README.md | 47 | ||||
-rw-r--r-- | exampleSite/README.md | 1 | ||||
-rw-r--r-- | exampleSite/config.toml | 25 | ||||
-rw-r--r-- | exampleSite/content/posts/postwithpic.md | 15 | ||||
-rw-r--r-- | exampleSite/static/favicon.ico | bin | 0 -> 1406 bytes | |||
-rw-r--r-- | exampleSite/static/pic1.jpg | bin | 0 -> 621355 bytes | |||
-rw-r--r-- | exampleSite/static/pic2.jpg | bin | 0 -> 2322925 bytes | |||
-rw-r--r-- | exampleSite/static/pic3.jpg | bin | 0 -> 1787375 bytes | |||
-rw-r--r-- | i18n/en.toml | 8 | ||||
-rw-r--r-- | i18n/fr.toml | 17 | ||||
-rw-r--r-- | layouts/_default/list.html | 7 | ||||
-rw-r--r-- | layouts/_default/single.html | 2 | ||||
-rw-r--r-- | layouts/index.html | 13 | ||||
-rw-r--r-- | layouts/partials/categories.html | 9 | ||||
-rw-r--r-- | layouts/partials/footer.html | 26 | ||||
-rw-r--r-- | layouts/partials/head.html | 3 | ||||
-rw-r--r-- | layouts/partials/tags.html | 9 | ||||
-rw-r--r-- | screenshot.jpg | bin | 0 -> 66765 bytes | |||
-rw-r--r-- | theme.toml | 22 |
19 files changed, 163 insertions, 41 deletions
@@ -1,5 +1,48 @@ # HUGO.386 - This is a port of the BOOTSTRA.386 theme for Hugo, for a cool retro look on your blog. -Under construction...
\ No newline at end of file +![Example of Hugo blog with the theme](screenshot.jpg) + +## Installation +Inside the folder of your Hugo site run: + + $ git submodule add https://gitlab.com/maxlefou/hugo.386 themes/hugo.386 + +For more information read the official [setup guide](//gohugo.io/overview/installing/) of Hugo. + + +## Getting started + +After installing the theme successfully it requires a just a few more steps to get your site running. + + +### The config file + +Take a look inside the [`exampleSite`](//gitlab.com/maxlefou/hugo.386/tree/master/exampleSite) folder of this theme. You'll find a file called [`config.toml`](//gitlab.com/maxlefou/hugo.386/blob/master/exampleSite/config.toml). +It contains detailed information about the customization of all strings in this theme. + +To use it, copy the [`config.toml`](//gitlab.com/maxlefou/hugo.386/blob/master/exampleSite/config.toml) in the root folder of your Hugo site. Feel free to change strings as you like. + + +### Nearly finished + +In order to see your site in action, run Hugo's built-in local server. + + $ hugo server + +Now enter [`localhost:1313`](http://localhost:1313) in the address bar of your browser. + + +## Contributing + +Did you found a bug or got an idea for a new feature? There's surely at least some subsisting glitches as this theme is brand new. So feel free to use the [issue tracker](//gitlab.com/maxlefou/hugo.386/issues) to let me know. Or make directly a [merge request](//gitlab.com/maxlefou/hugo.386/pulls). + + +## License + +This theme is released under the Apache License 2.0 For more information read the [License](//github.com/digitalcraftsman/hugo-freelancer-theme/blob/master/LICENSE). + + +## Annotations + +Thanks to [Steve Francia](//github.com/spf13) for creating Hugo and the awesome community around the project. Many thanks to [Kristopolous](//github.com/kristopolous) as well for the BOOTSRTA.386 theme, even if it's a bit outdated today. (and i'm not speaking of the retro look)
\ No newline at end of file diff --git a/exampleSite/README.md b/exampleSite/README.md new file mode 100644 index 0000000..4418ae9 --- /dev/null +++ b/exampleSite/README.md @@ -0,0 +1 @@ +These are the files necessary for the theme to work. Just copy the files in the root of your hugo site installation and edit the files as you want.
\ No newline at end of file diff --git a/exampleSite/config.toml b/exampleSite/config.toml index ebf76cf..4ad9f3d 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -6,6 +6,27 @@ theme = "hugo.386" preserveTaxonomyNames = true [params] + # The name to display as main title in the home page mainpagetitle = "HUGO.386" - mainpagesubtitle = "Welcome to the early 90s!" - mainpagedesc = "This theme is the Hugo port of the BOOTSTRA.386 theme for a cool retro look on your blog."
\ No newline at end of file + + # The subtitle to display under the title in the home page + mainpagesubtitle = "Welcome to the early 90s!" + + # The name to display as main title in the home page + mainpagedesc = "This theme is the Hugo port of the BOOTSTRA.386 theme for a cool retro look on your blog. Check the links below to access the posts." + + # The name to display in the copyright section in the footer + copyrightname = "JM Fergeau" + + # The url to use as link in the copyright name in the footer. Leave empty to use none. + copyrighturl = "http://jmf-portfolio.netlify.com" + + # Show the "built on Hugo" disclaimer + showhugo = true + + # Urls for social networks + facebook = "https://facebook.com" + twitter = "https://twitter.com" + linkedin = "https://linkedin.com" + github = "https://github.com" + gitlab = "https://gitlab.com"
\ No newline at end of file diff --git a/exampleSite/content/posts/postwithpic.md b/exampleSite/content/posts/postwithpic.md new file mode 100644 index 0000000..1023d3d --- /dev/null +++ b/exampleSite/content/posts/postwithpic.md @@ -0,0 +1,15 @@ +--- +title: Post with pictures +date: 2018-04-15 +description: "A simple post with pictures" +tags: ["90s","experiment"] +categories: ["blog","photos"] +--- + +Here goes some pictures. + +![A random image from picsum](/pic1.jpg) + +![Another random image from picsum](/pic2.jpg) + +![A last random image from picsum](/pic3.jpg)
\ No newline at end of file diff --git a/exampleSite/static/favicon.ico b/exampleSite/static/favicon.ico Binary files differnew file mode 100644 index 0000000..0045546 --- /dev/null +++ b/exampleSite/static/favicon.ico diff --git a/exampleSite/static/pic1.jpg b/exampleSite/static/pic1.jpg Binary files differnew file mode 100644 index 0000000..b1ce8ff --- /dev/null +++ b/exampleSite/static/pic1.jpg diff --git a/exampleSite/static/pic2.jpg b/exampleSite/static/pic2.jpg Binary files differnew file mode 100644 index 0000000..1fdc420 --- /dev/null +++ b/exampleSite/static/pic2.jpg diff --git a/exampleSite/static/pic3.jpg b/exampleSite/static/pic3.jpg Binary files differnew file mode 100644 index 0000000..1643e27 --- /dev/null +++ b/exampleSite/static/pic3.jpg diff --git a/i18n/en.toml b/i18n/en.toml index 7e43e0d..1cc9528 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -7,11 +7,11 @@ other = "Posts" [postslist] other = "Blog posts" -[search] -other = "Search" - [categories] other = "Categories" [tags] -other = "Tags"
\ No newline at end of file +other = "Tags" + +[backtohome] +other = "Back to Home"
\ No newline at end of file diff --git a/i18n/fr.toml b/i18n/fr.toml new file mode 100644 index 0000000..8daa786 --- /dev/null +++ b/i18n/fr.toml @@ -0,0 +1,17 @@ +[home] +other = "Accueil" + +[posts] +other = "Articles" + +[postslist] +other = "Articles de blog" + +[categories] +other = "Catégories" + +[tags] +other = "Tags" + +[backtohome] +other = "Retour à l'accueil"
\ No newline at end of file diff --git a/layouts/_default/list.html b/layouts/_default/list.html index d011a1b..43fef57 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -10,7 +10,12 @@ <!-- Ranges through content/posts/*.md --> {{ range .Pages }} <li> - <a href="{{.Permalink}}">{{.Date.Format "2006-01-02"}} | {{.Title}}</a> + <a href="{{.Permalink}}"> + {{ if eq .Site.GetPage "/posts" }} + {{.Date.Format "2006-01-02"}} | + {{ end }} + {{.Title}} + </a> </li> {{ end }} </ul> diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 64615fb..6cca59d 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -6,7 +6,7 @@ </div> <p class="lead">{{ .Params.description }}</p> {{ .Content }} - <h4><a href="{{ .Site.BaseURL }}">{{ i18n "home" }}</a></h4> + <h4><a href="{{ .Site.BaseURL }}">{{ i18n "backtohome" }}</a></h4> </div> {{ end }}
\ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index 564e031..01c40ff 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,10 +1,13 @@ {{ define "main" }} <div class="row-fluid navmargin"> + <div class="page-header"> + <h1>{{ .Site.Params.mainpagetitle }}</h1> + </div> +</div> + +<div class="row-fluid"> <div class="span9 bs-docs-sidebar"> - <div class="page-header"> - <h1>{{ .Site.Params.mainpagetitle }}</h1> - </div> <p class="lead">{{ .Site.Params.mainpagesubtitle }}</p> <p></p> <p>{{ .Site.Params.mainpagedesc }}</p> @@ -22,12 +25,12 @@ </div> <div class="span3 bs-docs-sidebar"> - <h1>Categories</h1> + <h1>{{ i18n "categories" }}</h1> <ul class="nav nav-list bs-docs-sidenav"> {{ partial "categories.html" .}} </ul> <p></p> - <h1>Tags</h1> + <h1>{{ i18n "tags" }}</h1> <ul class="nav nav-list bs-docs-sidenav"> {{ partial "tags.html" .}} </ul> diff --git a/layouts/partials/categories.html b/layouts/partials/categories.html index 933b631..909a281 100644 --- a/layouts/partials/categories.html +++ b/layouts/partials/categories.html @@ -1,10 +1,5 @@ -{{ $taxonomy := "categories" }} -{{ with .Param $taxonomy }} -{{ range $index, $tag := . }} -{{ with $.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}} +{{range first 10 ($.Site.GetPage "taxonomyTerm" "categories").Pages }} <li> - <a href="{{ .Permalink }}">{{ $tag | urlize }}</a> + <a href="{{ .Permalink }}">{{.Title}}</a> </li> -{{- end -}} -{{- end -}} {{ end }}
\ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 8af6739..0e7f3c1 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,3 +1,24 @@ +<footer class="container"> + <hr class="soften"> + <p> + © + {{ with .Site.Params.copyrighturl }}<a href="{{ . }}" target="_blank">{{ end }} + {{ .Site.Params.copyrightname }} + {{ with .Site.Params.copyrighturl }}</a>{{ end }} + <span id="thisyear">2020</span> + {{ if isset .Site.Params "showhugo" }} + | Built on <a href="//gohugo.io" target="_blank">Hugo</a> + {{ end }} + </p> + <p class="text-center"> + {{ with .Site.Params.facebook }}<a href="{{ . }}">Facebook</a> {{ end }} + {{ with .Site.Params.twitter }}<a href="{{ . }}">Twitter</a> {{ end }} + {{ with .Site.Params.linkedin }}<a href="{{ . }}">Linkedin</a> {{ end }} + {{ with .Site.Params.github }}<a href="{{ . }}">GitHub</a> {{ end }} + {{ with .Site.Params.gitlab }}<a href="{{ . }}">GitLab</a>{{ end }} + </p> +</footer> + <script src="{{ "/js/bootstrap.min.js" | relURL }}"></script> <script src="{{ "/js/bootstrap-386.js" | relURL }}"></script> @@ -18,4 +39,9 @@ <script src="{{ "/js/bootstrap-affix.js" | relURL }}"></script> <script> _386 = { onePass: true, speedFactor: 1.0 }; + + // Free updated script to get the actual year !! no more document.write or stuff!! + function ThisYear() { + document.getElementById('thisyear').innerHTML = new Date().getFullYear(); + }; </script>
\ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 4144dd5..b52ed97 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -3,7 +3,8 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="format-detection" content="telephone=no" /> <meta name="theme-color" content="#000084" /> - <link rel="canonical" href="{{ .Permalink }}"> + <link rel="icon" href="/favicon.ico"> + <link rel="canonical" href="{{ .Site.BaseURL }}"> {{/* Don't ask why it's like this. This original theme is a mess... */}} <link rel="stylesheet" href="{{ "/css/bootstrap.css" | relURL }}"> <link rel="stylesheet" href="{{ "/css/bootstrap-responsive.css" | relURL }}"> diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html index 5650056..df110f1 100644 --- a/layouts/partials/tags.html +++ b/layouts/partials/tags.html @@ -1,10 +1,5 @@ -{{ $taxonomy := "tags" }} -{{ with .Param $taxonomy }} -{{ range $index, $tag := . }} -{{ with $.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}} +{{range first 10 ($.Site.GetPage "taxonomyTerm" "tags").Pages }} <li> - <a href="{{ .Permalink }}">{{ $tag | urlize }}</a> + <a href="{{ .Permalink }}">{{.Title}}</a> </li> -{{- end -}} -{{- end -}} {{ end }}
\ No newline at end of file diff --git a/screenshot.jpg b/screenshot.jpg Binary files differnew file mode 100644 index 0000000..9c043d7 --- /dev/null +++ b/screenshot.jpg @@ -2,20 +2,20 @@ # See https://github.com/gohugoio/hugoThemes#themetoml for an example name = "Hugo.386" -license = "MIT" -licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE" -description = "" -homepage = "http://example.com/" -tags = [] -features = [] +license = "Apache 2" +licenselink = "//gitlab.com/maxlefou/hugo.386/blob/master/LICENSE" +description = "Hugo port of the BOOTSTRA.386 theme" +homepage = "//gitlab.com/maxlefou/hugo.386/" +tags = ["blog","retro","geek","bootstra.386","hugo.386"] +features = ["responsive"] min_version = "0.41" [author] - name = "" - homepage = "" + name = "JM Fergeau" + homepage = "//jmf-portfolio.netlify.com" # If porting an existing theme [original] - name = "" - homepage = "" - repo = "" + name = "BOOTSTRA.386" + homepage = "//kristopolous.github.io/BOOTSTRA.386/" + repo = "//github.com/kristopolous/BOOTSTRA.386" |