From 0b79d89eb97cb88d43747871c8992774be04c6c9 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Sun, 21 Feb 2021 15:28:54 -0600 Subject: [PATCH] [WIP] Add a site that sort of works --- .gitignore | 1 + archetypes/default.md | 6 ++ config.toml | 4 + content/article/First.md | 6 ++ content/article/Second.md | 6 ++ themes/bbaovanc/LICENSE | 20 ++++ themes/bbaovanc/archetypes/default.md | 2 + themes/bbaovanc/layouts/404.html | 0 themes/bbaovanc/layouts/_default/baseof.html | 11 ++ themes/bbaovanc/layouts/_default/list.html | 45 ++++++++ themes/bbaovanc/layouts/_default/single.html | 37 +++++++ themes/bbaovanc/layouts/index.html | 46 ++++++++ themes/bbaovanc/layouts/partials/footer.html | 0 themes/bbaovanc/layouts/partials/head.html | 6 ++ themes/bbaovanc/layouts/partials/header.html | 3 + themes/bbaovanc/layouts/partials/navbar.html | 5 + themes/bbaovanc/static/css/style.css | 108 +++++++++++++++++++ themes/bbaovanc/theme.toml | 21 ++++ 18 files changed, 327 insertions(+) create mode 100644 .gitignore create mode 100644 archetypes/default.md create mode 100644 config.toml create mode 100644 content/article/First.md create mode 100644 content/article/Second.md create mode 100644 themes/bbaovanc/LICENSE create mode 100644 themes/bbaovanc/archetypes/default.md create mode 100644 themes/bbaovanc/layouts/404.html create mode 100644 themes/bbaovanc/layouts/_default/baseof.html create mode 100644 themes/bbaovanc/layouts/_default/list.html create mode 100644 themes/bbaovanc/layouts/_default/single.html create mode 100644 themes/bbaovanc/layouts/index.html create mode 100644 themes/bbaovanc/layouts/partials/footer.html create mode 100644 themes/bbaovanc/layouts/partials/head.html create mode 100644 themes/bbaovanc/layouts/partials/header.html create mode 100644 themes/bbaovanc/layouts/partials/navbar.html create mode 100644 themes/bbaovanc/static/css/style.css create mode 100644 themes/bbaovanc/theme.toml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..364fdec --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +public/ diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..00e77bd --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,6 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true +--- + diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..f1b3d5c --- /dev/null +++ b/config.toml @@ -0,0 +1,4 @@ +baseURL = "https://bbaovanc.com/blog" +languageCode = "en-us" +title = "bbaovanc's blog" +theme = "bbaovanc" diff --git a/content/article/First.md b/content/article/First.md new file mode 100644 index 0000000..dee8a80 --- /dev/null +++ b/content/article/First.md @@ -0,0 +1,6 @@ +--- +title: "First" +date: 2021-02-21T14:50:30-06:00 +--- + +This is the first article in my blog. diff --git a/content/article/Second.md b/content/article/Second.md new file mode 100644 index 0000000..2959b84 --- /dev/null +++ b/content/article/Second.md @@ -0,0 +1,6 @@ +--- +title: "Second" +date: 2021-02-21T14:50:47-06:00 +--- + +This is the second article in my blog. diff --git a/themes/bbaovanc/LICENSE b/themes/bbaovanc/LICENSE new file mode 100644 index 0000000..e4483e2 --- /dev/null +++ b/themes/bbaovanc/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2021 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. diff --git a/themes/bbaovanc/archetypes/default.md b/themes/bbaovanc/archetypes/default.md new file mode 100644 index 0000000..ac36e06 --- /dev/null +++ b/themes/bbaovanc/archetypes/default.md @@ -0,0 +1,2 @@ ++++ ++++ diff --git a/themes/bbaovanc/layouts/404.html b/themes/bbaovanc/layouts/404.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/bbaovanc/layouts/_default/baseof.html b/themes/bbaovanc/layouts/_default/baseof.html new file mode 100644 index 0000000..5f8e2ec --- /dev/null +++ b/themes/bbaovanc/layouts/_default/baseof.html @@ -0,0 +1,11 @@ + + + {{- partial "head.html" . -}} + + {{- partial "header.html" . -}} +
+ {{- block "main" . }}{{- end }} +
+ {{- partial "footer.html" . -}} + + diff --git a/themes/bbaovanc/layouts/_default/list.html b/themes/bbaovanc/layouts/_default/list.html new file mode 100644 index 0000000..8591e03 --- /dev/null +++ b/themes/bbaovanc/layouts/_default/list.html @@ -0,0 +1,45 @@ + + + + + {{ partial "head.html" . }} + + + + + + + + Articles - bbaovanc's Blog + + + + + + + + + + + + + + + + + {{ partial "header.html" . }} + {{ partial "navbar.html" . }} + +
+
+

Articles

+ {{- range first 10 .Data.Pages }} +

{{ .Title }}

+ {{- end }} +

Home

+
+
+ + + + diff --git a/themes/bbaovanc/layouts/_default/single.html b/themes/bbaovanc/layouts/_default/single.html new file mode 100644 index 0000000..1ba4f9a --- /dev/null +++ b/themes/bbaovanc/layouts/_default/single.html @@ -0,0 +1,37 @@ + + + + + {{ partial "head.html" . }} + {{ .Title }} + + + + + + + + + + + + + + + + + {{ partial "header.html" . }} + {{ partial "navbar.html" . }} + +
+
+

{{ .Title }}

+
{{ .Date.Format "Mon, Jan 2, 2006" }}
+ {{ .Content }} +

Home

+
+
+ + + + diff --git a/themes/bbaovanc/layouts/index.html b/themes/bbaovanc/layouts/index.html new file mode 100644 index 0000000..e8d21f8 --- /dev/null +++ b/themes/bbaovanc/layouts/index.html @@ -0,0 +1,46 @@ + + + + + {{ partial "head.html" . }} + bbaovanc's Blog + + + + + + + + + + + + + + + + + {{ partial "header.html" . }} + {{ partial "navbar.html" . }} + +
+
+

Articles

+ {{- range first 10 .Data.Pages }} + {{- if eq .Type "article" }} +

{{ .Title }}

+ {{- end }} + {{- end }} + +

Pages

+ {{- range first 10 .Data.Pages }} + {{- if eq .Type "page" }} +

{{ .Title }}

+ {{- end }} + {{- end }} +
+
+ + + + diff --git a/themes/bbaovanc/layouts/partials/footer.html b/themes/bbaovanc/layouts/partials/footer.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/bbaovanc/layouts/partials/head.html b/themes/bbaovanc/layouts/partials/head.html new file mode 100644 index 0000000..7a3da4b --- /dev/null +++ b/themes/bbaovanc/layouts/partials/head.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/themes/bbaovanc/layouts/partials/header.html b/themes/bbaovanc/layouts/partials/header.html new file mode 100644 index 0000000..c1873f1 --- /dev/null +++ b/themes/bbaovanc/layouts/partials/header.html @@ -0,0 +1,3 @@ +
+

bbaovanc's Blog

+
diff --git a/themes/bbaovanc/layouts/partials/navbar.html b/themes/bbaovanc/layouts/partials/navbar.html new file mode 100644 index 0000000..403b769 --- /dev/null +++ b/themes/bbaovanc/layouts/partials/navbar.html @@ -0,0 +1,5 @@ + diff --git a/themes/bbaovanc/static/css/style.css b/themes/bbaovanc/static/css/style.css new file mode 100644 index 0000000..9df1631 --- /dev/null +++ b/themes/bbaovanc/static/css/style.css @@ -0,0 +1,108 @@ +@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; +} +a { + color: blue; +} + +.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 { + display: flex; + flex-wrap: wrap; +} +.side { + flex: 25%; + background-color: lightgray; + padding: 20px; +} +.main { + flex: 70%; + background-color: white; + padding: 20px; + max-width: 650px; +} +.footer { + padding: 20px; + text-align: center; + background: #ddd; +} + +@media (prefers-color-scheme: dark) { + body { + background-color: black; + } + a { + color: #4da6ff; + } + .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; +} diff --git a/themes/bbaovanc/theme.toml b/themes/bbaovanc/theme.toml new file mode 100644 index 0000000..cb4f744 --- /dev/null +++ b/themes/bbaovanc/theme.toml @@ -0,0 +1,21 @@ +# theme.toml template for a Hugo theme +# See https://github.com/gohugoio/hugoThemes#themetoml for an example + +name = "Bbaovanc" +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 = ""