generated from nginx/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 3
Added banner to list if front matter is present #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
720ed00
List: Added banner to list if front matter is present
lamATnginx 388b669
List: Updated list-main from documentation repo
lamATnginx c3f2c80
List: Updated list files + added new banner shortcode
lamATnginx ab57124
List: Added date checker + moved to partial + added banner to every page
lamATnginx 52e069b
List: Added error to build if md is not provided
lamATnginx 6dc69b3
List: Change to readFile
lamATnginx 267fb49
List: Moved banner to inside page header
lamATnginx ab547ea
List: Changed to use callout partial in banner partial
lamATnginx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,106 @@ | ||
<div class="list-page"> | ||
<div class="col-md-12 col-xl-12 py-md-3 pl-md-5"> | ||
{{ $PageTitle := .Title }} | ||
<div class="col-md-12 col-xl-12 py-md-3" style="margin-left: -1.75em;"> | ||
<div class="page-header list"> | ||
<h1 class="bd-title"> | ||
{{ .Title }} | ||
</h1> | ||
{{ if .Description }} | ||
<p> | ||
{{ .Description | markdownify }} | ||
</p> | ||
{{ end}} | ||
{{ if .Content }} | ||
<p class="bd-lead"> | ||
<p> | ||
{{ .Content | markdownify }} | ||
</p> | ||
{{ end }} | ||
</div> | ||
</div> | ||
{{ if lt .WordCount 1 }} | ||
<section class="col-md-12 col-xl-12 py-md-3 pl-md-5" id="section-content-list"> | ||
|
||
|
||
{{- with .Params.banner -}} | ||
{{- if .enabled -}} | ||
<div class="banner banner-{{ .type }}"> | ||
{{ partial .md . }} | ||
</div> | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{ if or (lt .WordCount 1) (eq $PageTitle "F5 NGINX One Console") (eq $PageTitle "F5 NGINX App Protect DoS") (eq $PageTitle "F5 NGINX Plus") }} | ||
<section> | ||
<div class="row"> | ||
<div class="card-deck"> | ||
{{ range .Pages.ByWeight }} | ||
<div class="col-md-5 card"> | ||
<div class="card-body"> | ||
<h3 class="card-title"> | ||
<i class="fas fa-{{if eq .Kind "page"}}file-alt{{else}}book{{end}} fa-2x card-img-top"></i> | ||
<a href="{{ if .Params.url}}{{ .Params.url}}{{else}}{{ .Permalink }}{{end}}">{{ .Title }}</a> | ||
</h3> | ||
<div class="card-deck"> | ||
{{ range .Pages.GroupBy "Section" }} | ||
{{ range .Pages.ByWeight }} | ||
<div class="col-md-5 card"> | ||
<div class="card-body"> | ||
<h3 class="card-title" style="display: flex; align-items: center; gap: 5px;"> | ||
<i class="fas fa-{{if eq .Kind "page"}}file-alt{{else}}book{{end}} fa-lg card-img-top"></i> | ||
<a href="{{ if .Params.url}}{{ .Params.url}}{{else}}{{ .Permalink }}{{end}}">{{ .Title }}</a> | ||
</h3> | ||
{{ if and (eq $PageTitle "F5 NGINX One Console") (eq .Title "How-to guides") }} | ||
<ul style="padding-top: 10px;"> | ||
{{ range .Pages }} | ||
{{ if eq .Kind "section" }} | ||
{{ range .Pages }} | ||
<li><a href="{{ .Permalink }}"> {{ .Title }}</a></li> | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
</ul> | ||
{{ end }} | ||
{{ if and (eq $PageTitle "F5 NGINX One Console") (eq .Title "API")}} | ||
<ul style="padding-top: 10px;"> | ||
{{ range .Pages }} | ||
<li><a href="{{ .Permalink }}"> {{ .Title }}</a></li> | ||
{{ end }} | ||
</ul> | ||
{{ end }} | ||
{{ if and (eq $PageTitle "F5 NGINX One Console") (eq .Title "Changelog") }} | ||
{{ partial "changelog-date.html" . }} | ||
{{ end }} | ||
</div> | ||
</div> | ||
</div> | ||
{{ end }} | ||
{{ end }} | ||
</div> | ||
{{ if eq $PageTitle "F5 NGINX One Console" }} | ||
<h1 class="bd-title" style="margin-top: 15px;">Other Products</h1> | ||
{{ $nginxProducts := slice | ||
(dict "title" "NGINX Instance Manager" "url" "/nginx-instance-manager" "imgSrc" "NGINX-Instance-Manager-product-icon" "type" "local-console-option" "description" "Track and control NGINX Open Source and NGINX Plus instances.") | ||
(dict "title" "NGINX Ingress Controller" "url" "/nginx-ingress-controller" "imgSrc" "NGINX-Ingress-Controller-product-icon" "type" "kubernetes-solutions" "description" "Kubernetes traffic management with API gateway, identity, and observability features.") | ||
(dict "title" "NGINX Gateway Fabric" "url" "/nginx-gateway-fabric" "imgSrc" "NGINX-product-icon" "type" "kubernetes-solutions" "description" "Next generation Kubernetes connectivity using the Gateway API.") | ||
(dict "title" "NGINX App Protect WAF" "url" "/nginx-app-protect-waf" "imgSrc" "NGINX-App-Protect-WAF-product-icon" "type" "security" "description" "Lightweight, high-performance, advanced protection against Layer 7 attacks on your apps and APIs.") | ||
(dict "title" "NGINX App Protect DoS" "url" "/nginx-app-protect-dos" "imgSrc" "NGINX-App-Protect-DoS-product-icon" "type" "security" "description" "Defend, adapt, and mitigate against Layer 7 denial-of-service attacks on your apps and APIs.") | ||
(dict "title" "NGINX Plus" "url" "/nginx" "imgSrc" "NGINX-Plus-product-icon-RGB" "type" "modern-app-delivery" "description" "The all-in-one load balancer, reverse proxy, web server, content cache, and API gateway.") | ||
(dict "title" "NGINX Open Source" "url" "https://nginx.org/en/docs/" "imgSrc" "NGINX-product-icon" "type" "modern-app-delivery" "description" "The open source all-in-one load balancer, content cache, and web server") | ||
}} | ||
{{ $groupedProducts := dict | ||
"local-console-option" (where $nginxProducts "type" "local-console-option") | ||
"kubernetes-solutions" (where $nginxProducts "type" "kubernetes-solutions") | ||
"security" (where $nginxProducts "type" "security") | ||
"modern-app-delivery" (where $nginxProducts "type" "modern-app-delivery") | ||
}} | ||
{{ range $type, $products := $groupedProducts }} | ||
<div class="card-deck"> | ||
<p style="margin-left: 15px; width: 100%; font-weight: bold;">{{ $type | humanize | title }}</p> | ||
{{ range $products }} | ||
<div class="card" style="margin-top: 0px; {{ if eq (len $products) 1 }}max-width: calc(50% - 30px);{{ else }}min-width: 40%;{{ end }}"> | ||
<div class="card-body"> | ||
<h3 class="card-title" style="display: flex; align-items: center;"> | ||
<img class="card-img-top" src="{{ .Site.BaseURL }}/images/icons/{{ .imgSrc }}.png"/> | ||
<a href="{{ if eq .title "NGINX Open Source" }}{{ .url }}{{ else }}{{ .Site.BaseURL }}{{ .url }}{{ end }}">{{ .title }}</a> | ||
</h3> | ||
<p > | ||
{{ if .description }}{{ .description | markdownify }}{{ end }} | ||
</p> | ||
</div> | ||
</div> | ||
{{ end }} | ||
</div> | ||
{{ end }} | ||
</div> | ||
</div> | ||
{{ end }} | ||
</div> | ||
</section> | ||
{{ end }} | ||
</div> | ||
|
||
|
||
{{ if not .IsHome }} | ||
<div class="row justify-content-center"> | ||
{{ partial "pagination.html" . }} | ||
</div> | ||
{{ end }} | ||
|
||
|
||
{{end}} | ||
</div> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.