building my own theme with bulma and learn more about hugo

This commit is contained in:
James Tombleson 2022-09-26 14:43:49 -07:00
parent c8f73dfc5b
commit a712f0ab16
13 changed files with 12012 additions and 0 deletions

BIN
themes/.DS_Store vendored Normal file

Binary file not shown.

BIN
themes/hugo-bulma-cookbook/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,6 @@
{{ partial "header.html" . }}
{{ partial "hero.html" . }}
<div class="content">
{{ .Content }}
</div>

View 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" . }}

View 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" . }}

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

View File

@ -0,0 +1,3 @@
footer part
</body>
</html>

View 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" . }}

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

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

Binary file not shown.

File diff suppressed because it is too large Load Diff

View 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/"