{{- $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 }} {{ if $showLanguage }}{{ end }} {{ if $showClass }}{{ end }} {{ if $showCategory }}{{ end }} {{/* */}} {{ if $showSeverity }}{{ end }} {{ if $showPersona }}{{ end }} {{ if $showLifecycle }}{{ end }} {{- $index := 0 -}} {{- range $sortedPages -}} {{- $index = add $index 1 -}} {{- $page := .page -}} {{- $file := .file -}} {{- $pageTags := $page.Params.tags -}} {{- $showPage := default true $page.Params.showPage -}} {{- if $showPage -}} {{- $titleParts := split $page.Params.title " - " -}} {{- $id := index $titleParts 0 -}} {{- $title := "" -}} {{- $separator := "" -}} {{- range $i, $part := $titleParts -}} {{- if gt $i 0 -}} {{- $title = printf "%s%s%s" $title $separator $part -}} {{- $separator = " - " -}} {{- end -}} {{- end -}} {{- $language := slice -}} {{- $class := slice -}} {{- $category := slice -}} {{/* {{- $type := slice -}} */}} {{- $severity := slice -}} {{- $persona := slice -}} {{- $lifecycle := slice -}} {{- range $pageTags -}} {{- $parts := split . "-" -}} {{- $key := index $parts 0 -}} {{- $value := index $parts 1 -}} {{- if eq $key "Language" -}} {{- $language = $language | append $value -}} {{- else if eq $key "Class" -}} {{- $class = $class | append $value -}} {{- else if eq $key "Category" -}} {{- $category = $category | append $value -}} {{/* {{- else if eq $key "Type" -}} {{- $type = $type | append $value -}} */}} {{- else if eq $key "Severity" -}} {{- $severity = $severity | append $value -}} {{- else if eq $key "Persona" -}} {{- $persona = $persona | append $value -}} {{- else if eq $key "Lifecycle" -}} {{- $lifecycle = $lifecycle | append $value -}} {{- end -}} {{- end -}} {{- $link := replaceRE "^-" "#" (index (findRE `^\s*##\s.+` $page.RawContent) 0 | anchorize) -}} {{ if $showLanguage }}{{ end }} {{ if $showClass }}{{ end }} {{ if $showCategory }}{{ end }} {{/* */}} {{ if $showSeverity }}{{ end }} {{ if $showPersona }}{{ end }} {{ if $showLifecycle }}{{ end }} {{- end -}} {{- end -}}
# ID TitleLanguageClassCategoryTypeSeverityPersonaLifecycle
{{- $index -}} {{- $id -}} {{- $title -}}{{ range $language }}{{ . }}{{ end }}{{ range $class }}{{ . }}{{ end }}{{ range $category }}{{ . }}{{ end }}{{ range $type }}{{ . }}{{ if not (eq (index $type (sub (len $type) 1)) .) }}, {{ end }}{{ end }}{{ range $severity }}{{ . }}{{ end }}{{ range $persona }}{{ . }}{{ end }}{{ range $lifecycle }}{{ . }}{{ end }}
{{- $content := "" -}} {{- range $sortedPages -}} {{- $page := .page -}} {{- $file := .file -}} {{- $pageTags := $page.Params.tags -}} {{- $showPage := default true $page.Params.showPage -}} {{/* {{- $specURL := replace (printf "%s%s" $baseURL $page.Params.url) "//" "/" -}} */}} {{- $specURL := printf "%s%s" $baseURL (replaceRE "^/" "" $page.Params.url) -}} {{- with $page -}} {{- if $showPage -}} {{- if $showPageTags -}} {{- $content = add $content (partial "showPageTags" (dict "pageTags" $pageTags "baseURL" $baseURL)) -}} {{- end -}} {{/* See origin... */}} {{- $content = add $content ( add ("See origin..." ) -}} {{/* See origin... */}} {{/* {{- .Content | .RenderString | safeHTML -}} */}} {{- $content = add $content (.Content | .RenderString | safeHTML) -}} {{- $content = add $content "


" -}} {{/*


*/}} {{- end -}} {{- end -}} {{- end -}} {{- if $summarize -}} {{ partial "shortcodes/expand.html" (dict "page" . "title" "➕ See Specifications for this category" "content" $content "expanded" $summaryOpenByDefault) }} {{- else -}}
{{- $content | safeHTML -}} {{- end -}} {{- end -}}