building my own theme with bulma and learn more about hugo
This commit is contained in:
parent
c8f73dfc5b
commit
a712f0ab16
BIN
themes/.DS_Store
vendored
Normal file
BIN
themes/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
themes/hugo-bulma-cookbook/.DS_Store
vendored
Normal file
BIN
themes/hugo-bulma-cookbook/.DS_Store
vendored
Normal file
Binary file not shown.
6
themes/hugo-bulma-cookbook/layouts/_default/index.html
Normal file
6
themes/hugo-bulma-cookbook/layouts/_default/index.html
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{{ partial "header.html" . }}
|
||||||
|
{{ partial "hero.html" . }}
|
||||||
|
|
||||||
|
<div class="content">
|
||||||
|
{{ .Content }}
|
||||||
|
</div>
|
38
themes/hugo-bulma-cookbook/layouts/_default/list.html
Normal file
38
themes/hugo-bulma-cookbook/layouts/_default/list.html
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{{ partial "header.html" . }}
|
||||||
|
{{ partial "hero.html" . }}
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
{{ range .RegularPages }}
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-content">
|
||||||
|
<div class="media">
|
||||||
|
<div class="media-left">
|
||||||
|
<figure class="image is-48x48">
|
||||||
|
<img src="https://bulma.io/images/placeholders/96x96.png" alt="Placeholder image">
|
||||||
|
</figure>
|
||||||
|
</div>
|
||||||
|
<div class="media-content">
|
||||||
|
<p class="title is-4">
|
||||||
|
<a href="{{ .Permalink }}"> {{ .Title }}</a>
|
||||||
|
</p>
|
||||||
|
<p class="subtitle is-6">{{ .Params.subtitle }}</p>
|
||||||
|
|
||||||
|
{{ with .Params.tags }}
|
||||||
|
<ul id="tags">
|
||||||
|
{{ range . }}
|
||||||
|
<span class="tag">
|
||||||
|
<a href="{{ "tags" | absURL }}/{{ . | urlize }}">{{ . }}</a>
|
||||||
|
</span>
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{ partial "footer.html" . }}
|
26
themes/hugo-bulma-cookbook/layouts/_default/single.html
Normal file
26
themes/hugo-bulma-cookbook/layouts/_default/single.html
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{{ partial "header.html" . }}
|
||||||
|
{{ partial "hero.html" . }}
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<img src="{{ .Params.thumbnail }}" />
|
||||||
|
|
||||||
|
<div class="content">
|
||||||
|
{{ .Content }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h4 class="subtitle" id="date"> Posted: {{ .Date.Format "Mon Jan 2, 2006" }} </h4>
|
||||||
|
<h5 class="subtitle" id="wordcount"> Word Count: {{ .WordCount }} Words </h5>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<h2 class="title">Tags</h2>
|
||||||
|
{{ with .Params.tags }}
|
||||||
|
{{ range . }}
|
||||||
|
<span class="tag">
|
||||||
|
<a href="{{ "tags" | absURL }}/{{ . | urlize }}">{{ . }}</a>
|
||||||
|
</span>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{ partial "footer.html" . }}
|
11
themes/hugo-bulma-cookbook/layouts/_default/taxonomy.html
Normal file
11
themes/hugo-bulma-cookbook/layouts/_default/taxonomy.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{{ partial "header.html" . }}
|
||||||
|
{{ partial "hero.html" . }}
|
||||||
|
|
||||||
|
<main>
|
||||||
|
<div>
|
||||||
|
<!-- ranges through each of the content files associated with a particular taxonomy term and renders the summary.html content view -->
|
||||||
|
{{ range .Pages }}
|
||||||
|
{{ .Render "tags"}}
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</main>
|
3
themes/hugo-bulma-cookbook/layouts/partials/footer.html
Normal file
3
themes/hugo-bulma-cookbook/layouts/partials/footer.html
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
footer part
|
||||||
|
</body>
|
||||||
|
</html>
|
36
themes/hugo-bulma-cookbook/layouts/partials/header.html
Normal file
36
themes/hugo-bulma-cookbook/layouts/partials/header.html
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="{{ .Page.Language | default "en" }}">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css">
|
||||||
|
<link rel="stylesheet" type="text/css" href="https://unpkg.com/bulma-prefers-dark" />
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
|
||||||
|
// Get all "navbar-burger" elements
|
||||||
|
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
|
||||||
|
|
||||||
|
// Add a click event on each of them
|
||||||
|
$navbarBurgers.forEach(el => {
|
||||||
|
el.addEventListener('click', () => {
|
||||||
|
|
||||||
|
// Get the target from the "data-target" attribute
|
||||||
|
const target = el.dataset.target;
|
||||||
|
const $target = document.getElementById(target);
|
||||||
|
|
||||||
|
// Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu"
|
||||||
|
el.classList.toggle('is-active');
|
||||||
|
$target.classList.toggle('is-active');
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<title>{{ .Title }}</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
{{ partial "navbar" . }}
|
6
themes/hugo-bulma-cookbook/layouts/partials/hero.html
Normal file
6
themes/hugo-bulma-cookbook/layouts/partials/hero.html
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<section class="hero is-primary">
|
||||||
|
<div class="hero-body">
|
||||||
|
<h1 class="title">{{ .Title }}</h1>
|
||||||
|
<p class="subtitle">{{ .Params.subtitle }}</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
18
themes/hugo-bulma-cookbook/layouts/partials/navbar.html
Normal file
18
themes/hugo-bulma-cookbook/layouts/partials/navbar.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<nav class="navbar is-primary" role="navigation" aria-label="main navigation">
|
||||||
|
<div class="navbar-brand">
|
||||||
|
<a class="navbar-item" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
||||||
|
|
||||||
|
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample" >
|
||||||
|
<span aria-hidden="true"></span>
|
||||||
|
<span aria-hidden="true"></span>
|
||||||
|
<span aria-hidden="true"></span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="navbarBasicExample" class="navbar-menu">
|
||||||
|
<div class="navbar-start">
|
||||||
|
<a class="navbar-item" href="/recipies">Recipies</a>
|
||||||
|
<a class="navbar-item" href="/tags">Tags</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
BIN
themes/hugo-bulma-cookbook/static/static/.DS_Store
vendored
Normal file
BIN
themes/hugo-bulma-cookbook/static/static/.DS_Store
vendored
Normal file
Binary file not shown.
11851
themes/hugo-bulma-cookbook/static/static/css/bulma.css
vendored
Normal file
11851
themes/hugo-bulma-cookbook/static/static/css/bulma.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
17
themes/hugo-bulma-cookbook/theme.toml
Normal file
17
themes/hugo-bulma-cookbook/theme.toml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# theme.toml template for a Hugo theme
|
||||||
|
# See https://github.com/spf13/hugoThemes#themetoml for an example
|
||||||
|
|
||||||
|
name = "cookbook"
|
||||||
|
license = "MIT"
|
||||||
|
licenselink = "https://github.com/matcornic/hugo-theme-learn/blob/master/LICENSE.md"
|
||||||
|
description = "Minimal cookbook template for Hugo based on Bulma CSS."
|
||||||
|
#homepage = "https://github.com/matcornic/hugo-theme-learn/"
|
||||||
|
#repo = "https://github.com/matcornic/hugo-theme-learn"
|
||||||
|
tags = ["documentation", "grav", "learn", "doc", "search"]
|
||||||
|
features = ["documentation", "menu", "nested sections", "search", "mermaid"]
|
||||||
|
min_version = 0.25
|
||||||
|
|
||||||
|
[author]
|
||||||
|
name = "James Tombleson"
|
||||||
|
homepage = "https://matcornic.github.io/"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user