From ad038cab51d91476161f468d3e9175eea24674a9 Mon Sep 17 00:00:00 2001 From: Ankita Sahu <71656941+SAHU-01@users.noreply.github.com> Date: Mon, 12 Aug 2024 16:24:53 +0530 Subject: [PATCH 01/22] feat(docs): Adding frontmatter to layer5 docs pages Signed-off-by: Ankita Sahu <71656941+SAHU-01@users.noreply.github.com> --- assets/scss/_pageinfo.scss | 2 +- assets/scss/_styles_project.scss | 43 ++++++ .../en/cloud/tutorials/gitops-snapshots.md | 1 + layouts/shortcodes/front-matter.html | 46 ++++++ static/data/csv/features.yml | 146 ++++++++++++++++++ 5 files changed, 237 insertions(+), 1 deletion(-) create mode 100644 layouts/shortcodes/front-matter.html create mode 100644 static/data/csv/features.yml diff --git a/assets/scss/_pageinfo.scss b/assets/scss/_pageinfo.scss index 5d439ded..ca632375 100644 --- a/assets/scss/_pageinfo.scss +++ b/assets/scss/_pageinfo.scss @@ -22,4 +22,4 @@ margin-top: map-get($spacers, 5) !important; padding-top: map-get($spacers, 3) !important; } -} +} \ No newline at end of file diff --git a/assets/scss/_styles_project.scss b/assets/scss/_styles_project.scss index a3727ec8..dbe21fb9 100644 --- a/assets/scss/_styles_project.scss +++ b/assets/scss/_styles_project.scss @@ -381,6 +381,49 @@ a:not([href]):not([class]):hover { border-color: #00b39f; } +// front-matter +.matterinfo { + font-weight: $font-weight-medium; + background: $black; + font-family: "Open Sans"; + border-style: solid; + margin: 2rem auto; + padding: 1rem; + border-color: #00b39f; + border-radius: 10px; +} + +.heading { + font-size: 1.2rem; + color: #00b39f; +} + +.matterheader { + font-size: 1.2rem; + color: #00b39f; +} + +.matterinfo .plan-support { + display: flex; + align-items: center; +} + +.matterinfo .plan-support .support-icon { + width: 20px; + height: 20px; + margin-right: 10px; +} + +.plan-icon { + display: inline-block; +} + +.highlight{ + color: #00b39f; + font-weight: bold; + margin-left:10px +} + // Style alert boxes. .alert { diff --git a/content/en/cloud/tutorials/gitops-snapshots.md b/content/en/cloud/tutorials/gitops-snapshots.md index ec01c8e4..dbb26118 100644 --- a/content/en/cloud/tutorials/gitops-snapshots.md +++ b/content/en/cloud/tutorials/gitops-snapshots.md @@ -6,6 +6,7 @@ category: GitOps weight: 4 --- +{{< front-matter feature_name="MeshMap Snapshots" >}} MeshMap Snapshots offer visual insights in every pull request. Verify your workload designs and Kubernetes cluster configurations prior to accepting and merging pull requests. diff --git a/layouts/shortcodes/front-matter.html b/layouts/shortcodes/front-matter.html new file mode 100644 index 00000000..a548d62e --- /dev/null +++ b/layouts/shortcodes/front-matter.html @@ -0,0 +1,46 @@ +{{ $feature_name := .Get "feature_name" }} +{{ $featuresYaml := readFile "static/data/csv/features.yml" }} +{{ $featuresData := unmarshal $featuresYaml }} +{{ $feature := index (where $featuresData.features "name" $feature_name) 0 }} +{{ $color := .Get "color" | default "primary" }} + +
Feature information not found
+ {{ end }} +Feature information not found
+Feature information not found
{{ end }} -Feature information not found
- {{ end }} -