From 3bf4288b9ea5dbab7903290680108f15a27a0799 Mon Sep 17 00:00:00 2001 From: Max le Fou Date: Wed, 11 Mar 2020 11:16:09 +0100 Subject: more features --- README.md | 47 +++++++++++++++++++++++++++++-- exampleSite/README.md | 1 + exampleSite/config.toml | 25 ++++++++++++++-- exampleSite/content/posts/postwithpic.md | 15 ++++++++++ exampleSite/static/favicon.ico | Bin 0 -> 1406 bytes exampleSite/static/pic1.jpg | Bin 0 -> 621355 bytes exampleSite/static/pic2.jpg | Bin 0 -> 2322925 bytes exampleSite/static/pic3.jpg | Bin 0 -> 1787375 bytes i18n/en.toml | 8 +++--- i18n/fr.toml | 17 +++++++++++ layouts/_default/list.html | 7 ++++- layouts/_default/single.html | 2 +- layouts/index.html | 13 +++++---- layouts/partials/categories.html | 9 ++---- layouts/partials/footer.html | 26 +++++++++++++++++ layouts/partials/head.html | 3 +- layouts/partials/tags.html | 9 ++---- screenshot.jpg | Bin 0 -> 66765 bytes theme.toml | 22 +++++++-------- 19 files changed, 163 insertions(+), 41 deletions(-) create mode 100644 exampleSite/README.md create mode 100644 exampleSite/content/posts/postwithpic.md create mode 100644 exampleSite/static/favicon.ico create mode 100644 exampleSite/static/pic1.jpg create mode 100644 exampleSite/static/pic2.jpg create mode 100644 exampleSite/static/pic3.jpg create mode 100644 i18n/fr.toml create mode 100644 screenshot.jpg diff --git a/README.md b/README.md index 5d7e5e2..10bef49 100644 --- a/README.md +++ b/README.md @@ -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 new file mode 100644 index 0000000..0045546 Binary files /dev/null and b/exampleSite/static/favicon.ico differ diff --git a/exampleSite/static/pic1.jpg b/exampleSite/static/pic1.jpg new file mode 100644 index 0000000..b1ce8ff Binary files /dev/null and b/exampleSite/static/pic1.jpg differ diff --git a/exampleSite/static/pic2.jpg b/exampleSite/static/pic2.jpg new file mode 100644 index 0000000..1fdc420 Binary files /dev/null and b/exampleSite/static/pic2.jpg differ diff --git a/exampleSite/static/pic3.jpg b/exampleSite/static/pic3.jpg new file mode 100644 index 0000000..1643e27 Binary files /dev/null and b/exampleSite/static/pic3.jpg differ 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 @@ {{ range .Pages }}
  • - {{.Date.Format "2006-01-02"}} | {{.Title}} + + {{ if eq .Site.GetPage "/posts" }} + {{.Date.Format "2006-01-02"}} | + {{ end }} + {{.Title}} +
  • {{ end }} 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 @@

    {{ .Params.description }}

    {{ .Content }} -

    {{ i18n "home" }}

    +

    {{ i18n "backtohome" }}

    {{ 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" }} + +
    -

    {{ .Site.Params.mainpagesubtitle }}

    {{ .Site.Params.mainpagedesc }}

    @@ -22,12 +25,12 @@
    -

    Categories

    +

    {{ i18n "categories" }}

    -

    Tags

    +

    {{ i18n "tags" }}

    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 }}
  • - {{ $tag | urlize }} + {{.Title}}
  • -{{- 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 @@ + + @@ -18,4 +39,9 @@ \ 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 @@ - + + {{/* Don't ask why it's like this. This original theme is a mess... */}} 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 }}
  • - {{ $tag | urlize }} + {{.Title}}
  • -{{- end -}} -{{- end -}} {{ end }} \ No newline at end of file diff --git a/screenshot.jpg b/screenshot.jpg new file mode 100644 index 0000000..9c043d7 Binary files /dev/null and b/screenshot.jpg differ diff --git a/theme.toml b/theme.toml index 94e3cc2..61c1abe 100644 --- a/theme.toml +++ b/theme.toml @@ -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" -- cgit v1.2.3