Testing Hugo with bootstrap5
This commit is contained in:
20
themes/bootstrap5/LICENSE
Normal file
20
themes/bootstrap5/LICENSE
Normal file
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2025 YOUR_NAME_HERE
|
||||
|
||||
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.
|
||||
2
themes/bootstrap5/archetypes/default.md
Normal file
2
themes/bootstrap5/archetypes/default.md
Normal file
@@ -0,0 +1,2 @@
|
||||
+++
|
||||
+++
|
||||
0
themes/bootstrap5/layouts/404.html
Normal file
0
themes/bootstrap5/layouts/404.html
Normal file
19
themes/bootstrap5/layouts/_default/baseof.html
Normal file
19
themes/bootstrap5/layouts/_default/baseof.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
{{- partial "head.html" . -}}
|
||||
<body>
|
||||
<div class="container-fluid p-5 bg-primary text-white text-center">
|
||||
{{- partial "header.html" . -}}
|
||||
</div>
|
||||
{{- partial "nav.html" . -}}
|
||||
<div class="container mt-5">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
{{- block "main" . }}{{- end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{- partial "footer.html" . -}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
0
themes/bootstrap5/layouts/_default/list.html
Normal file
0
themes/bootstrap5/layouts/_default/list.html
Normal file
7
themes/bootstrap5/layouts/_default/single.html
Normal file
7
themes/bootstrap5/layouts/_default/single.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{{ define "main" }}
|
||||
|
||||
<h2>{{ .Title }}</h2>
|
||||
|
||||
{{ .Content }}
|
||||
|
||||
{{ end }}
|
||||
5
themes/bootstrap5/layouts/index.html
Normal file
5
themes/bootstrap5/layouts/index.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{ define "main" }}
|
||||
|
||||
{{ .Content }}
|
||||
|
||||
{{ end }}
|
||||
3
themes/bootstrap5/layouts/partials/footer.html
Normal file
3
themes/bootstrap5/layouts/partials/footer.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<footer>
|
||||
<small>Copyright {{now.Format "2006"}} Me.</small>
|
||||
</footer>
|
||||
31
themes/bootstrap5/layouts/partials/head.html
Normal file
31
themes/bootstrap5/layouts/partials/head.html
Normal file
@@ -0,0 +1,31 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<!-- <link rel="stylesheet" href="{{ "css/style.css"
|
||||
| relURL }}"> -->
|
||||
<title>{{ .Site.Title }}</title>
|
||||
|
||||
<!-- https://rodneymaiato.dev/posts/how-to-add-the-official-bootstrap-module-in-a-hugo-site/ -->
|
||||
{{/* Load Bootstrap SCSS. */}}
|
||||
{{ $options := dict "enableSourceMap" true }}
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $options := dict "enableSourceMap" false "outputStyle" }}
|
||||
{{ end }}
|
||||
{{ $styles := resources.Get "scss/styles.scss" }}
|
||||
{{ $styles := $styles | resources.ToCSS $options }}
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $styles = $styles | fingerprint }}
|
||||
{{ end }}
|
||||
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
|
||||
|
||||
{{/* Load Bootstrap JS. */}}
|
||||
{{ $js := resources.Get "js/index.js" }}
|
||||
{{ $params := dict }}
|
||||
{{ $sourceMap := cond hugo.IsProduction "" "inline" }}
|
||||
{{ $opts := dict "sourceMap" $sourceMap "minify" hugo.IsProduction "target" "es2018" "params" $params }}
|
||||
{{ $js = $js | js.Build $opts }}
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $js = $js | fingerprint }}
|
||||
{{ end }}
|
||||
<script src="{{ $js.RelPermalink }}" {{ if hugo.IsProduction }}integrity="{{ $js.Data.Integrity }}"{{ end }} defer></script>
|
||||
</head>
|
||||
3
themes/bootstrap5/layouts/partials/header.html
Normal file
3
themes/bootstrap5/layouts/partials/header.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<header>
|
||||
<h1>{{ .Site.Title }}</h1>
|
||||
</header>
|
||||
6
themes/bootstrap5/layouts/partials/nav.html
Normal file
6
themes/bootstrap5/layouts/partials/nav.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<nav>
|
||||
<a href="/">Home</a>
|
||||
<a href="/about">About</a>
|
||||
<a href="/resume">Résumé</a>
|
||||
<a href="/contact"></a>
|
||||
</nav>
|
||||
24
themes/bootstrap5/static/css/style.css
Normal file
24
themes/bootstrap5/static/css/style.css
Normal file
@@ -0,0 +1,24 @@
|
||||
.container {
|
||||
margin: 0 auto;
|
||||
width: 80%;
|
||||
}
|
||||
nav, footer {
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
nav {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
nav > a {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
nav { flex-direction: row; }
|
||||
}
|
||||
21
themes/bootstrap5/theme.toml
Normal file
21
themes/bootstrap5/theme.toml
Normal file
@@ -0,0 +1,21 @@
|
||||
# theme.toml template for a Hugo theme
|
||||
# See https://github.com/gohugoio/hugoThemes#themetoml for an example
|
||||
|
||||
name = "Basic"
|
||||
license = "MIT"
|
||||
licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE"
|
||||
description = ""
|
||||
homepage = "http://example.com/"
|
||||
tags = []
|
||||
features = []
|
||||
min_version = "0.41.0"
|
||||
|
||||
[author]
|
||||
name = ""
|
||||
homepage = ""
|
||||
|
||||
# If porting an existing theme
|
||||
[original]
|
||||
name = ""
|
||||
homepage = ""
|
||||
repo = ""
|
||||
Reference in New Issue
Block a user