commit f4b4108ffc7928407e2bd19fec1f4c676d2ceb13 Author: Wilfried OLLIVIER Date: Mon Mar 19 00:02:48 2018 +0100 Bootstrap all the things diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..598ae79 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.vscode diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..ef4c81c --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2018 Calin Tataru and Wilfried Ollivier + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..2ba5eb9 --- /dev/null +++ b/README.md @@ -0,0 +1,76 @@ +# KC + +Personal blog theme powered by [Hugo](https://gohugo.io). + +## Inspired by Minimal + +This theme is a fork of the theme "Minimal", created by Calin Tataru. +A live demo is available [here](https://themes.gohugo.io/theme/minimal/). +Full source code is [here](https://github.com/calintat/minimal) + +## Installation + +You can install the theme either as a clone or submodule. + +I recommend the latter. From the root of your Hugo site, type the following: + +``` +$ git submodule add https://git.stdcall.me/kancer.club/theme.git themes/kc +$ git submodule init +$ git submodule update +``` + +Now you can get updates to KC in the future by updating the submodule: + +``` +$ git submodule update --remote themes/kc +``` + +## Features + +You can tweak the look of the theme to suit your needs in a number of ways: + +- The accent colour can be changed by using the `accent` field in `config.toml`. + +- You can also change the background colour by using `backgroundColor`. + +- Add colored 5px borders at the top and bottom of pages by setting `showBorder` to `true`. + +For best results, I recommend you use a dark accent colour with a light background, for example: + +```toml +[params] + accent = "red" + showBorder = true + backgroundColor = "white" +``` + +### Fonts + +The theme uses [Google Fonts](https://fonts.google.com) to load its font. To change the font: + +```toml +[params] + font = "Raleway" # should match the name on Google Fonts! +``` + +### Syntax highlighting + +The theme supports syntax highlighting thanks to [highlight.js](https://highlightjs.org). + +It's disabled by default, so you have to enable it by setting `highlight` to `true` in your config. + +You can change the style used for the highlighting by using the `highlightStyle` field. + +Only the "common" languages will be loaded by default. To load more, use `highlightLanguages`. + +A list of all the available styles and languages can be found [here](https://highlightjs.org/static/demo/). + +Please note the style and languages should be written in hyphen-separated lowercase, for example: + +```toml +[params] + highlight = true + highlightStyle = "solarized-dark" + highlightLanguages = ["go", "haskell", "kotlin", "scala", "swift"] +``` diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..518d7b8 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,7 @@ +--- +title: "{{ replace .TranslationBaseName "-" " " | title }}" +date: {{ dateFormat "2006-01-02" .Date }} +draft: true +description: "" +tags: [] +--- diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..11cef1c --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,15 @@ +{{ partial "header" . }} + +
+ +
+ +

¯\_(ツ)_/¯

+ +

Page not found

+ +
+ +
+ +{{ partial "footer" . }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..74f57fb --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,13 @@ +{{ partial "header" . }} + +
+ +

{{ .Title }}

+ + {{ range (.Paginator 5).Pages }} {{ partial "list-item" . }} {{ end }} + +
+ +{{ partial "paginator" . }} + +{{ partial "footer" . }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..d6557ed --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,30 @@ +{{ partial "header" . }} + +
+ + {{ partial "list-item" . }} + +
{{ .Content }}
+ + + {{ $related := first 3 (where (where (where .Site.Pages.ByDate.Reverse ".Type" "==" "billets") ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }} + + {{ if $related }} + + + + {{ range $related }} {{ partial "list-item" . }} {{ end }} + + {{ end }} + + {{ if and .Site.DisqusShortname (not .Params.disableComments) }} + + + + {{ template "_internal/disqus.html" . }} + + {{ end }} + +
+ +{{ partial "footer.html" . }} diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html new file mode 100644 index 0000000..74f57fb --- /dev/null +++ b/layouts/_default/terms.html @@ -0,0 +1,13 @@ +{{ partial "header" . }} + +
+ +

{{ .Title }}

+ + {{ range (.Paginator 5).Pages }} {{ partial "list-item" . }} {{ end }} + +
+ +{{ partial "paginator" . }} + +{{ partial "footer" . }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..4c2eb8a --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,15 @@ +{{ partial "header" . }} + +
+ +
+ + {{ with .Site.Params.profilePic }} {{ end }} + +

{{ markdownify .Site.Params.Description }}

+ +
+ +
+ +{{ partial "footer" . }} diff --git a/layouts/partials/body-open.html b/layouts/partials/body-open.html new file mode 100644 index 0000000..11b798a --- /dev/null +++ b/layouts/partials/body-open.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/layouts/partials/css.html b/layouts/partials/css.html new file mode 100644 index 0000000..9dbf93a --- /dev/null +++ b/layouts/partials/css.html @@ -0,0 +1,31 @@ + + + + + + +{{ range .Site.Params.css }} {{ end }} + + + + + +{{ if .Site.Params.highlight | default false }} {{ end }} + + + + + + diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..8a0706f --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,9 @@ + + + + + diff --git a/layouts/partials/head-open.html b/layouts/partials/head-open.html new file mode 100644 index 0000000..9828a89 --- /dev/null +++ b/layouts/partials/head-open.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..8176f59 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,77 @@ + + + + {{ partial "head-open" . }} + + + {{ .Title }} + {{ if .Site.Params.favicon }} + + {{ end }} + {{ partial "css" . }} {{ partial "js" . }} {{ .Hugo.Generator }} + {{ if .RSSLink }} + + + {{ end }} + + {{ if .Site.GoogleAnalytics }} + + + + {{ end }} + + + {{ if .Site.Params.MathJax | default true }} + + + {{ end }} + + + {{ partial "body-open" . }} + diff --git a/layouts/partials/js.html b/layouts/partials/js.html new file mode 100644 index 0000000..bde40f8 --- /dev/null +++ b/layouts/partials/js.html @@ -0,0 +1,22 @@ + +{{ if .Site.Params.highlight | default false }} + + + + {{ range .Site.Params.highlightLanguages }} {{ end }} + + + +{{ end }} + + +{{ range .Site.Params.js }} {{ end }} + + + + + + + + + diff --git a/layouts/partials/list-item.html b/layouts/partials/list-item.html new file mode 100644 index 0000000..c67cae1 --- /dev/null +++ b/layouts/partials/list-item.html @@ -0,0 +1,25 @@ +
+ + {{ $.Scratch.Set "link" .RelPermalink }} + {{ with .Params.repo }} + {{ $repoHost := default "github" $.Params.repoHost }} + {{ if eq "github" $repoHost }} + {{ printf "https://github.com/%s/%s/" $.Site.Params.githubUsername . | $.Scratch.Set "link" }} + {{ else if eq "gitlab" $repoHost }} + {{ printf "https://gitlab.com/%s/%s/" $.Site.Params.gitlabUsername . | $.Scratch.Set "link" }} + {{ else if eq "bitbucket" $repoHost }} + {{ printf "https://bitbucket.org/%s/%s/" $.Site.Params.bitbucketUsername . | $.Scratch.Set "link" }} + {{ end }} + {{ end }} + {{ with .Params.link }} {{ $.Scratch.Set "link" . }} {{ end }} + + {{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }} + {{ .Date.Day }} {{ index $.Site.Data.mois (printf "%d" .Date.Month) }} {{ .Date.Year }} + +

{{ .Title }}

+
{{ $.Scratch.Get "subtitle" }}
+ {{ range .Params.tags }} + {{ . }} + {{ end }} + +
diff --git a/layouts/partials/paginator.html b/layouts/partials/paginator.html new file mode 100644 index 0000000..d6128f4 --- /dev/null +++ b/layouts/partials/paginator.html @@ -0,0 +1,17 @@ +{{ if or .Paginator.HasPrev .Paginator.HasNext }} + +
+ + {{ if .Paginator.HasPrev }} + + {{ end }} {{ if .Paginator.HasNext }} + + {{ end }} + +
+ +{{ end }} \ No newline at end of file diff --git a/static/css/main.css b/static/css/main.css new file mode 100644 index 0000000..6906b81 --- /dev/null +++ b/static/css/main.css @@ -0,0 +1,100 @@ +html, body { + height: 100%; +} + +body { + padding-top: 55px; + display: flex; + text-align: center; + flex-direction: column; +} + +main { + margin: auto; + padding: 25px; + flex: 1 0 auto; + max-width: 750px; +} + +/*footer*/ + +.copyright { + margin: 15px 0; +} + +/*home page*/ + +.intro { + transform: translateY(22vh); +} + +.intro > h1 { + color: #212121; + font-size: 12vh; +} + +.intro > h2 { + color: #757575; + font-size: 3vmin; +} + +.intro > .profile { + width: 10vh; + height: 10vh; + border-radius: 50%; +} + +/*apply accent colour to links*/ + +a:link, a:visited { + color: var(--accent); +} + +a.icon:hover { + text-decoration: none; +} + +a:hover { + color: var(--accent) !important; +} + +/*paginator at bottom of list view*/ + +.pages { + padding: 15px 0; +} + +.pages-icon { + padding: 0 15px; +} + +/*list item for posts and projects*/ + +.item { + padding: 10px 0; +} + +.item-tag { + background-color: var(--accent); +} + +/*navigation bar icons*/ + +.navbar-icon { + font-size: 125%; + display: inline-block !important; +} + +/*coloured borders at top and bottom of the page*/ + +.navbar.navbar-default { + border-top: var(--border-width) solid var(--accent); +} + +footer { + border-bottom: var(--border-width) solid var(--accent); +} + +img { + max-width: 100%; +} diff --git a/theme.toml b/theme.toml new file mode 100644 index 0000000..2f13fa7 --- /dev/null +++ b/theme.toml @@ -0,0 +1,12 @@ +name = "KC" +license = "MIT" +licenselink = "https://git.stdcall.me/kancer.club/theme/src/branch/master/LICENSE.md" +description = "Personal blog theme powered by Hugo" +homepage = "https://git.stdcall.me/kancer.club/theme" +tags = ["blog", "minimal", "personal", "responsive"] +features = ["responsive"] +min_version = "0.24.1" + +[author] + name = "Wilfried OLLIVIER" + homepage = "https://papey.fr"