Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/apvarun/showcase-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarun A P <8411309+apvarun@users.noreply.github.com>2020-06-24 22:45:51 +0300
committerGitHub <noreply@github.com>2020-06-24 22:45:51 +0300
commit93b2d3c86db8bcd25a7ed86c34fe12e31f5cc587 (patch)
treed3e5a71f1b9c0b476d6aa7c514dd5ee1315db8c0
parent88e4006447346fb8907b6a40f7126589ad3198f1 (diff)
parent3dedc7b9c3557bc3d8c42d6fa9fcacd86db6878c (diff)
Merge pull request #3 from apvarun/custom-menuv1.1.0
Add support for custom menu option
-rw-r--r--README.md8
-rw-r--r--exampleSite/config.toml5
-rw-r--r--layouts/_default/single.html12
-rw-r--r--layouts/index.html2
-rw-r--r--layouts/partials/footer.html3
-rw-r--r--layouts/partials/header.html7
-rw-r--r--theme.toml2
7 files changed, 37 insertions, 2 deletions
diff --git a/README.md b/README.md
index 0803c84..14d8164 100644
--- a/README.md
+++ b/README.md
@@ -14,6 +14,7 @@ Features:
- Responsive content
- Filtering content
- Social links
+- Custom menu
## Get the theme
@@ -63,10 +64,17 @@ From `exampleSite/`, copy `config.toml` to the root folder of your Hugo site and
Menu in Showcase theme is auto-generated from the sections inside your content folder.
+You can also add a custom menu item using the `config.toml` and disable auto-generated sections if not required. Refer config in [exampleSite](https://github.com/apvarun/showcase-hugo-theme/blob/master/exampleSite/config.toml)
+
## Google Analytics
Set `googleAnalytics` in `config.toml` to activate Hugo's [internal Google Analytics template](https://gohugo.io/templates/internal/#google-analytics).
+## Used By
+
+- [Madhu Akula](https://madhuakula.com/content/)
+- [@cloudmiracle](http://cloud.vn/)
+
## Issues
If you have a question, please [open an issue](https://github.com/apvarun/showcase-hugo-theme/issues) for help and to help those who come after you. The more information you can provide, the better!
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 39bfe70..b2bb113 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -10,6 +10,11 @@ disableKinds = ["taxonomy", "taxonomyTerm", "RSS"]
author = "showcase"
description = "Minimal, one page, theme for showcasing your work"
message = ""
+ hideAutoMenu = false
+
+[[menu.main]]
+ name = "External"
+ url = "https://example.com"
[social]
facebook = "https://facebook.com"
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
new file mode 100644
index 0000000..31e4967
--- /dev/null
+++ b/layouts/_default/single.html
@@ -0,0 +1,12 @@
+{{ define "main" }}
+
+<section class="text-gray-700 body-font">
+ <div class="container px-5 py-8 mx-auto">
+ <h1 class="text-2xl font-bold my-4">{{ .Title }}</h1>
+ <div>
+ {{ .Content }}
+ </div>
+ </div>
+</section>
+
+{{ end }}
diff --git a/layouts/index.html b/layouts/index.html
index f82d0c8..a5e21fb 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -6,6 +6,7 @@
<div class="flex flex-wrap sm:-m-4 -mx-4 -mb-10 -mt-4">
{{ range where .Site.Pages "Kind" "page" }}
+ {{ if ne .Params.Exclude true }}
<a
target="_blank"
rel="noopener"
@@ -37,6 +38,7 @@
</div>
</a>
{{ end }}
+ {{ end }}
</div>
</div>
</section>
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index a3b9321..6d8475a 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -131,5 +131,6 @@
);
});
- document.querySelector(`.show-all`).addEventListener("click", showAll);
+ const showAllButton = document.querySelector(`.show-all`)
+ if(showAllButton) showAllButton.addEventListener("click", showAll);
</script>
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 8a6bb77..474dcd3 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -25,6 +25,7 @@
<nav
class="md:ml-auto flex flex-wrap items-center text-base justify-center"
>
+ {{ if eq .Site.Params.hideAutoMenu false }}
<a
class="mr-2 px-2 rounded cursor-pointer select-none hover:text-gray-900 show-all"
>All</a
@@ -34,6 +35,12 @@
class="mr-2 px-2 rounded cursor-pointer select-none hover:text-gray-900 filter-{{lower .Title}}"
>{{.Title}}</a
>
+ {{ end }}{{ end }}
+ {{ range .Site.Menus.main }}
+ <a
+ href="{{ .URL }}"
+ class="mr-2 px-2 rounded cursor-pointer select-none hover:text-gray-900"
+ >{{ .Name }}</a>
{{ end }}
</nav>
</div>
diff --git a/theme.toml b/theme.toml
index 968bfc0..e10ff8f 100644
--- a/theme.toml
+++ b/theme.toml
@@ -2,7 +2,7 @@ name = "Showcase"
license = "MIT"
licenselink = "https://github.com/apvarun/showcase-hugo-theme/blob/master/LICENSE"
description = "Minimal, one page, theme for showcasing your work"
-homepage = "https://showcase-hugo-theme.now.sh/"
+homepage = "https://github.com/apvarun/showcase-hugo-theme"
tags = ["clean", "gallery", "minimal", "minimalist", "mobile", "one page", "personal", "responsive", "simple", "single page", "tailwind", "starter", "projects", "white" ]
features = ["responsive", "portfolio", "gallery"]
min_version = "0.41.0"