diff --git a/config.toml b/config.toml index 53cdf417..5177227c 100644 --- a/config.toml +++ b/config.toml @@ -1,7 +1,7 @@ languageCode = "en-us" title = "Brain Baking" baseurl = "https://brainbaking.com/" -theme = "minimal" +theme = "brainbaking-minimal" publishDir = "docs" enableEmoji = true enableRobotsTXT = true diff --git a/static/css/brainbaking.css b/static/css/brainbaking.css index 06a42964..ed9d5723 100644 --- a/static/css/brainbaking.css +++ b/static/css/brainbaking.css @@ -10,18 +10,26 @@ .list h3 { color: #999; - float: left; - margin-top: 1.5rem; } .list-ul { list-style: none; margin: 0; padding: 0; - padding-left: 7rem; padding-bottom: 4rem; } +@media (min-width: 768px) { + .list h3 { + float: left; + margin-top: 1.5rem; + } + + .list-ul { + padding-left: 7rem; + } +} + .list-ul li { padding: 1rem; } diff --git a/themes/brainbaking-minimal/LICENSE.md b/themes/brainbaking-minimal/LICENSE.md new file mode 100644 index 00000000..f43efa8d --- /dev/null +++ b/themes/brainbaking-minimal/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2017 Calin Tataru + +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/themes/brainbaking-minimal/README.md b/themes/brainbaking-minimal/README.md new file mode 100644 index 00000000..b7de8023 --- /dev/null +++ b/themes/brainbaking-minimal/README.md @@ -0,0 +1,85 @@ +# Minimal + +Personal blog theme powered by [Hugo](https://gohugo.io). +A live demo is available [here](https://themes.gohugo.io/theme/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://github.com/calintat/minimal.git themes/minimal +$ git submodule init +$ git submodule update +``` + +Now you can get updates to Minimal in the future by updating the submodule: + +``` +$ git submodule update --remote themes/minimal +``` + +## Configuration + +After installation, take a look at the `exampleSite` folder inside `themes/minimal`. + +To get started, copy the `config.toml` file inside `exampleSite` to the root of your Hugo site: + +``` +$ cp themes/minimal/exampleSite/config.toml . +``` + +Now edit this file and add your own information. Note that some fields can be ommited. + +I recommend you use the theme's archetypes so now delete your site's `archetypes/default.md`. + +## 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/themes/brainbaking-minimal/archetypes/default.md b/themes/brainbaking-minimal/archetypes/default.md new file mode 100644 index 00000000..8c7c756f --- /dev/null +++ b/themes/brainbaking-minimal/archetypes/default.md @@ -0,0 +1,5 @@ +--- +title: "{{ replace .TranslationBaseName "-" " " | title }}" +date: {{ dateFormat "2006-01-02" .Date }} +draft: true +--- diff --git a/themes/brainbaking-minimal/archetypes/post.md b/themes/brainbaking-minimal/archetypes/post.md new file mode 100644 index 00000000..e5d34ef1 --- /dev/null +++ b/themes/brainbaking-minimal/archetypes/post.md @@ -0,0 +1,6 @@ +--- +title: "{{ replace .TranslationBaseName "-" " " | title }}" +date: {{ dateFormat "2006-01-02" .Date }} +tags: [] +draft: true +--- diff --git a/themes/brainbaking-minimal/archetypes/project.md b/themes/brainbaking-minimal/archetypes/project.md new file mode 100644 index 00000000..af53acf6 --- /dev/null +++ b/themes/brainbaking-minimal/archetypes/project.md @@ -0,0 +1,8 @@ +--- +title: "{{ replace .TranslationBaseName "-" " " | title }}" +description: "" +repo: "" +tags: [] +weight: 0 +draft: true +--- diff --git a/themes/brainbaking-minimal/images/screenshot.png b/themes/brainbaking-minimal/images/screenshot.png new file mode 100644 index 00000000..70c4d041 Binary files /dev/null and b/themes/brainbaking-minimal/images/screenshot.png differ diff --git a/themes/brainbaking-minimal/images/tn.png b/themes/brainbaking-minimal/images/tn.png new file mode 100644 index 00000000..07e3a59f Binary files /dev/null and b/themes/brainbaking-minimal/images/tn.png differ diff --git a/themes/brainbaking-minimal/layouts/404.html b/themes/brainbaking-minimal/layouts/404.html new file mode 100644 index 00000000..11cef1c4 --- /dev/null +++ b/themes/brainbaking-minimal/layouts/404.html @@ -0,0 +1,15 @@ +{{ partial "header" . }} + +
+ +
+ +

¯\_(ツ)_/¯

+ +

Page not found

+ +
+ +
+ +{{ partial "footer" . }} diff --git a/themes/brainbaking-minimal/layouts/_default/list.html b/themes/brainbaking-minimal/layouts/_default/list.html new file mode 100644 index 00000000..74f57fbf --- /dev/null +++ b/themes/brainbaking-minimal/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/themes/brainbaking-minimal/layouts/_default/single.html b/themes/brainbaking-minimal/layouts/_default/single.html new file mode 100644 index 00000000..7a6ba5f6 --- /dev/null +++ b/themes/brainbaking-minimal/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" "==" "post") ".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/themes/brainbaking-minimal/layouts/_default/terms.html b/themes/brainbaking-minimal/layouts/_default/terms.html new file mode 100644 index 00000000..74f57fbf --- /dev/null +++ b/themes/brainbaking-minimal/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/themes/brainbaking-minimal/layouts/index.html b/themes/brainbaking-minimal/layouts/index.html new file mode 100644 index 00000000..8bf2fae1 --- /dev/null +++ b/themes/brainbaking-minimal/layouts/index.html @@ -0,0 +1,17 @@ +{{ partial "header" . }} + +
+ +
+ + {{ with .Site.Params.profilePic }} {{ end }} + +

{{ .Site.Title }}

+ +

{{ markdownify .Site.Params.Description }}

+ +
+ +
+ +{{ partial "footer" . }} diff --git a/themes/brainbaking-minimal/layouts/partials/body-open.html b/themes/brainbaking-minimal/layouts/partials/body-open.html new file mode 100644 index 00000000..11b798a4 --- /dev/null +++ b/themes/brainbaking-minimal/layouts/partials/body-open.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/themes/brainbaking-minimal/layouts/partials/css.html b/themes/brainbaking-minimal/layouts/partials/css.html new file mode 100644 index 00000000..9dbf93aa --- /dev/null +++ b/themes/brainbaking-minimal/layouts/partials/css.html @@ -0,0 +1,31 @@ + + + + + + +{{ range .Site.Params.css }} {{ end }} + + + + + +{{ if .Site.Params.highlight | default false }} {{ end }} + + + + + + diff --git a/themes/brainbaking-minimal/layouts/partials/footer.html b/themes/brainbaking-minimal/layouts/partials/footer.html new file mode 100644 index 00000000..8a0706fa --- /dev/null +++ b/themes/brainbaking-minimal/layouts/partials/footer.html @@ -0,0 +1,9 @@ + + + + + diff --git a/themes/brainbaking-minimal/layouts/partials/head-open.html b/themes/brainbaking-minimal/layouts/partials/head-open.html new file mode 100644 index 00000000..9828a896 --- /dev/null +++ b/themes/brainbaking-minimal/layouts/partials/head-open.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/themes/brainbaking-minimal/layouts/partials/header.html b/themes/brainbaking-minimal/layouts/partials/header.html new file mode 100644 index 00000000..8176f590 --- /dev/null +++ b/themes/brainbaking-minimal/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/themes/brainbaking-minimal/layouts/partials/js.html b/themes/brainbaking-minimal/layouts/partials/js.html new file mode 100644 index 00000000..52ed50ed --- /dev/null +++ b/themes/brainbaking-minimal/layouts/partials/js.html @@ -0,0 +1,12 @@ + + +{{ range .Site.Params.js }} {{ end }} + + + + + + + + + diff --git a/themes/brainbaking-minimal/layouts/partials/list-item.html b/themes/brainbaking-minimal/layouts/partials/list-item.html new file mode 100644 index 00000000..e6a21067 --- /dev/null +++ b/themes/brainbaking-minimal/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 }} + + {{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006") | $.Scratch.Set "subtitle" }} + {{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }} + +

{{ .Title }}

+
{{ $.Scratch.Get "subtitle" }}
+ {{ range .Params.tags }} + {{ . }} + {{ end }} + +
diff --git a/themes/brainbaking-minimal/layouts/partials/paginator.html b/themes/brainbaking-minimal/layouts/partials/paginator.html new file mode 100644 index 00000000..d6128f4d --- /dev/null +++ b/themes/brainbaking-minimal/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/themes/brainbaking-minimal/static/css/main.css b/themes/brainbaking-minimal/static/css/main.css new file mode 100644 index 00000000..9f9ca27d --- /dev/null +++ b/themes/brainbaking-minimal/static/css/main.css @@ -0,0 +1,97 @@ +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) !important; +} + +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; +} + + +/*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/themes/brainbaking-minimal/theme.toml b/themes/brainbaking-minimal/theme.toml new file mode 100644 index 00000000..3cf53096 --- /dev/null +++ b/themes/brainbaking-minimal/theme.toml @@ -0,0 +1,12 @@ +name = "Minimal" +license = "MIT" +licenselink = "https://github.com/calintat/minimal/blob/master/LICENSE.md" +description = "Personal blog theme powered by Hugo" +homepage = "http://github.com/calintat/minimal/" +tags = ["blog", "minimal", "personal", "responsive"] +features = ["responsive"] +min_version = "0.24.1" + +[author] + name = "Calin Tataru" + homepage = "https://calintat.github.io/" diff --git a/themes/minimal b/themes/minimal deleted file mode 160000 index c55c53fc..00000000 --- a/themes/minimal +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c55c53fc6bee719d6c703786c0c0d4986ac8783f