+
{{ partial $widget_path $params }}
diff --git a/layouts/partials/widgets/pages.html b/layouts/partials/widgets/pages.html
new file mode 100644
index 00000000..4cef5906
--- /dev/null
+++ b/layouts/partials/widgets/pages.html
@@ -0,0 +1,93 @@
+{{/* Pages Widget */}}
+
+{{/* Initialise */}}
+{{ $ := .root }}
+{{ $st := .page }}
+{{ $items_type := $st.Params.content.page_type | default "post" }}
+{{ $items_offset := $st.Params.content.offset | default 0 }}
+{{ $items_count := $st.Params.content.count | default 5 }}
+{{ $items_sort := $st.Params.content.order| default "desc" }}
+
+{{/* Query */}}
+{{ $query := where $.Site.RegularPages "Type" $items_type }}
+{{ $archive_page := $.Site.GetPage "Section" $items_type }}
+
+{{/* Filters */}}
+{{ if $st.Params.content.filters.tag }}
+ {{ $archive_page = $.Site.GetPage (printf "tags/%s" $st.Params.filters.content.tag) }}
+ {{ $query = $query | intersect $archive_page.Pages }}
+{{ end }}
+{{ if $st.Params.content.filters.category }}
+ {{ $archive_page = $.Site.GetPage (printf "categories/%s" $st.Params.filters.content.category) }}
+ {{ $query = $query | intersect $archive_page.Pages }}
+{{ end }}
+{{ if $st.Params.content.filters.publication_type }}
+ {{ $archive_page = $.Site.GetPage (printf "publication_types/%s" $st.Params.content.filters.publication_type) }}
+ {{ $query = $query | intersect $archive_page.Pages }}
+{{ end }}
+{{ if $st.Params.content.filters.exclude_featured }}
+ {{ $query = where $query "Params.featured" "!=" true }}
+{{ end }}
+
+{{/* Offset */}}
+{{ if gt $items_offset 0 }}
+ {{ $query = first $items_count (after $items_offset $query) }}
+{{ else }}
+ {{ $query = first $items_count $query }}
+{{ end }}
+
+{{/* Sort */}}
+{{ $sort_by := "" }}
+{{ if eq $items_type "talk" }}
+ {{ $sort_by = "Params.time_start" }}
+{{ else }}
+ {{ $sort_by = "Date" }}
+{{ end }}
+
+{{ $query = sort $query $sort_by $items_sort }}
+{{ $count := len $query }}
+
+{{/* Localisation */}}
+{{ $i18n := "" }}
+{{ if eq $items_type "post" }}
+ {{ $i18n = "more_posts" }}
+{{ else if eq $items_type "talk" }}
+ {{ $i18n = "more_talks" }}
+{{ else if eq $items_type "publication" }}
+ {{ $i18n = "more_publications" }}
+{{ else }}
+ {{ $i18n = "more_pages" }}
+{{ end }}
+
+
+
+
{{ with $st.Title }}{{ . | markdownify | emojify }}{{ end }}
+ {{ with $st.Params.subtitle }}
{{ . | markdownify | emojify }}
{{ end }}
+
+
+
+ {{ with $st.Content }}
{{ . }}
{{ end }}
+
+ {{ range $post := $query }}
+ {{ if eq $st.Params.design.view 1 }}
+ {{ partial "li_list" . }}
+ {{ else if eq $st.Params.design.view 3 }}
+ {{ partial "li_card" . }}
+ {{ else if eq $st.Params.design.view 3 | and (eq $st.Type "publication") }}
+ {{ partial "li_citation" . }}
+ {{ else }}
+ {{ partial "li_compact" . }}
+ {{ end }}
+ {{end}}
+
+ {{ if gt $count $items_count }}
+
+ {{ end }}
+
+
+
diff --git a/layouts/partials/widgets/posts.html b/layouts/partials/widgets/posts.html
deleted file mode 100644
index 0bc2257a..00000000
--- a/layouts/partials/widgets/posts.html
+++ /dev/null
@@ -1,48 +0,0 @@
-{{ $ := .root }}
-{{ $page := .page }}
-
-{{ $query := where (where $.Site.RegularPages "Type" "post") ".Params.notonhomepage" nil }}
-{{ $archive_page := $.Site.GetPage "section" "post" }}
-
-{{/* Check if a filter should be applied. */}}
-{{ if $page.Params.filter_tag }}
- {{ $archive_page = $.Site.GetPage (printf "tags/%s" $page.Params.filter_tag) }}
- {{ $query = $query | intersect $archive_page.Pages }}
-{{ else if $page.Params.filter_category }}
- {{ $archive_page = $.Site.GetPage (printf "categories/%s" $page.Params.filter_category) }}
- {{ $query = $query | intersect $archive_page.Pages }}
-{{ end }}
-
-{{ $count := len $query }}
-
-
-
-
-
{{ with $page.Title }}{{ . | markdownify }}{{ end }}
- {{ with $page.Params.subtitle }}
{{ . | markdownify }}
{{ end }}
-
-
-
- {{ with $page.Content }}
{{ . | markdownify }}
{{ end }}
-
- {{ range $post := first $page.Params.count $query }}
- {{ if eq $page.Params.view 1 }}
- {{ partial "li_list" . }}
- {{ else if eq $page.Params.view 3 }}
- {{ partial "li_card" . }}
- {{ else }}
- {{ partial "li_compact" . }}
- {{ end }}
- {{end}}
-
- {{ if gt $count $page.Params.count }}
-
- {{ end }}
-
-
-
diff --git a/layouts/partials/widgets/publications.html b/layouts/partials/widgets/publications.html
deleted file mode 100644
index d9fb7e70..00000000
--- a/layouts/partials/widgets/publications.html
+++ /dev/null
@@ -1,45 +0,0 @@
-{{ $ := .root }}
-{{ $page := .page }}
-
-{{ $query := where $.Site.RegularPages "Type" "publication" }}
-{{ if and ($page.Params.publication_type) (ne $page.Params.publication_type "-1") }}
- {{ $query = where $query ".Params.publication_types" "intersect" (slice $page.Params.publication_type) }}
-{{ end }}
-{{ if $page.Params.exclude_featured }}
- {{ $query = $query | intersect (where (where $.Site.RegularPages "Type" "publication") ".Params.featured" "!=" true) }}
-{{ end }}
-
-{{ $count := len $query }}
-
-
-
-
-
{{ with $page.Title }}{{ . | markdownify }}{{ end }}
- {{ with $page.Params.subtitle }}
{{ . | markdownify }}
{{ end }}
-
-
- {{ with $page.Content }}
{{ . | markdownify }}
{{ end }}
-
- {{ range first $page.Params.count $query }}
- {{ if eq $page.Params.view 1 }}
- {{ partial "li_list" . }}
- {{ else if eq $page.Params.view 3 }}
- {{ partial "li_card" . }}
- {{ else if eq $page.Params.view 4 }}
- {{ partial "li_citation" . }}
- {{ else }}
- {{ partial "li_compact" . }}
- {{ end }}
- {{ end }}
-
- {{ if gt $count $page.Params.count }}
-
- {{ end }}
-
-
-
diff --git a/layouts/partials/widgets/talks.html b/layouts/partials/widgets/talks.html
deleted file mode 100644
index e2b377e6..00000000
--- a/layouts/partials/widgets/talks.html
+++ /dev/null
@@ -1,41 +0,0 @@
-{{ $ := .root }}
-{{ $page := .page }}
-{{ $count := len (where $.Site.RegularPages "Type" "talk") }}
-
-
-
-
-
{{ with $page.Title }}{{ . | markdownify }}{{ end }}
- {{ with $page.Params.subtitle }}
{{ . | markdownify }}
{{ end }}
-
-
- {{ with $page.Content }}
{{ . | markdownify }}
{{ end }}
-
- {{ $talks := where $.Site.RegularPages "Type" "talk" }}
-
- {{/* Exclude talks shown in Featured Talks widget? */}}
- {{ if $page.Params.exclude_featured }}
- {{ $talks = (where $talks ".Params.featured" "!=" true) }}
- {{ end }}
-
- {{ range first $page.Params.count (sort $talks ".Params.time_start" "desc") }}
- {{ if eq $page.Params.view 1 }}
- {{ partial "li_list" . }}
- {{ else if eq $page.Params.view 3 }}
- {{ partial "li_card" . }}
- {{ else }}
- {{ partial "li_compact" . }}
- {{ end }}
- {{ end }}
-
- {{ if gt $count $page.Params.count }}
-
- {{ end }}
-
-
-