From 2dcac111c608cda50978263c385c193ebd459957 Mon Sep 17 00:00:00 2001 From: "John Siu (imacpro)" Date: Thu, 25 Jun 2020 23:18:12 -0400 Subject: Initial commit. --- .gitignore | 1 + .gitmodules | 3 ++ LICENSE | 20 +++++++++++ README.md | 86 ++++++++++++++++++++++++++++++++++++++++++++ archetypes/default.md | 2 ++ exampleSite | 1 + layouts/404.html | 1 + layouts/_default/baseof.html | 13 +++++++ layouts/_default/list.html | 23 ++++++++++++ layouts/_default/single.html | 27 ++++++++++++++ layouts/partials/footer.html | 3 ++ layouts/partials/head.html | 0 layouts/partials/header.html | 2 ++ theme.toml | 12 +++++++ 14 files changed, 194 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 LICENSE create mode 100644 README.md create mode 100644 archetypes/default.md create mode 160000 exampleSite create mode 100644 layouts/404.html create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/single.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/head.html create mode 100644 layouts/partials/header.html create mode 100644 theme.toml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..496ee2c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..81a47aa --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "exampleSite"] + path = exampleSite + url = https://github.com/gohugoio/hugoBasicExample.git diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..062bb83 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2020 John Siu + +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/README.md b/README.md new file mode 100644 index 0000000..f3212de --- /dev/null +++ b/README.md @@ -0,0 +1,86 @@ +Hugo Theme - SK1 (Skeleton 1) + +--- + +Fully functional basic Hugo theme, html only, no css, no javascript. + +Intended for learning hugo them or a skeleton to develop full feature theme. + +### Usage + +- Git clone + + In site directory: + + ```sh + git clone https://github.com/J-Siu/hugo-theme-sk1 theme/sk1 + ``` + +- Git submodule + + In site directory: + + ```sh + git submodule add https://github.com/J-Siu/hugo-theme-sk1 theme/sk1 + ``` + +### Hugo Features Implemented + +- layouts + - _default + - baseof.html + - No change, auto generated by Hugo + - list.html + - `Site.Params.maintype` for home page listing. Default: `post` + - Pagination + - single.html + - Content + - Date + - Next/Prev + - Related + - Tags + - ToC + - partials + - footer.html + - Site.Params.copyright + - head.html + - No change, auto generated by Hugo + - header.html + - Site.Params.subtitle + - 404.html + - Text "Page Not Found." + - index.html + - Deleted. Merged with list.html + +### Site Config + +```toml +baseURL = "https://sk1.jsiu.dev" +title = "" + +enableGitInfo = false +relativeURLs = true +theme = "hugo-theme-sk1" + +[Params] +copyright = "" +maintype = "" +subtitle = "" +``` + +### Demo + +- https://sk1.jsiu.dev/ + +### Repository + +- [docker_compose](https://github.com/J-Siu/hugo-theme-sk1) + +### Contributors + +- [John Sing Dao Siu](https://github.com/J-Siu) + +### Change Log + +- 1.0.0 + - Initial Commit \ No newline at end of file diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..ac36e06 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,2 @@ ++++ ++++ diff --git a/exampleSite b/exampleSite new file mode 160000 index 0000000..e4440a1 --- /dev/null +++ b/exampleSite @@ -0,0 +1 @@ +Subproject commit e4440a1848c1780a45b8ff0508a1d9154c4665a7 diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..40a76aa --- /dev/null +++ b/layouts/404.html @@ -0,0 +1 @@ +Page Not Found. \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..e43f994 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,13 @@ + + +{{- partial "head.html" . -}} + + + {{- partial "header.html" . -}} +
+ {{- block "main" . }}{{- end }} +
+ {{- partial "footer.html" . -}} + + + \ No newline at end of file diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..5a5b443 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,23 @@ +{{define "main"}} + +{{if .Site.Params.mainType}} + {{.Scratch.Set "type" .Site.Params.mainType}} +{{else}} + {{.Scratch.Set "type" "post"}} +{{end}} + +{{if .IsHome}} + {{.Scratch.Set "Paginator" (.Paginate (where .Site.RegularPages "Type" (.Scratch.Get "type")))}} +{{else}} + {{.Scratch.Set "Paginator" .Paginator}} +{{end}} +{{$paginator:=(.Scratch.Get "Paginator")}} + + +{{template "_internal/pagination.html" .}} + +{{end}} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..2ce0fa8 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,27 @@ +{{define "main"}} + +

{{.Title}}

+{{.Date.Format "2006-01-30"}} +{{.TableOfContents}} +{{.Content}} + + + +{{with .PrevInSection}}{{.Title}}{{end }} +{{with .NextInSection}}{{.Title}}{{end }} + +{{$related := .Site.RegularPages.Related . | first 5}} +{{with $related}} +

See Also

+ +{{end}} + +{{end}} \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..daddf07 --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,3 @@ +{{with .Site.copyright}}{{.}} / {{end}} +Power by Hugo / +Theme SK1 by J-Siu \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..bf161ee --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,2 @@ +{{.Site.Title}} +{{with .Site.Params.subtitle}} / {{.}}{{end}} \ No newline at end of file diff --git a/theme.toml b/theme.toml new file mode 100644 index 0000000..9e4054e --- /dev/null +++ b/theme.toml @@ -0,0 +1,12 @@ +name = "sk1" +license = "MIT" +licenselink = "https://github.com/J-Siu/hugo-theme-sk1/blob/master/LICENSE" +description = "Fully functional basic Hugo theme, no css, no javascript." +homepage = "https://sk1.jsiu.dev/" +tags = ["blog"] +features = [] +min_version = "0.65.0" + +[author] + name = "John Siu" + homepage = "https://github.com/J-Siu" \ No newline at end of file -- cgit v1.2.3