Skip to content

Commit

Permalink
Merge pull request #829 from c-mauderer/20200925-disable-items
Browse files Browse the repository at this point in the history
Honor "disabled" on subitems.
  • Loading branch information
stp-ip authored Sep 28, 2020
2 parents 824c118 + ce58a31 commit 06699cd
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 1 deletion.
2 changes: 2 additions & 0 deletions exampleSite/content/fragments/faq/code-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ background = "secondary"

<details>
<summary>Code (subitem)</summary>

```
+++
title = "How to sit on the laptop?"
weight = 10
#disabled = true
+++
Cat ipsum dolor sit amet, nap all day yet proudly present butt to human but please stop looking at your phone and pet me, yet furrier and even more furrier hairball. Dismember a mouse and then regurgitate parts of it on the family room floor reward the chosen human with a slow blink find a way to fit in tiny box. Bring your owner a dead bird. Love and coo around boyfriend who purrs and makes the perfect moonlight eyes so i can purr and swat the glittery gleaming yarn to him (the yarn is from a $125 sweater) fight an alligator and win paw at your fat belly.
Expand Down
1 change: 1 addition & 0 deletions exampleSite/content/fragments/graph/code-stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ subtitle = "Beautifully showcase your data with graphs based on chart.js"

<details>
<summary>Code (config.json)</summary>

```
{
"type": "line",
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/content/fragments/items/code-items-no-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ subtitle= "Column based items with icons"

<details>
<summary>Code (subitem)</summary>

```
+++
weight = 10
#disabled = true
[asset]
icon = "fas fa-random"
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/content/fragments/items/code-items-only.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ background = "secondary"

<details>
<summary>Code (subitem)</summary>

```
+++
weight = 10
#disabled = true
[asset]
icon = "fas fa-random"
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/content/fragments/items/code-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ subtitle= "Column based items with icons"

<details>
<summary>Code (subitem)</summary>

```
+++
title = "Column 1"
weight = 10
#disabled = true
[asset]
icon = "fas fa-random"
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/content/fragments/items/code-logos-no-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ subtitle= "Column based items with images"

<details>
<summary>Code (subitem)</summary>

```
+++
weight = 10
#disabled = true
[asset]
image = "caddy.svg"
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/content/fragments/items/code-logos-only.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ background = "secondary"

<details>
<summary>Code (subitem)</summary>

```
+++
weight = 10
#disabled = true
[asset]
image = "caddy.svg"
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/content/fragments/items/code-logos.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ subtitle= "Column based items with images"

<details>
<summary>Code (subitem)</summary>

```
+++
title = "Column 1"
weight = 10
#disabled = true
[asset]
image = "caddy.svg"
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/content/fragments/member/code-members.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ title = "Members fragment - Multiple members"

<details>
<summary>Code (subitem)</summary>

```
+++
title = "Huge Gopher"
weight = 0
date = "2017-10-17"
#disabled = true
position = "Lead Gopherineer"
reports_to = "CTO"
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/content/fragments/member/code-single-member.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ title = "Single Member Fragment"

<details>
<summary>Code (subitem)</summary>

```
+++
title = "Huge Gopher"
weight = 0
date = "2017-10-17"
#disabled = true
position = "Lead Gopherineer"
company = "Okkur Labs"
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/content/fragments/portfolio/code-portfolio.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ subtitle = "Displaying animals with links and modals"

<details>
<summary>Code (subitem)</summary>

```
+++
weight = 10
title = "First Title"
subtitle = "Lorem ipsum dolor sit amet, consectetur adipiscing"
item_url = "#"
#disabled = true
[asset]
image = "cat-1.jpeg"
Expand Down
3 changes: 3 additions & 0 deletions exampleSite/content/fragments/pricing/code-pricing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ weight = 111

<details>
<summary>Code (index)</summary>

```
+++
fragment = "pricing"
Expand All @@ -23,9 +24,11 @@ Supports feature listing of different plans and links to a payment service.

<details>
<summary>Code (subitem)</summary>

```
+++
weight = 10
# disabled = true
title = "Starting plan"
subtitle = "starting at"
Expand Down
4 changes: 3 additions & 1 deletion layouts/partials/helpers/subitems.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

{{- $page_scratch.Set "tmp_subitems" slice -}}
{{- range ($page_scratch.Get "tmp_items") -}}
{{- $page_scratch.Add "tmp_subitems" (dict "Name" (replaceRE "[\\/\\.]" "-" .Name) "Params" .Params "File" .File "ResourceType" .ResourceType "Title" .Title "Permalink" .Permalink "RelPermalink" .RelPermalink "Content" .Content "MediaType" .MediaType "MediaType.MainType" .MediaType.MainType "MediaType.SubType" .MediaType.SubType "MediaType.Suffixes" .MediaType.Suffixes) -}}
{{- if not .Params.disabled -}}
{{- $page_scratch.Add "tmp_subitems" (dict "Name" (replaceRE "[\\/\\.]" "-" .Name) "Params" .Params "File" .File "ResourceType" .ResourceType "Title" .Title "Permalink" .Permalink "RelPermalink" .RelPermalink "Content" .Content "MediaType" .MediaType "MediaType.MainType" .MediaType.MainType "MediaType.SubType" .MediaType.SubType "MediaType.Suffixes" .MediaType.Suffixes) -}}
{{- end -}}
{{- end -}}

{{- return ($page_scratch.Get "tmp_subitems") -}}

0 comments on commit 06699cd

Please sign in to comment.