Skip to content

Commit

Permalink
Add basic theme files
Browse files Browse the repository at this point in the history
  • Loading branch information
BBaoVanC committed Sep 26, 2021
1 parent 19bfe67 commit 03eb50c
Show file tree
Hide file tree
Showing 17 changed files with 347 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space

[*.html]
indent_size = 4

[*.md]
indent_size = 2

[config.toml]
indent_size = 2
13 changes: 13 additions & 0 deletions archetypes/blog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
+++
title = "{{ replace .Name "-" " " | title }}"
date = "{{ .Date }}"
draft = true

description = """
Lorem ipsum
"""

tags = [
"awesome",
]
+++
8 changes: 8 additions & 0 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
title = "{{ replace .Name "-" " " | title }}"
menu = "main"

description = """
Lorem ipsum
"""
+++
Empty file added layouts/404.html
Empty file.
27 changes: 27 additions & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
{{- partial "head.html" . -}}

<body>
{{- partial "header.html" . -}}
{{ partial "navbar.html" . }}

<div class="row">
{{ if and (ne .Params.Toc false) .IsPage }}
<div class="side">
<h3>Table of Contents</h3>
{{ .TableOfContents }}
</div>
{{ end }}

<div class="main">
{{- block "main" . }}
{{ .Content }}
{{- end }}
</div>
</div>

{{- partial "footer.html" . -}}
</body>

</html>
Empty file added layouts/_default/list.html
Empty file.
4 changes: 4 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ end }}
2 changes: 2 additions & 0 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{ define "main" }}
{{ end }}
Empty file added layouts/partials/footer.html
Empty file.
18 changes: 18 additions & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" type="text/css" href="/css/bobatheme.css">
<link rel="alternate icon" href="/favicon.ico" />
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}

{{ $title := print .Title " | " .Site.Title }}
{{ if .IsHome }}{{ $title = .Site.Title }}{{ end }}
<title>{{ $title }}</title>

{{ template "_internal/opengraph.html" . }}
{{ template "_internal/twitter_cards.html" . }}
{{ template "_internal/schema.html" . }}
</head>
3 changes: 3 additions & 0 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="header">
<h1>{{ .Site.Title }}</h1>
</div>
6 changes: 6 additions & 0 deletions layouts/partials/navbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="navbar">
<a href="{{ "/" | relURL }}">Home</a>
{{ range .Site.Menus.main }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
</div>
2 changes: 2 additions & 0 deletions layouts/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-Agent: *
Sitemap: {{ "sitemap.xml" | absURL }}
118 changes: 118 additions & 0 deletions static/css/bobatheme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
@media screen and (max-width: 700px) {
.row {
flex-direction: column;
}
}
@media screen and (max-width: 400px) {
.navbar a {
float: none;
width: 100%;
}
}

body {
font-family: sans-serif;
margin: 0;
display: flex;
flex-direction: column;
}
a {
color: blue;
}
blockquote {
border-left: 5px solid #ccc;
padding-left: 10px;
}

.header {
padding: 10px;
text-align: center;
background: #4FA2F5;
color: white;
}
.header h1 {
font-size: 40px;
}

.navbar {
overflow: hidden;
background-color: #999;
}
.navbar a {
float: left;
display: block;
color: white;
text-align: center;
padding: 14px 20px;
text-decoration: none;
}
/* .navbar a.right {
float: right;
} */
.navbar a:hover {
background-color: #ddd;
color: black;
}

* {
box-sizing: border-box;
}
.row {
flex: 1;
display: flex;
flex-wrap: wrap;
}
.side {
width: 20%;
background-color: lightgray;
padding: 20px;
}
.main {
width: 80%;
background-color: white;
padding: 20px;
}
.footer {
padding: 20px;
text-align: center;
background: #ddd;
}

@media (prefers-color-scheme: dark) {
body {
background-color: black;
}
a {
color: #4da6ff;
}
blockquote {
border-left: 5px solid #222;
}
.header {
background: #1A406B;
color: lightgray;
}
.navbar {
background-color: #222;
}
.navbar a {
color: lightgray;
}
.navbar a:hover {
background-color: #444;
color: white;
}
.side {
background-color: #111;
color: lightgray;
}
.main {
background-color: black;
color: lightgray;
}
.footer {
background: #222;
color: lightgray;
}
max-width: 650px;
}
116 changes: 116 additions & 0 deletions static/css/starwars.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
@media screen and (max-width: 700px) {
.row {
flex-direction: column;
}
}
@media screen and (max-width: 400px) {
.navbar a {
float: none;
width: 100%;
}
}

body, html {
height: 100%;
}

body {
font-family: sans-serif;
margin: 0;
display: flex;
flex-direction: column;
}
a {
color: blue;
}

.header {
padding: 10px;
text-align: center;
background: url(../images/stars.png);
background-size: cover;
color: white;
}
.header h1 {
font-size: 50px;
font-weight: bold;
transform-origin: 50% 100%;
transform: perspective(350px) rotateX(25deg);
color: yellow;
}

.navbar {
overflow: hidden;
background-color: #999;
}
.navbar a {
float: left;
display: block;
color: white;
text-align: center;
padding: 14px 20px;
text-decoration: none;
}
/* .navbar a.right {
float: right;
} */
.navbar a:hover {
background-color: #ddd;
color: black;
}

* {
box-sizing: border-box;
}
.row {
flex: 1;
display: flex;
flex-wrap: wrap;
}
.side {
width: 25%;
background-color: lightgray;
padding: 20px;
}
.main {
width: 75%;
background-color: white;
padding: 20px;
}
.footer {
padding: 20px;
text-align: center;
background: #ddd;
}

@media (prefers-color-scheme: dark) {
body {
background-color: black;
}
a {
color: #4da6ff;
}
.navbar {
background-color: #222;
}
.navbar a {
color: lightgray;
}
.navbar a:hover {
background-color: #444;
color: white;
}
.side {
background-color: #111;
color: lightgray;
}
.main {
background-color: black;
color: lightgray;
}
.footer {
background: #222;
color: lightgray;
}
max-width: 650px;
}
Binary file added static/img/stars.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions theme.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# theme.toml template for a Hugo theme
# See https://github.com/gohugoio/hugoThemes#themetoml for an example

name = "bobatheme"
license = "MIT"
licenselink = "https://github.com/BBaoVanC/bobatheme/blob/master/LICENSE"
description = "Simple Hugo theme for boba.best and bbaovanc.com"
homepage = "https://boba.best/"
tags = []
features = []
min_version = "0.41.0"

[author]
name = "bbaovanc"
homepage = "https://bbaovanc.com"

0 comments on commit 03eb50c

Please sign in to comment.