From 5547739b50b7a0aa605e746b5b08a6779b53ccbc Mon Sep 17 00:00:00 2001 From: Ian Maddaus Date: Wed, 16 Oct 2024 11:50:24 -0400 Subject: [PATCH 01/13] Create search page and layout Signed-off-by: Ian Maddaus --- config/_default/params.toml | 45 +++++++++++++++++++++++++++ content/search.md | 8 +++++ layouts/_default/search.html | 60 ++++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 content/search.md create mode 100644 layouts/_default/search.html diff --git a/config/_default/params.toml b/config/_default/params.toml index 39dde6df6a..e6ba3a061d 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -25,3 +25,48 @@ robots = '' [license-service] gh_path = "https://github.com/chef/license-service/tree/main/docs-chef-io/content/" + + +[products] + +[products.360] +name = "360 Platform" +product_key = "360" +versions = ['1.1', '1.0'] + +[products.automate] +name = "Automate" +product_key = "automate" + +[products.desktop] +name = "Desktop" +product_key = "desktop" + +[products.habitat] +name = "Habitat" +product_key = "habitat" + +[products.infra_client] +name = "Infra Client" +product_key = "chef" +versions = ['18', '17'] + +[products.infra_server] +name = "Infra Server" +product_key = "chef-server" + +[products.inspec] +name = "InSpec" +product_key = "inspec" + +[products.saas] +name = "SaaS" +product_key = "saas" + +[products.supermarket] +name = "Supermarket" +product_key = "supermarket" + +[products.workstation] +name = "Workstation" +product_key = "chef-workstation" \ No newline at end of file diff --git a/content/search.md b/content/search.md new file mode 100644 index 0000000000..6144e13bb4 --- /dev/null +++ b/content/search.md @@ -0,0 +1,8 @@ ++++ +title = "Chef Documentation Search" +layout = "search" +left_nav = false +feedback = false ++++ + +hello diff --git a/layouts/_default/search.html b/layouts/_default/search.html new file mode 100644 index 0000000000..8357ba5e3d --- /dev/null +++ b/layouts/_default/search.html @@ -0,0 +1,60 @@ +{{ define "main" }} +
+ +
+
+ +
+
+ +
+
+ +
+
Filters
+ + + + +
+
Products
+
    + + {{- range .Site.Params.products -}} + +
  • + +
    +
  • + + {{- end -}} + +
+
Versions
+
    + + {{- range .Site.Params.products -}} + {{- if .versions -}} + {{ range .versions }} +
  • + +
    +
  • + {{- end -}} + {{- end -}} + + {{- end -}} + +
+
+
+ +
+

Search Results

+
    +
+
+
+
+
+{{ end }} From 305c7179c2d3a0ffb952a0676b02c0ab67088d0b Mon Sep 17 00:00:00 2001 From: Ian Maddaus Date: Mon, 21 Oct 2024 17:22:45 -0400 Subject: [PATCH 02/13] WIP Signed-off-by: Ian Maddaus --- config/_default/params.toml | 43 +++++++++++++++++++++++++++++------ layouts/_default/search.html | 44 ++++++++++++++++++++---------------- 2 files changed, 60 insertions(+), 27 deletions(-) diff --git a/config/_default/params.toml b/config/_default/params.toml index e6ba3a061d..11aff1ae97 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -17,7 +17,7 @@ menuOrder = [ "legacy", "extra" ] -enable_search = true + robots = '' [chef-web-docs] @@ -27,46 +27,75 @@ robots = '' gh_path = "https://github.com/chef/license-service/tree/main/docs-chef-io/content/" + +default_search_product_keys = ["chef-360-1.0", "automate", "desktop", "habitat", "client", "server", "inspec", "saas", "supermarket", "workstation"] + +# This populates the site search. +# versions must be in order from newest version to oldest and must be a string. [products] [products.360] name = "360 Platform" -product_key = "360" -versions = ['1.1', '1.0'] +product_key = "chef-360" +default = "chef-360-1.0" + +[[products.360.versions]] +name = "1.1" +key = "chef-360-1.1" + +[[products.360.versions]] +name = "1.0" +key = "chef-360-1.0" [products.automate] name = "Automate" +default = "automate" product_key = "automate" [products.desktop] name = "Desktop" +default = "desktop" product_key = "desktop" [products.habitat] name = "Habitat" +default = "habitat" product_key = "habitat" [products.infra_client] name = "Infra Client" -product_key = "chef" -versions = ['18', '17'] +product_key = "client" +default_version = "client" + +[[products.infra_client.versions]] +name = '18' +key = 'client-18' + +[[products.infra_client.versions]] +name = '17' +key = 'client-17' [products.infra_server] name = "Infra Server" -product_key = "chef-server" +default = "server" +product_key = "server" [products.inspec] name = "InSpec" +default = "inspec" product_key = "inspec" [products.saas] name = "SaaS" +default = "saas" product_key = "saas" [products.supermarket] name = "Supermarket" +default = "supermarket" product_key = "supermarket" [products.workstation] name = "Workstation" -product_key = "chef-workstation" \ No newline at end of file +default = "workstation" +product_key = "workstation" diff --git a/layouts/_default/search.html b/layouts/_default/search.html index 8357ba5e3d..68262244b7 100644 --- a/layouts/_default/search.html +++ b/layouts/_default/search.html @@ -1,10 +1,14 @@ {{ define "main" }} -
+