Browse Source

more features

pull/1/head
Max le Fou 5 years ago
parent
commit
3bf4288b9e
  1. 47
      README.md
  2. 1
      exampleSite/README.md
  3. 25
      exampleSite/config.toml
  4. 15
      exampleSite/content/posts/postwithpic.md
  5. BIN
      exampleSite/static/favicon.ico
  6. BIN
      exampleSite/static/pic1.jpg
  7. BIN
      exampleSite/static/pic2.jpg
  8. BIN
      exampleSite/static/pic3.jpg
  9. 8
      i18n/en.toml
  10. 17
      i18n/fr.toml
  11. 7
      layouts/_default/list.html
  12. 2
      layouts/_default/single.html
  13. 13
      layouts/index.html
  14. 9
      layouts/partials/categories.html
  15. 26
      layouts/partials/footer.html
  16. 3
      layouts/partials/head.html
  17. 9
      layouts/partials/tags.html
  18. BIN
      screenshot.jpg
  19. 22
      theme.toml

47
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...
![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)

1
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.

25
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."
# 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"

15
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)

BIN
exampleSite/static/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
exampleSite/static/pic1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 607 KiB

BIN
exampleSite/static/pic2.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

BIN
exampleSite/static/pic3.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

8
i18n/en.toml

@ -7,11 +7,11 @@ other = "Posts"
[postslist]
other = "Blog posts"
[search]
other = "Search"
[categories]
other = "Categories"
[tags]
other = "Tags"
other = "Tags"
[backtohome]
other = "Back to Home"

17
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"

7
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>

2
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 }}

13
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>

9
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 }}

26
layouts/partials/footer.html

@ -1,3 +1,24 @@
<footer class="container">
<hr class="soften">
<p>
&copy;
{{ 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>

3
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 }}">

9
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 }}

BIN
screenshot.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

22
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"

Loading…
Cancel
Save