diff --git a/README.md b/README.md index 5178775018..ba3bd0d84b 100644 --- a/README.md +++ b/README.md @@ -26,27 +26,27 @@ ## Features/Mods 💥 -- Uses Hugo's asset generator with pipelining, fingerprinting, bundling and minification by default. +- Uses Hugo's asset generator with pipelining, fingerprinting, bundling and minification by default - 3 Modes: - - [Regular Mode.](https://github.com/adityatelange/hugo-PaperMod/wiki/Features#regular-mode-default-mode) - - [Home-Info Mode.](https://github.com/adityatelange/hugo-PaperMod/wiki/Features#home-info-mode) - - [Profile Mode.](https://github.com/adityatelange/hugo-PaperMod/wiki/Features#profile-mode) -- Table of Content Generation (newer implementation). -- Archive of posts. + - [Regular Mode](https://github.com/adityatelange/hugo-PaperMod/wiki/Features#regular-mode-default-mode) + - [Home-Info Mode](https://github.com/adityatelange/hugo-PaperMod/wiki/Features#home-info-mode) + - [Profile Mode](https://github.com/adityatelange/hugo-PaperMod/wiki/Features#profile-mode) +- Table of Content Generation (newer implementation) +- Archive of posts - Social Icons (home-info and profile-mode) -- Social-Media Share buttons on posts. -- Menu location indicator. -- Multilingual support. (with language selector) +- Social-Media Share buttons on posts +- Menu location indicator +- Multilingual support (with language selector) - Taxonomies -- Cover image for each post (with Responsive image support). -- Light/Dark theme (automatic theme switch a/c to browser theme and theme-switch button). -- SEO Friendly. -- Multiple Author support. +- Cover image for each post (with Responsive image support) +- Light/Dark theme (automatic theme switch a/c to browser theme and theme-switch button) +- SEO Friendly +- Multiple Author support - Search Page with Fuse.js - Other Posts suggestion below a post - Breadcrumb Navigation - Code Block Copy buttons -- No webpack, nodejs and other dependencies are required to edit the theme. +- No webpack, nodejs and other dependencies are required to edit the theme Read Wiki For More Details => **[PaperMod - Features](https://github.com/adityatelange/hugo-PaperMod/wiki/Features)** diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html new file mode 100644 index 0000000000..e57f28daf0 --- /dev/null +++ b/layouts/_default/_markup/render-link.html @@ -0,0 +1 @@ +{{ .Text | safeHTML }} \ No newline at end of file diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html index e400e2c5b5..fbcc83a602 100644 --- a/layouts/_default/archives.html +++ b/layouts/_default/archives.html @@ -9,7 +9,7 @@

{{ .Title }}

{{- end }} -{{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} +{{- $pages := where (where site.RegularPages "Type" "in" site.Params.mainSections) "Params.hiddenPage" "!=" true }} {{- if site.Params.ShowAllPagesInArchive }} {{- $pages = site.RegularPages }} diff --git a/layouts/_default/index.json b/layouts/_default/index.json index feeb437ddd..645ce6c69b 100644 --- a/layouts/_default/index.json +++ b/layouts/_default/index.json @@ -1,6 +1,6 @@ {{- $.Scratch.Add "index" slice -}} {{- range site.RegularPages -}} - {{- if and (not .Params.searchHidden) (ne .Layout `archives`) (ne .Layout `search`) }} + {{- if and (not .Params.searchHidden) (ne .Layout `archives`) (ne .Layout `search`) (ne .Params.hiddenPage true) }} {{- $.Scratch.Add "index" (dict "title" .Title "content" .Plain "permalink" .Permalink "summary" .Summary) -}} {{- end }} {{- end -}} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 3a6f316eed..40ff828677 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -40,8 +40,9 @@

{{- if .IsHome }} {{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} -{{- $pages = where $pages "Params.hiddenInHomeList" "!=" "true" }} +{{- $pages = where $pages "Params.hiddenInHomeList" "!=" true }} {{- end }} +{{- $pages = where $pages "Params.hiddenPage" "!=" true }} {{- $paginator := .Paginate $pages }} diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 44f1498670..a20e87d3dc 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -33,7 +33,7 @@ {{ printf "" .Permalink .MediaType | safeHTML }} {{- end -}} {{ range $pages }} - {{- if and (ne .Layout `search`) (ne .Layout `archives`) }} + {{- if and (ne .Layout `search`) (ne .Layout `archives`) (ne .Params.hiddenPage true) }} {{ .Title }} {{ .Permalink }} diff --git a/layouts/_default/sitemap.xml b/layouts/_default/sitemap.xml new file mode 100644 index 0000000000..d08ca65b1f --- /dev/null +++ b/layouts/_default/sitemap.xml @@ -0,0 +1,24 @@ +{{ printf "" | safeHTML }} + + {{ range .Data.Pages }} + {{- if .Permalink | and (ne .Params.hiddenPage true) -}} + + {{ .Permalink }}{{ if not .Lastmod.IsZero }} + {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} + {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} + {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} + {{ end }} + {{ end }} + + {{- end -}} + {{ end }} + \ No newline at end of file diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index 6fd26540b7..158866fe3c 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -13,15 +13,18 @@

{{ .Title }}

    {{- $type := .Type }} - {{- range $key, $value := .Data.Terms.Alphabetical }} - {{- $name := .Name }} - {{- $count := .Count }} + {{- range $term := .Data.Terms.Alphabetical }} + {{- $termPages := where $term.Pages "Params.hiddenPage" "!=" true }} + {{- if (len $termPages | ne 0) }} + {{- $name := $term.Name }} + {{- $count := len $termPages }} {{- with site.GetPage (printf "/%s/%s" $type $name) }}
  • - {{ .Name }} {{ $count }} + {{ $name }} {{ $count }}
  • {{- end }} {{- end }} + {{- end }}
{{- end }}{{/* end main */ -}} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 35257fc728..093728320f 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,7 +1,7 @@ -{{- if hugo.IsProduction | or (eq site.Params.env "production") | and (ne .Params.robotsNoIndex true) }} +{{- if hugo.IsProduction | or (eq site.Params.env "production") | and (ne .Params.robotsNoIndex true) (ne .Params.hiddenPage true) }} {{- else }} diff --git a/layouts/robots.txt b/layouts/robots.txt index f26f508d50..314a7d5856 100644 --- a/layouts/robots.txt +++ b/layouts/robots.txt @@ -1,7 +1,9 @@ User-agent: * -{{- if hugo.IsProduction | or (eq site.Params.env "production") }} -Disallow: -{{- else }} +{{- if not (hugo.IsProduction | or (eq site.Params.env "production")) }} Disallow: / +{{- else }} +{{- range where site.RegularPages "Params.hiddenPage" true }} +Disallow: {{ .RelPermalink }} +{{- end }} {{- end }} Sitemap: {{ "sitemap.xml" | absURL }}