{{- define "main" -}}
{{ partial "components/sidebar.html" (dict "context" . "no_sidebar" false) }}
{{ if (.Params.show_breadcrumb | default true) }}
{{ partial "components/breadcrumb.html" . }}
{{ end }}

{{ .Title }}

{{ with .Content }} {{ . }} {{ end }}
{{/* Search box for Q&A - Integrated with Pagefind */}} {{ if site.Params.hugoblox.search.enable }}
{{ end }} {{/* Category filter */}} {{ $categories := .Site.Taxonomies.categories }} {{ if $categories }}

{{ T "browse_by_category" | default "Browse by Category" }}

{{ T "all" | default "All" }} {{ range $name, $taxonomy := $categories }} {{ $name }} ({{ $taxonomy.Count }}) {{ end }}
{{ end }} {{/* Q&A List */}} {{ $pages := .Pages }} {{ if .Params.sort_by }} {{ if eq .Params.sort_by "date" }} {{ $pages = .Pages.ByDate.Reverse }} {{ else if eq .Params.sort_by "title" }} {{ $pages = .Pages.ByTitle }} {{ else if eq .Params.sort_by "weight" }} {{ $pages = .Pages.ByWeight }} {{ end }} {{ else }} {{ $pages = .Pages.ByDate.Reverse }} {{ end }} {{ if eq (len $pages) 0 }}

{{ T "no_questions_yet" | default "No questions yet. Check back soon!" }}

{{ end }} {{ partial "components/paginator" . }}
{{- end -}}