Skip to content

Commit ffecfad

Browse files
committed
ListPage: Add mf list page
Disable default card list view if there is any content in the _index.md. This also requires a change in the documentation repo, where they sometimes overwrite the list and list-main pages.
1 parent 398ac25 commit ffecfad

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

layouts/_default/list.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
</nav>
1919
</div>
2020

21-
22-
2321
<section class="content-layout" data-mf="true" style="display: none">
2422
<section class="breadcrumb-layout">
2523
{{ if not .IsHome }}
@@ -32,6 +30,14 @@
3230
<h1>{{ .Title }}</h1>
3331
{{ .Content }}
3432

33+
{{ if (lt .WordCount 1) }}
34+
{{ range .Pages.ByWeight }}
35+
<h2>
36+
<a href="{{ if .Params.url}}{{ .Params.url}}{{else}}{{ .Permalink }}{{end}}">{{ .Title }}</a>
37+
</h2>
38+
{{ end }}
39+
{{end}}
40+
3541
<hr>
3642
{{ if .Page.Lastmod }}
3743
<div class="last-modified">

layouts/partials/list-main.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ <h1 class="bd-title">
1111
{{ end }}
1212
</div>
1313
</div>
14-
14+
{{ if lt .WordCount 1 }}
1515
<section class="col-md-12 col-xl-12 py-md-3 pl-md-5" id="section-content-list">
1616

1717
<div class="row">
@@ -29,6 +29,7 @@ <h3 class="card-title">
2929
</div>
3030
</div>
3131
</section>
32+
{{ end }}
3233
</div>
3334

3435

layouts/partials/sidebar-v2.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
(dict "title" "NGINX Ingress Controller" "url" "/nginx-ingress-controller" "type" "nginx-one")
66
(dict "title" "NGINX Gateway Fabric" "url" "/nginx-gateway-fabric" "type" "nginx-one")
77
(dict "title" "NGINX Open Source" "url" "https://nginx.org/en/docs/" "type" "nginx-one")
8+
(dict "title" "Subscription Licensing & Solutions" "url" "/solutions/" "type" "nginx-one")
89
(dict "title" "NGINX Agent" "url" "/nginx-agent" "type" "nginx-one")
910
(dict "title" "NGINX App Protect WAF" "url" "/nginx-app-protect-waf" "type" "nginx-app-protect")
1011
(dict "title" "NGINX App Protect DoS" "url" "/nginx-app-protect-dos" "type" "nginx-app-protect")

0 commit comments

Comments
 (0)