Skip to content

Commit

Permalink
data.GetJSON was deprecated in Hugo v0.123.0
Browse files Browse the repository at this point in the history
  • Loading branch information
simeononsecurity committed Dec 28, 2024
1 parent ce63657 commit 02384fc
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 19 deletions.
8 changes: 5 additions & 3 deletions layouts/section/a_plus_quiz.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{{- range $index, $faq := (getJSON "static/quiz-dicts/aplusdict.json") }}
{{- $faqData := resources.Get "static/quiz-dicts/aplusdict.json" | transform.Unmarshal -}}
{{- range $index, $faq := $faqData }}
{
"@type": "Question",
"name": "Question {{ add $index 1 }}: {{ $faq.question }}",
"acceptedAnswer": {
"@type": "Answer",
"text": "{{ $faq.reasoning }}"
}
},
}{{ if lt (add $index 1) (len $faqData) }},{{ end }}
{{- end }}
]
}
</script>
</script>

{{ partialCached "breadcrumbs.html" . .Page}}

<h1 class="post-title">
Expand Down
7 changes: 4 additions & 3 deletions layouts/section/ceh_quiz.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{{- range $index, $faq := (getJSON "static/quiz-dicts/cehdict.json") }}
{{- $faqData := resources.Get "static/quiz-dicts/cehdict.json" | transform.Unmarshal -}}
{{- range $index, $faq := $faqData }}
{
"@type": "Question",
"name": "Question {{ add $index 1 }}: {{ $faq.question }}",
"acceptedAnswer": {
"@type": "Answer",
"text": "{{ $faq.reasoning }}"
}
},
}{{ if lt (add $index 1) (len $faqData) }},{{ end }}
{{- end }}
]
}
</script>
</script>
{{ partialCached "breadcrumbs.html" . .Page}}

<h1 class="post-title">
Expand Down
9 changes: 5 additions & 4 deletions layouts/section/cissp_quiz.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ define "main" }}
s{{ define "main" }}
{{ $style := resources.Get "style-append.css" | resources.Minify }}
<link rel="preload" href="{{ $style.Permalink }}" as="style" fetchpriority="low" onload="this.onload=null;this.rel='stylesheet'">

Expand All @@ -9,19 +9,20 @@
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{{- range $index, $faq := (getJSON "static/quiz-dicts/cisspdict.json") }}
{{- $faqData := resources.Get "static/quiz-dicts/cisspdict.json" | transform.Unmarshal -}}
{{- range $index, $faq := $faqData }}
{
"@type": "Question",
"name": "Question {{ add $index 1 }}: {{ $faq.question }}",
"acceptedAnswer": {
"@type": "Answer",
"text": "{{ $faq.reasoning }}"
}
},
}{{ if lt (add $index 1) (len $faqData) }},{{ end }}
{{- end }}
]
}
</script>
</script>
{{ partialCached "breadcrumbs.html" . .Page}}

<h1 class="post-title">
Expand Down
7 changes: 4 additions & 3 deletions layouts/section/linux_plus_quiz.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{{- range $index, $faq := (getJSON "static/quiz-dicts/linuxplusdict.json") }}
{{- $faqData := resources.Get "static/quiz-dicts/linuxplusdict.json" | transform.Unmarshal -}}
{{- range $index, $faq := $faqData }}
{
"@type": "Question",
"name": "Question {{ add $index 1 }}: {{ $faq.question }}",
"acceptedAnswer": {
"@type": "Answer",
"text": "{{ $faq.reasoning }}"
}
},
}{{ if lt (add $index 1) (len $faqData) }},{{ end }}
{{- end }}
]
}
</script>
</script>
{{ partialCached "breadcrumbs.html" . .Page}}

<h1 class="post-title">
Expand Down
7 changes: 4 additions & 3 deletions layouts/section/network_plus_quiz.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{{- range $index, $faq := (getJSON "static/quiz-dicts/netplusdict.json") }}
{{- $faqData := resources.Get "static/quiz-dicts/netplusdict.json" | transform.Unmarshal -}}
{{- range $index, $faq := $faqData }}
{
"@type": "Question",
"name": "Question {{ add $index 1 }}: {{ $faq.question }}",
"acceptedAnswer": {
"@type": "Answer",
"text": "{{ $faq.reasoning }}"
}
},
}{{ if lt (add $index 1) (len $faqData) }},{{ end }}
{{- end }}
]
}
</script>
</script>
{{ partialCached "breadcrumbs.html" . .Page}}

<h1 class="post-title">
Expand Down
8 changes: 5 additions & 3 deletions layouts/section/security_plus_quiz.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{{- range $index, $faq := (getJSON "static/quiz-dicts/secplusdict.json") }}
{{- $faqData := resources.Get "static/quiz-dicts/secplusdict.json" | transform.Unmarshal -}}
{{- range $index, $faq := $faqData }}
{
"@type": "Question",
"name": "Question {{ add $index 1 }}: {{ $faq.question }}",
"acceptedAnswer": {
"@type": "Answer",
"text": "{{ $faq.reasoning }}"
}
},
}{{ if lt (add $index 1) (len $faqData) }},{{ end }}
{{- end }}
]
}
</script>
</script>
</main>
{{ partialCached "breadcrumbs.html" . .Page}}

<h1 class="post-title">
Expand Down

0 comments on commit 02384fc

Please sign in to comment.