From 50305c517fab8afc228dcb99a98bbf4c02be42b2 Mon Sep 17 00:00:00 2001 From: Karthik Date: Tue, 4 Feb 2020 19:27:17 +0530 Subject: add search bar, new index page post list --- README.md | 1 + exampleSite/config.toml | 45 +++++--------------------------------------- layouts/_default/baseof.html | 1 + layouts/_default/single.html | 2 -- layouts/index.html | 27 ++++++++++++++++---------- layouts/partials/footer.html | 2 +- layouts/partials/header.html | 6 ------ layouts/partials/nav.html | 6 ++++++ layouts/partials/search.html | 3 +++ 9 files changed, 34 insertions(+), 59 deletions(-) create mode 100644 layouts/partials/nav.html create mode 100644 layouts/partials/search.html diff --git a/README.md b/README.md index a9a6209..bcb03b0 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ $ git clone https://gitlab.com/kskarthik/monopriv.git * Powered by bootstrap 4 CSS framework. * Well Crafted for Personal blog * Works without javascript +* Site Search - powered by DuckDuckGo * Option to enable / disable disqus, analytics from config (disabled by default for privacy reasons) ## Contribute diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 0535d4d..de09f23 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -13,6 +13,10 @@ disqusShortname = "yourdiscussshortname" theme = "monopriv" [params] + [params.search] # Site search powered by DuckDuckGo + enabled = true + placeholder="Site Search" + about = "A privacy focused minimal bootstrap theme" img = "img/logo.png" github = "https://github.com" @@ -25,43 +29,4 @@ metakeys = "hugo, simple, minimal, bootstrap, blog" # enable/disable disqus comments disqus = false # enable/disable google analytics -analytics = false - -[menu] - [[menu.main]] - identifier = "about" - name = "About" - url = "/about/" - weight = 10 - -[taxonomies] -category = "categories" -tag = "tags" -series = "series" - -[privacy] - - [privacy.vimeo] - disabled = false - simple = true - - [privacy.twitter] - disabled = false - enableDNT = true - simple = true - - [privacy.instagram] - disabled = false - simple = true - - [privacy.youtube] - disabled = false - privacyEnhanced = true - -[services] - - [services.instagram] - disableInlineCSS = true - - [services.twitter] - disableInlineCSS = true +analytics = false \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 675fa25..1aac84f 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -3,6 +3,7 @@ {{- partial "header.html" . -}}
+ {{- partial "nav.html" . -}} {{- block "main" . -}} {{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 3e7a36c..2751904 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -15,8 +15,6 @@
{{ if .Site.Params.disqus }} {{ template "_internal/disqus.html" . }} - {{ else }} - Please mail your comments to {{.Site.Params.email}}
{{end}} diff --git a/layouts/index.html b/layouts/index.html index 1837ccc..647a791 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,16 +1,20 @@ {{define "main"}} {{- partial "hero.html" . -}} -
-

Recent Posts

-
- {{range first 5 .Site.RegularPages }} - {{if eq .Section "post"}} -
-
{{.Title}}
- {{ .PublishDate.Format "January 2, 2006" }} -
- {{end}} +
+

Recent Posts

+
+ {{range first 6 .Site.RegularPages }} + {{if eq .Section "post"}} +
+
+
{{.Title}}
+
{{ .PublishDate.Format "January 2, 2006" }}
+ {{.Summary}} + Read More... +
+
{{end}} + {{end}}
@@ -18,5 +22,8 @@ I'm Not On Faceboook
+ {{ if .Site.Params.search.enabled }} + {{partial "search.html" .}} + {{end}} {{end}} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index ad609f3..9df0ff5 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -5,4 +5,4 @@ {{ if .Site.Params.analytics }} {{ template "_internal/google_analytics.html" . }} {{ end }} - + \ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 5e9c18c..e50fd55 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -6,10 +6,4 @@ {{ hugo.Generator }} {{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }}{{ end }} - diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html new file mode 100644 index 0000000..761c5be --- /dev/null +++ b/layouts/partials/nav.html @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/layouts/partials/search.html b/layouts/partials/search.html new file mode 100644 index 0000000..53b7b9a --- /dev/null +++ b/layouts/partials/search.html @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file -- cgit v1.2.3