From 338838fcf67386fd0493d102ce0a116330dc4476 Mon Sep 17 00:00:00 2001 From: Darshan Baral Date: Sat, 18 May 2019 18:47:19 -0700 Subject: Add files via upload --- LICENSE | 20 ++++++++++++++++++ archetypes/default.md | 2 ++ layouts/404.html | 5 +++++ layouts/_default/baseof.html | 11 ++++++++++ layouts/_default/section.html | 28 +++++++++++++++++++++++++ layouts/_default/single.html | 11 ++++++++++ layouts/index.html | 44 +++++++++++++++++++++++++++++++++++++++ layouts/partials/bookMenu.html | 14 +++++++++++++ layouts/partials/chapterMenu.html | 18 ++++++++++++++++ layouts/partials/footer.html | 11 ++++++++++ layouts/partials/head.html | 30 ++++++++++++++++++++++++++ layouts/partials/header.html | 5 +++++ layouts/partials/navbar.html | 16 ++++++++++++++ static/css/kitab.css | 24 +++++++++++++++++++++ static/js/myFunctions.js | 39 ++++++++++++++++++++++++++++++++++ theme.toml | 12 +++++++++++ 16 files changed, 290 insertions(+) create mode 100644 LICENSE create mode 100644 archetypes/default.md create mode 100644 layouts/404.html create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/section.html create mode 100644 layouts/_default/single.html create mode 100644 layouts/index.html create mode 100644 layouts/partials/bookMenu.html create mode 100644 layouts/partials/chapterMenu.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 layouts/partials/navbar.html create mode 100644 static/css/kitab.css create mode 100644 static/js/myFunctions.js create mode 100644 theme.toml diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..662c178 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2019 DARSHAN BARAL + +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/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/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..ccc620b --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,5 @@ +{{ define "main" }} +
+

Still working on that one...

+
+{{ end }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..989e22b --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,11 @@ + + + {{ partial "head.html" . }} + + {{ partial "header" . }} +
+ {{ block "main" . }} + {{ end }} +
+ + diff --git a/layouts/_default/section.html b/layouts/_default/section.html new file mode 100644 index 0000000..6ec2a09 --- /dev/null +++ b/layouts/_default/section.html @@ -0,0 +1,28 @@ +{{ define "main" }} +
+ + + + + + + + {{ range .Pages.ByWeight }} + + + + {{ end }} + +
+

+ {{ .Title | markdownify }} +

+
+ +

+ {{ .Title }} +

+
+
+
+{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..42a93b7 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,11 @@ +{{ define "main" }} +
+

{{ .Title }}

+
+ {{ .Content }} +
+ +
+{{ end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..6972886 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,44 @@ +{{ define "main" }} +
+
+

+ {{ .Title }} +

+
+
+ {{ range .Site.Sections.ByWeight }} +
+ +

+ {{ .Title | markdownify }} +

+
+
+ + - {{ .Params.author }} ({{ .Date.Format (default "2006-May-13" $.Site.Params.dateFormat) }}) + +
+ + {{ $pageNums := len .Pages }} + {{ if ge $pageNums 6 }} +

+ + ...more + +

+ {{ end }} +
+ {{ end }} +
+
+{{ end }} diff --git a/layouts/partials/bookMenu.html b/layouts/partials/bookMenu.html new file mode 100644 index 0000000..7833e3b --- /dev/null +++ b/layouts/partials/bookMenu.html @@ -0,0 +1,14 @@ + diff --git a/layouts/partials/chapterMenu.html b/layouts/partials/chapterMenu.html new file mode 100644 index 0000000..a7c53f3 --- /dev/null +++ b/layouts/partials/chapterMenu.html @@ -0,0 +1,18 @@ +
+

+ {{ $thisSection := .Site.GetPage "section" .Section }} + {{ with $thisSection }} + {{ .Title | markdownify }} + {{ end }} +

+ +
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..9a13025 --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,11 @@ + diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..26ae6fc --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,30 @@ + + + {{ .Site.Params.title }} + + + + + + + + + + + + + + diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..984aa4a --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,5 @@ + diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html new file mode 100644 index 0000000..6d3cc4e --- /dev/null +++ b/layouts/partials/navbar.html @@ -0,0 +1,16 @@ +
+ + + {{ if eq .Kind "page" }} + + {{ end }} +
+ {{ partial "footer" . }} +
+
diff --git a/static/css/kitab.css b/static/css/kitab.css new file mode 100644 index 0000000..164a404 --- /dev/null +++ b/static/css/kitab.css @@ -0,0 +1,24 @@ +html { + width: 100vw; +} +* { + font-family: "Roboto", sans-serif; +} +body { + background-color: #f3f3ef; +} +.navMenu { + color: #007bff !important; + font-size: 1.8em; +} +.navMenu:hover { + color: #0056b3 !important; + cursor: pointer; +} +a:hover { + text-decoration: none; +} +.toTop { + position: fixed; + bottom: 0; +} diff --git a/static/js/myFunctions.js b/static/js/myFunctions.js new file mode 100644 index 0000000..79c9ec5 --- /dev/null +++ b/static/js/myFunctions.js @@ -0,0 +1,39 @@ +let showBooks = function() { + let options = document.querySelector(".chapters"); + let menuItems = document.querySelector(".menuItems"); + let mainItem = document.querySelector("main"); + if (!options.classList.contains("d-none")) { + options.classList.add("d-none"); + } + if (menuItems.classList.contains("d-none")) { + menuItems.classList.remove("d-none"); + mainItem.classList.add("d-none"); + } else { + menuItems.classList.add("d-none"); + mainItem.classList.remove("d-none"); + } +}; + +let showChapters = function() { + let menuItems = document.querySelector(".menuItems"); + let options = document.querySelector(".chapters"); + let mainItem = document.querySelector("main"); + if (!menuItems.classList.contains("d-none")) { + menuItems.classList.add("d-none"); + } + if (options.classList.contains("d-none")) { + options.classList.remove("d-none"); + mainItem.classList.add("d-none"); + } else { + options.classList.add("d-none"); + mainItem.classList.remove("d-none"); + } +}; + +let scrollToTop = () => { + const c = document.documentElement.scrollTop || document.body.scrollTop; + if (c > 0) { + window.requestAnimationFrame(scrollToTop); + window.scrollTo(0, c - c / 8); + } +}; diff --git a/theme.toml b/theme.toml new file mode 100644 index 0000000..60ab59c --- /dev/null +++ b/theme.toml @@ -0,0 +1,12 @@ +name = "kitab" +license = "MIT" +licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE" +description = "A hugo theme for publishing books" +homepage = "" +tags = ["book"] +features = ["minimal", "responsive"] +min_version = "0.41" + +[author] + name = "Darshan Baral" + homepage = "https://www.darshanbaral.com/" \ No newline at end of file -- cgit v1.2.3