{{- $folder := .Get "folder" -}} {{- $tags := split (.Get "tags") "," -}} {{- $baseURL := $.Site.BaseURL -}} {{- $recursive := default false (.Get "recursive") -}} {{- $strict := default false (.Get "strict") -}} {{- $allFiles := slice -}} {{- $showPageTags := default true (.Get "showPageTags") -}} {{- $showHint := default false (.Get "showHint") -}} {{- $hintText := default "" (.Get "hintText") -}} {{- $chapterTitle := default "" (.Get "chapterTitle") -}} {{- $hintType := default "note" (.Get "hintType") -}} {{- $hintIcon := .Get "icon" -}} {{/* {{- $hintTitle := default ($hintType | title) (.Get "hintTitle") -}} */}} {{- $summarize := default false (.Get "summarize") -}} {{- $summaryOpenByDefault := default true (.Get "summaryOpenByDefault") -}} {{- $showLanguage := true -}} {{- $showClass := true -}} {{- $showCategory := true -}} {{- $showSeverity := true -}} {{- $showPersona := true -}} {{- $showLifecycle := true -}} {{ range $tags }} {{ if (findRE `^Language-` .) }} {{ $showLanguage = false }} {{ else if (findRE `^Class-` .) }} {{ $showClass = false }} {{ else if (findRE `^Category-` .) }} {{ $showCategory = false }} {{ else if (findRE `^Severity-` .) }} {{ $showSeverity = false }} {{ else if (findRE `^Persona-` .) }} {{ $showPersona = false }} {{ else if (findRE `^Lifecycle-` .) }} {{ $showLifecycle = false }} {{ end }} {{ end }} {{ if $chapterTitle }} {{ (printf "## %s" $chapterTitle) | markdownify }} {{ end }} {{- if $recursive -}} {{- $allFiles = partial "readDirRecursive" (dict "path" $folder "allFiles" $allFiles) -}} {{- else -}} {{- $entries := readDir $folder -}} {{- range $entries -}} {{- $allFiles = $allFiles | append (printf "%s/%s" $folder .Name) -}} {{- end -}} {{- end -}} {{- $pages := slice -}} {{- range $allFiles -}} {{- $file := replace . "content/" "" -}} {{- $page := site.GetPage $file -}} {{- $pageTags := $page.Params.tags -}} {{- if $page -}} {{- $addPageToList := true -}} {{- if $strict -}} {{- if not (eq (len $tags) (len $pageTags)) -}} {{- $addPageToList = false -}} {{- else -}} {{- range $tags -}} {{- if not (in $pageTags .) -}} {{- $addPageToList = false -}} {{- end -}} {{- end -}} {{- end -}} {{- else -}} {{- range $tags -}} {{- if not (in $pageTags .) -}} {{- $addPageToList = false -}} {{- end -}} {{- end -}} {{- end -}} {{- if $addPageToList -}} {{- $priority := default 10000 $page.Params.priority -}} {{- $pages = $pages | append (dict "page" $page "priority" $priority "file" $file) -}} {{- else -}} {{- end -}} {{- end -}} {{- end -}} {{- $tagsToShow := "" -}} {{ range sort $tags }} {{/* */}} {{/* {{ $tagsToShow = add $tagsToShow (add "" {{ . }} ")" }} */}} {{/* {{ $tagsToShow = add $tagsToShow (add "" . "") }} */}} {{ $tagsToShow = add $tagsToShow (add "") }} {{ end }} {{- if eq (len $pages) 0 -}} {{ partial "shortcodes/notice.html" (dict "page" . "style" "note" "title" "No specifications available for this criteria" "content" $tagsToShow )}} {{- else -}} {{- $sortedPages := sort $pages "priority" "asc" -}} {{ if $showHint }} {{ partial "shortcodes/notice.html" (dict "page" . "style" "code" "title" "The content below is listed based on the following tags" "content" (add " " $tagsToShow) )}} {{ end }}
| # | ID | Title | {{ if $showLanguage }}Language | {{ end }} {{ if $showClass }}Class | {{ end }} {{ if $showCategory }}Category | {{ end }} {{/*Type | */}} {{ if $showSeverity }}Severity | {{ end }} {{ if $showPersona }}Persona | {{ end }} {{ if $showLifecycle }}Lifecycle | {{ end }}
|---|---|---|---|---|---|---|---|---|---|
| {{- $index -}} | {{- $id -}} | {{- $title -}} | {{ if $showLanguage }}{{ range $language }}{{ end }} | {{ end }} {{ if $showClass }}{{ range $class }}{{ end }} | {{ end }} {{ if $showCategory }}{{ range $category }}{{ end }} | {{ end }} {{/*{{ range $type }}{{ if not (eq (index $type (sub (len $type) 1)) .) }}, {{ end }}{{ end }} | */}} {{ if $showSeverity }}{{ range $severity }}{{ end }} | {{ end }} {{ if $showPersona }}{{ range $persona }}{{ end }} | {{ end }} {{ if $showLifecycle }}{{ range $lifecycle }}{{ end }} | {{ end }}