Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
6
6sem-practice
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Исайчев Данила Олегович
6sem-practice
Commits
c636aef2
Commit
c636aef2
authored
Mar 09, 2022
by
Исайчев Данила Олегович
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
0975b0f2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
accordion.html
accordion/accordion.html
+40
-0
No files found.
accordion/accordion.html
0 → 100644
View file @
c636aef2
{{ $filename := add (add "shortcodes/accordion-" (.Get "number")) ".json" }}
{{ with .Site.GetPage .Page.File.Path }}
{{ $resource := (.Resources.GetMatch $filename).RelPermalink }}
{{ $fields := getJSON "content" $resource }}
<div
class=
"accordion"
id=
"accordionExample"
>
{{$counter := 0}}
{{ range $fields}}
{{ $heading := add "heading" (string $counter) }}
{{ $collapse := add "collapse" (string $counter) }}
<div
class=
"accordion-item"
>
<div
class=
"accordion-header"
id=
"{{$heading}}"
>
<a
class=
"accordion-button collapsed"
role=
"button"
data-bs-toggle=
"collapse"
data-bs-target=
"#{{$collapse}}"
aria-expanded=
"false"
aria-controls=
"{{$collapse}}"
>
{{ .title }}
</a>
</div>
<div
id=
"{{$collapse}}"
class=
"accordion-collapse collapse"
aria-labelledby=
"{{$heading}}"
data-bs-parent=
"#accordionExample"
>
<div
class=
"accordion-body"
>
{{ if reflect.IsSlice .content }}
{{ range .content }}
<p>
{{ . }}
</p>
{{ end }}
{{ else }}
{{ .content }}
{{ end }}
</div>
</div>
</div>
{{$counter = add $counter 1}}
{{ end }}
</div>
{{end}}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment