From 7223b0f3131dfdf7acf2eeb588c92cd2d52454ad Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Mon, 1 Feb 2021 11:17:12 +0530 Subject: [PATCH] update demo --- content/posts/papermod/_index.md | 2 +- .../posts/papermod/papermod-features/index.md | 72 ++++++++- content/posts/papermod/papermod-icons.md | 4 +- .../posts/papermod/papermod-installation.md | 19 ++- content/posts/papermod/papermod-variables.md | 140 +++++++++++++----- content/posts/placeholder-text.md | 1 + 6 files changed, 187 insertions(+), 51 deletions(-) diff --git a/content/posts/papermod/_index.md b/content/posts/papermod/_index.md index 243d06f2..57e5b522 100644 --- a/content/posts/papermod/_index.md +++ b/content/posts/papermod/_index.md @@ -1,5 +1,5 @@ --- -title: Sub-Section PaperMod +title: PaperMod summary: Contains posts related to `PaperMod` description: Contains posts related to PaperMod --- diff --git a/content/posts/papermod/papermod-features/index.md b/content/posts/papermod/papermod-features/index.md index b8b540f7..a29e9e35 100644 --- a/content/posts/papermod/papermod-features/index.md +++ b/content/posts/papermod/papermod-features/index.md @@ -10,6 +10,14 @@ author: "Aditya Telange" tocopen: true --- +## Intro + +- **We'll be using `yml/yaml` format for all examples down below, I recommend using `yml` over `toml` as it is easier to read.** + +- You can find any [YML to TOML](https://www.google.com/search?q=yml+to+toml) converters if necessary. + +--- + ### Assets (js/css) The following is enabled by default @@ -60,12 +68,25 @@ You can refer following table for better understanding... Create a page with `archive.md` in `content` directory with following content +```shell +. +├── config.yml +├── content/ +│ ├── archives.md <--- Create archive.md here +│ └── posts/ +├── static/ +└── themes/ + └── PaperMod/ +``` + +and add the following to it + ```yml --- -title: "Archive" # in any language you want -layout: "archives" # is necessary -url: "/archive" -summary: "archive" +title: "Archive" +layout: "archives" +url: "/archives/" +summary: archives --- ``` @@ -109,7 +130,7 @@ ex. [config.yml#L106](https://github.com/adityatelange/hugo-PaperMod/blob/exampl ### Profile Mode -![profile](images/profile.jpg) +![profile](https://raw.githubusercontent.com/adityatelange/hugo-PaperMod/exampleSite/content/posts/papermod/papermod-features/images/profile.jpg) Shows Index/Home page as Full Page with Social Links and Image @@ -141,6 +162,8 @@ params: ### Search +PaperMod uses [Fuse.js Basic](https://fusejs.io/getting-started/different-builds.html#explanation-of-different-builds) for seach functionality + Add the following to site config, `config.yml` ```yml @@ -158,11 +181,21 @@ Create a page with `search.md` in `content` directory with following content title: "Search" # in any language you want layout: "search" # is necessary # url: "/archive" +# description: "Description for Search" summary: "search" --- ``` +To hide a particular page from being searched, add it in post's fron't matter + +```yml +--- +searchHidden: true +``` + +ex: [search.md](https://raw.githubusercontent.com/adityatelange/hugo-PaperMod/exampleSite/content/search.md) + For Multilingual use `search..md` ex. `search.es.md`. **Note:** Search will work only on current language, user is currently on ! @@ -183,8 +216,6 @@ params: keys: ["title", "permalink", "summary", "content"] ``` -ex: [search.md](https://raw.githubusercontent.com/adityatelange/hugo-PaperMod/exampleSite/content/search.md) - --- ### Draft Page indication @@ -271,6 +302,33 @@ TocOpen: true --- +### BreadCrumb Navigation + +Adds BreadCrumb Navigation above Post's Title to show subsections and Navigation to Home + +```yml +params: + ShowBreadCrumbs: true +``` + +Can be diabled for particular page's front-matter + +```yml +--- +ShowBreadCrumbs: false +--- + +``` + +### Other Posts suggestion below a post + +Adds a Previous / Next post suggestion under a single post + +```yml +params: + ShowPostNavLinks: true +``` + ### Multiple Authors To Use multiple authors for a post, in post-variables: diff --git a/content/posts/papermod/papermod-icons.md b/content/posts/papermod/papermod-icons.md index a3b2f2a7..e7788b28 100644 --- a/content/posts/papermod/papermod-icons.md +++ b/content/posts/papermod/papermod-icons.md @@ -13,7 +13,7 @@ draft: true ## Social Icons -| No. | name | platform link | +| No. | Name | Platform Link | | --- | ------------- | ------------------------------- | | 1 | 123rf | 123rf.com | | 2 | adobestock | stock.adobe.com | @@ -89,5 +89,3 @@ Usage: params: ShowShareButtons: true ``` - -You can see Below how share Icons Look. diff --git a/content/posts/papermod/papermod-installation.md b/content/posts/papermod/papermod-installation.md index 49d611ff..9bbae1d4 100644 --- a/content/posts/papermod/papermod-installation.md +++ b/content/posts/papermod/papermod-installation.md @@ -44,7 +44,7 @@ git submodule add https://github.com/adityatelange/hugo-PaperMod.git themes/Pape git submodule update --init --recursive ``` -**Note**: You may use ` --branch v3.0` to end of above command if you want to stick to specific release. +**Note**: You may use ` --branch v4.0` to end of above command if you want to stick to specific release. > Updating theme : > @@ -56,6 +56,14 @@ git submodule update --init --recursive Or you can Download as Zip from Github Page and extract in your themes directory +Direct Links: + +- [Master Branch (Latest)](https://github.com/adityatelange/hugo-PaperMod/archive/master.zip) +- [v4.0](https://github.com/adityatelange/hugo-PaperMod/archive/v4.0.zip) +- [v3.0](https://github.com/adityatelange/hugo-PaperMod/archive/v3.0.zip) +- [v2.0](https://github.com/adityatelange/hugo-PaperMod/archive/v2.0.zip) +- [v1.0](https://github.com/adityatelange/hugo-PaperMod/archive/v1.0.zip) + ### Finally ... Add in `config.yml`: @@ -197,13 +205,13 @@ menu: url: https://example.org weight: 30 # Read: https://github.com/adityatelange/hugo-PaperMod/wiki/FAQs#using-hugos-syntax-highlighter-chroma +# pygmentsUseClasses: true # markup: # highlight: # # anchorLineNos: true # codeFences: true # guessSyntax: true # lineNos: true -# # noClasses: false # style: monokai ``` @@ -229,6 +237,7 @@ description: "Desc Text." disableHLJS: true # to disable highlightjs disableShare: false disableHLJS: false +searchHidden: true cover: image: "" # image path/url alt: "" # alt text @@ -239,4 +248,10 @@ cover: --- ``` +You can use it by creating `archetypes/post.md` + +```shell +hugo new --kind post +``` + --- diff --git a/content/posts/papermod/papermod-variables.md b/content/posts/papermod/papermod-variables.md index f264aa38..67f4f36d 100644 --- a/content/posts/papermod/papermod-variables.md +++ b/content/posts/papermod/papermod-variables.md @@ -31,48 +31,112 @@ weight: 5 | hidemeta | boolean | true \| false | To Hide meta elements : date, read-time, author and available-translations for page | | showtoc | boolean | true \| false | To show/hide Table of Contents | | tocopen | boolean | true \| false | To keep open ToC by default on page load | +| ShowPostNavLinks | boolean | true \| false | Show Previous and Next Posts below a Post | +| ShowBreadCrumbs | boolean | true \| false | Show BreadCrumb Navigation above single post/page | | comments | boolean | true \| false | To show/hide comments | -| fuseOpts | | | | -| socialIcons | | | | -| analytics.google.SiteVerificationTag | string | "XYZabc" | | +| analytics.google.SiteVerificationTag | string | "XYZabc" | Site Verification Tag for Google Analytics | +| analytics.bing.SiteVerificationTag | string | "XYZabc" | Site Verification Tag for Bing | +| analytics.yandex.SiteVerificationTag | string | "XYZabc" | Site Verification Tag for Yandex | | | | | | -| label.text | string | 'Home' | To display different label text other than title | -| label.icon | string | '/apple-touch-icon.png' | To display a logo image in label | -| label.iconHeight | integer | 35 | To set size of label logo image | -| assets.favicon | string | 'icon.ico' | To set favicon, can be path or external link | -| assets.disableHLJS | | | | -| assets.disableFingerprinting | | | | -| cover.linkFullImages | boolean | true \| false | To open full size cover images on click on cover | -| cover.responsiveImages | boolean | true \| false | To enable/disable generation of responsive cover images | -| cover.hidden | | | | -| cover.hiddenInList | | | | -| cover.hiddenInSingle | | | | -| profileMode.enabled | | | | -| profileMode.title | | | | -| profileMode.imageUrl | | | | -| profileMode.imageWidth | | | | -| profileMode.imageHeight | | | | -| profileMode.imageTitle | | | | -| profileMode.buttons | | | | +| fuseOpts | - | - | [Details](#fuseOpts) | +| socialIcons | - | - | [Details](#socialIcons) | +| label | - | - | [Details](#label) | +| assets | - | - | [Details](#assets) | +| cover | - | - | [Details](#cover) | +| profileMode | - | - | [Details](#profilemode) | + +#### label + +| name | type | example | Description | +| ---------------- | ------- | ----------------------- | ------------------------------------------------ | +| label.text | string | 'Home' | To display different label text other than title | +| label.icon | string | '/apple-touch-icon.png' | To display a logo image in label | +| label.iconHeight | integer | 35 | To set size of label logo image | + +#### profileMode + +| name | type | example | Description | +| ----------------------- | ------- | ---------------------------------------------- | ----------- | +| profileMode.enabled | boolean | true \| false | | +| profileMode.title | string | "Title" | | +| profileMode.imageUrl | string | "image.png" \| "https://example.com/image.jpg" | | +| profileMode.imageWidth | string | "" | | +| profileMode.imageHeight | string | "" | | +| profileMode.imageTitle | string | "This image is a picture of .." | | +| profileMode.buttons | - | - | | + +#### assets + +| name | type | example | Description | +| ---------------------------- | ------- | ---------- | -------------------------------------------- | +| assets.favicon | string | 'icon.ico' | To set favicon, can be path or external link | +| assets.disableHLJS | boolean | | | +| assets.disableFingerprinting | boolean | | | + +#### cover + +| name | type | example | Description | +| ---------------------- | ------- | ------------- | ------------------------------------------------------- | +| cover.linkFullImages | boolean | true \| false | To open full size cover images on click on cover | +| cover.responsiveImages | boolean | true \| false | To enable/disable generation of responsive cover images | +| cover.hidden | boolean | true \| fals | | +| cover.hiddenInList | boolean | true \| fals | | +| cover.hiddenInSingle | boolean | true \| fals | | + +#### fuseOpts + +```yml +fuseOpts: + isCaseSensitive: false + shouldSort: true + location: 0 + distance: 1000 + threshold: 0.4 + minMatchCharLength: 0 + keys: ["title", "permalink", "summary", "content"] ## can be less but not more than shown in list +``` + +#### socialIcons + +```yml +socialIcons: + - name: "" + url: "" + - name: "" + url: "" +``` + +#### + +```yml +profileMode: + buttons: + - name: Archive + url: "/archive" + - name: Github + url: "https://github.com/" +``` --- ### Page Variables -| Name | Type | Example | Description | -| -------------- | ------------- | --------------------- | ----------------------------------------------------------------------------------- | -| showtoc | boolean | true \| false | To show/hide Table of Contents | -| tocopen | boolean | true \| false | To keep open ToC by default on page load | -| hidemeta | boolean | true \| false | To Hide meta elements : date, read-time, author and available-translations for page | -| comments | boolean | true \| false | To show/hide comments | -| description | string | 'description text' | Show Post Description under Title | -| disableShare | boolean | true \| false | To hide/show share icons under a page | -| disableHLJS | | | | -| author | string \|list | 'Me' \| ['Me','You'] | To show multiple Authors | -| cover.image | string | 'featured.jpg' | To add a cover image | -| cover.caption | string | 'caption for image' | To add caption to cover image | -| cover.alt | string | 'this is cover image' | Alternate text to show if image doesn't load/show up | -| cover.relative | boolean | true \| false | To use relative path for cover image, used in hugo Page-bundles | -| cover.hidden | | | | -| | | | | -| weight | integer | 5 | To set page order or to pin a post to Top of list | +| Name | Type | Example | Description | +| --------------- | ------------- | --------------------- | ----------------------------------------------------------------------------------- | +| showtoc | boolean | true \| false | To show/hide Table of Contents | +| tocopen | boolean | true \| false | To keep open ToC by default on page load | +| hidemeta | boolean | true \| false | To Hide meta elements : date, read-time, author and available-translations for page | +| comments | boolean | true \| false | To show/hide comments | +| description | string | 'description text' | Show Post Description under Title | +| disableShare | boolean | true \| false | To hide/show share icons under a page | +| disableHLJS | boolean | true \| false | | +| searchHidden | boolean | true \| false | | +| ShowBreadCrumbs | boolean | true \| false | Show BreadCrumb Navigation above single post/page | +| author | string \|list | 'Me' \| ['Me','You'] | To show multiple Authors | +| cover.image | string | 'featured.jpg' | To add a cover image | +| cover.caption | string | 'caption for image' | To add caption to cover image | +| cover.alt | string | 'this is cover image' | Alternate text to show if image doesn't load/show up | +| cover.relative | boolean | true \| false | To use relative path for cover image, used in hugo Page-bundles | +| cover.hidden | boolean | true \| false | | +| | | | | +| weight | integer | 5 | To set page order or to pin a post to Top of list | diff --git a/content/posts/placeholder-text.md b/content/posts/placeholder-text.md index 63d4f261..78305e7e 100644 --- a/content/posts/placeholder-text.md +++ b/content/posts/placeholder-text.md @@ -5,6 +5,7 @@ date: "2019-03-09" description: "Lorem Ipsum Dolor Si Amet" tags: ["markdown", "text"] hideMeta: true +searchHidden: true --- Lorem est tota propiore conpellat pectoribus de pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum.