From 05d7ebed1bda7d92ad2519383cb5336456c116aa Mon Sep 17 00:00:00 2001 From: Miki Date: Fri, 1 Jul 2022 16:18:57 -0700 Subject: [PATCH] Add ECR docker images to the downloads options * Introduces "inline instructions" for the versions * Employed it to display docker instructions from Docker Hub and Amazon ECR * Added "inline instructions" definition to the latest artifact files * Introduces `rouge` for code highlighting * This is used to style code blocks used by the "inline instructions" * This is also used to fix the broken highlighting system of the website Signed-off-by: Miki --- Gemfile | 2 ++ Gemfile.lock | 3 +- .../data-prepper-1.5.1-docker-x64.markdown | 12 ++++++- ...output-plugin-7.16.3-docker-arm64.markdown | 12 ++++++- ...h-output-plugin-7.16.3-docker-x64.markdown | 12 ++++++- .../opensearch-2.1.0-docker-arm64.markdown | 12 ++++++- ...rch-dashboards-2.1.0-docker-arm64.markdown | 12 ++++++- .../x64/opensearch-2.1.0-docker-x64.markdown | 12 ++++++- ...earch-dashboards-2.1.0-docker-x64.markdown | 12 ++++++- _config.yml | 2 ++ _layouts/versions.html | 23 ++++++++++++- _sass/_opensearch.scss | 32 ++++++++++++++++++- assets/js/mod/select_logic.js | 27 +++++++++------- 13 files changed, 151 insertions(+), 22 deletions(-) diff --git a/Gemfile b/Gemfile index bdaa99011f..6870828dca 100644 --- a/Gemfile +++ b/Gemfile @@ -31,3 +31,5 @@ end # Performance-booster for watching directories on Windows gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin] + +gem "rouge" diff --git a/Gemfile.lock b/Gemfile.lock index 06e555347b..a3cd15f1ca 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -87,9 +87,10 @@ DEPENDENCIES jekyll-redirect-from (~> 0.16) jekyll-sitemap minima (~> 2.5) + rouge tzinfo (~> 1.2) tzinfo-data wdm (~> 0.1.1) BUNDLED WITH - 2.2.22 + 2.3.5 diff --git a/_artifacts/data-prepper/data-prepper-1.5.1-docker-x64.markdown b/_artifacts/data-prepper/data-prepper-1.5.1-docker-x64.markdown index d941108cde..d548e06d72 100644 --- a/_artifacts/data-prepper/data-prepper-1.5.1-docker-x64.markdown +++ b/_artifacts/data-prepper/data-prepper-1.5.1-docker-x64.markdown @@ -5,7 +5,17 @@ version: data-prepper-1.5.1 platform: docker type: docker_hub architecture: x64 -link: https://hub.docker.com/r/opensearchproject/data-prepper/tags?page=1&ordering=last_updated&name=1.5.1 slug: data-prepper-1.5.1-docker-x64 category: opensearch +inline_instructions: +- label: "Docker Hub" + code: docker pull opensearchproject/data-prepper:1.5.1 + link: + label: View on Docker Hub + url: https://hub.docker.com/r/opensearchproject/data-prepper/tags?page=1&ordering=last_updated&name=1.5.1 +- label: "Amazon ECR" + code: docker pull public.ecr.aws/opensearchproject/data-prepper:1.5.1 + link: + label: View on Amazon ECR + url: https://gallery.ecr.aws/opensearchproject/data-prepper --- \ No newline at end of file diff --git a/_artifacts/logstash-oss-with-opensearch-output-plugin/logstash-oss-with-opensearch-output-plugin-7.16.3-docker-arm64.markdown b/_artifacts/logstash-oss-with-opensearch-output-plugin/logstash-oss-with-opensearch-output-plugin-7.16.3-docker-arm64.markdown index 8ee7df5e79..37902803d6 100644 --- a/_artifacts/logstash-oss-with-opensearch-output-plugin/logstash-oss-with-opensearch-output-plugin-7.16.3-docker-arm64.markdown +++ b/_artifacts/logstash-oss-with-opensearch-output-plugin/logstash-oss-with-opensearch-output-plugin-7.16.3-docker-arm64.markdown @@ -7,5 +7,15 @@ architecture: arm64 slug: logstash-oss-with-opensearch-output-plugin-7.16.3-docker-arm64 category: logstash-oss-with-opensearch-output-plugin type: docker_hub -link: https://hub.docker.com/r/opensearchproject/logstash-oss-with-opensearch-output-plugin +inline_instructions: +- label: "Docker Hub" + code: docker pull opensearchproject/logstash-oss-with-opensearch-output-plugin:7.16.3 + link: + label: View on Docker Hub + url: https://hub.docker.com/r/opensearchproject/logstash-oss-with-opensearch-output-plugin/tags?page=1&ordering=last_updated&name=7.16.3 +- label: "Amazon ECR" + code: docker pull public.ecr.aws/opensearchproject/logstash-oss-with-opensearch-output-plugin:7.16.3 + link: + label: View on Amazon ECR + url: https://gallery.ecr.aws/opensearchproject/logstash-oss-with-opensearch-output-plugin --- \ No newline at end of file diff --git a/_artifacts/logstash-oss-with-opensearch-output-plugin/logstash-oss-with-opensearch-output-plugin-7.16.3-docker-x64.markdown b/_artifacts/logstash-oss-with-opensearch-output-plugin/logstash-oss-with-opensearch-output-plugin-7.16.3-docker-x64.markdown index 247c61f97e..a4e58ea47f 100644 --- a/_artifacts/logstash-oss-with-opensearch-output-plugin/logstash-oss-with-opensearch-output-plugin-7.16.3-docker-x64.markdown +++ b/_artifacts/logstash-oss-with-opensearch-output-plugin/logstash-oss-with-opensearch-output-plugin-7.16.3-docker-x64.markdown @@ -7,5 +7,15 @@ architecture: x64 slug: logstash-oss-with-opensearch-output-plugin-7.16.3-docker-x64 category: logstash-oss-with-opensearch-output-plugin type: docker_hub -link: https://hub.docker.com/r/opensearchproject/logstash-oss-with-opensearch-output-plugin +inline_instructions: +- label: "Docker Hub" + code: docker pull opensearchproject/logstash-oss-with-opensearch-output-plugin:7.16.3 + link: + label: View on Docker Hub + url: https://hub.docker.com/r/opensearchproject/logstash-oss-with-opensearch-output-plugin/tags?page=1&ordering=last_updated&name=7.16.3 +- label: "Amazon ECR" + code: docker pull public.ecr.aws/opensearchproject/logstash-oss-with-opensearch-output-plugin:7.16.3 + link: + label: View on Amazon ECR + url: https://gallery.ecr.aws/opensearchproject/logstash-oss-with-opensearch-output-plugin --- \ No newline at end of file diff --git a/_artifacts/opensearch-2.1/arm64/opensearch-2.1.0-docker-arm64.markdown b/_artifacts/opensearch-2.1/arm64/opensearch-2.1.0-docker-arm64.markdown index 1a59b0a555..a468056a09 100644 --- a/_artifacts/opensearch-2.1/arm64/opensearch-2.1.0-docker-arm64.markdown +++ b/_artifacts/opensearch-2.1/arm64/opensearch-2.1.0-docker-arm64.markdown @@ -7,5 +7,15 @@ architecture: arm64 slug: opensearch-2.1.0-docker-arm64 category: opensearch type: docker_hub -link: https://hub.docker.com/r/opensearchproject/opensearch/tags?page=1&ordering=last_updated&name=2.1.0 +inline_instructions: +- label: "Docker Hub" + code: docker pull opensearchproject/opensearch:2.1.0 + link: + label: View on Docker Hub + url: https://hub.docker.com/r/opensearchproject/opensearch/tags?page=1&ordering=last_updated&name=2.1.0 +- label: "Amazon ECR" + code: docker pull public.ecr.aws/opensearchproject/opensearch:2.1.0 + link: + label: View on Amazon ECR + url: https://gallery.ecr.aws/opensearchproject/opensearch --- \ No newline at end of file diff --git a/_artifacts/opensearch-2.1/arm64/opensearch-dashboards-2.1.0-docker-arm64.markdown b/_artifacts/opensearch-2.1/arm64/opensearch-dashboards-2.1.0-docker-arm64.markdown index 23a27f6233..8262bf3362 100644 --- a/_artifacts/opensearch-2.1/arm64/opensearch-dashboards-2.1.0-docker-arm64.markdown +++ b/_artifacts/opensearch-2.1/arm64/opensearch-dashboards-2.1.0-docker-arm64.markdown @@ -7,5 +7,15 @@ architecture: arm64 slug: opensearch-dashboards-2.1.0-docker-arm64 category: opensearch-dashboards type: docker_hub -link: https://hub.docker.com/r/opensearchproject/opensearch-dashboards/tags?page=1&ordering=last_updated&name=2.1.0 +inline_instructions: +- label: "Docker Hub" + code: docker pull opensearchproject/opensearch-dashboards:2.1.0 + link: + label: View on Docker Hub + url: https://hub.docker.com/r/opensearchproject/opensearch-dashboards/tags?page=1&ordering=last_updated&name=2.1.0 +- label: "Amazon ECR" + code: docker pull public.ecr.aws/opensearchproject/opensearch-dashboards:2.1.0 + link: + label: View on Amazon ECR + url: https://gallery.ecr.aws/opensearchproject/opensearch-dashboards --- \ No newline at end of file diff --git a/_artifacts/opensearch-2.1/x64/opensearch-2.1.0-docker-x64.markdown b/_artifacts/opensearch-2.1/x64/opensearch-2.1.0-docker-x64.markdown index 928bccc7ab..e165aba259 100644 --- a/_artifacts/opensearch-2.1/x64/opensearch-2.1.0-docker-x64.markdown +++ b/_artifacts/opensearch-2.1/x64/opensearch-2.1.0-docker-x64.markdown @@ -7,5 +7,15 @@ architecture: x64 slug: opensearch-2.1.0-docker-x64 category: opensearch type: docker_hub -link: https://hub.docker.com/r/opensearchproject/opensearch/tags?page=1&ordering=last_updated&name=2.1.0 +inline_instructions: +- label: "Docker Hub" + code: docker pull opensearchproject/opensearch:2.1.0 + link: + label: View on Docker Hub + url: https://hub.docker.com/r/opensearchproject/opensearch/tags?page=1&ordering=last_updated&name=2.1.0 +- label: "Amazon ECR" + code: docker pull public.ecr.aws/opensearchproject/opensearch:2.1.0 + link: + label: View on Amazon ECR + url: https://gallery.ecr.aws/opensearchproject/opensearch --- \ No newline at end of file diff --git a/_artifacts/opensearch-2.1/x64/opensearch-dashboards-2.1.0-docker-x64.markdown b/_artifacts/opensearch-2.1/x64/opensearch-dashboards-2.1.0-docker-x64.markdown index 69eb59bdeb..43342a6fc4 100644 --- a/_artifacts/opensearch-2.1/x64/opensearch-dashboards-2.1.0-docker-x64.markdown +++ b/_artifacts/opensearch-2.1/x64/opensearch-dashboards-2.1.0-docker-x64.markdown @@ -7,5 +7,15 @@ architecture: x64 slug: opensearch-dashboards-2.1.0-docker-x64 category: opensearch-dashboards type: docker_hub -link: https://hub.docker.com/r/opensearchproject/opensearch-dashboards/tags?page=1&ordering=last_updated&name=2.1.0 +inline_instructions: +- label: "Docker Hub" + code: docker pull opensearchproject/opensearch-dashboards:2.1.0 + link: + label: View on Docker Hub + url: https://hub.docker.com/r/opensearchproject/opensearch-dashboards/tags?page=1&ordering=last_updated&name=2.1.0 +- label: "Amazon ECR" + code: docker pull public.ecr.aws/opensearchproject/opensearch-dashboards:2.1.0 + link: + label: View on Amazon ECR + url: https://gallery.ecr.aws/opensearchproject/opensearch-dashboards --- \ No newline at end of file diff --git a/_config.yml b/_config.yml index 0292b66f43..2e973ed334 100644 --- a/_config.yml +++ b/_config.yml @@ -102,6 +102,8 @@ paginate_path: "/blog/page:num/" timezone: "Etc/UTC" +highlighter: rouge + # Exclude from processing. # The following items will not be processed, by default. # Any item listed under the `exclude:` key here will be automatically added to diff --git a/_layouts/versions.html b/_layouts/versions.html index 82a8bd2be2..4a4c2ab729 100644 --- a/_layouts/versions.html +++ b/_layouts/versions.html @@ -1,6 +1,7 @@ --- layout: default notice: true +highlighter: rouge pretty: guide: "Install Guide" @@ -216,6 +217,23 @@

{{ name_pretty }}

{% endcapture %} {% assign artifact_extras = artifact_extras | append: artifact_extra %} {% endif %} + {% if details.inline_instructions %} + {% capture artifact_instructions %} + {{artifact_instructions}} +
+ {% for instruction in details.inline_instructions %} +

+ {% if instruction.link %} + {{instruction.link.label}} + {% endif %} + {{instruction.label}} +

+ {% highlight bash %}{{instruction.code}}{% endhighlight %} + {% endfor %} +
+ {% endcapture %} + {% assign artifact_extras = artifact_extras | append: artifact_extra %} + {% endif %} {% if details.guide %} {% capture artifact_extra %}{% endcapture %} {% assign artifact_extras = artifact_extras | append: artifact_extra %} @@ -242,13 +260,16 @@

{{ name_pretty }}

{% endif %} {% if artifact_option %} - + {% assign artifact_options = "" %} {% endif %} {% assign artifact_extras = "" %} +
{{artifact_instructions}}
+ {% assign artifact_instructions = "" %} + diff --git a/_sass/_opensearch.scss b/_sass/_opensearch.scss index 3634564a24..ca201600ad 100644 --- a/_sass/_opensearch.scss +++ b/_sass/_opensearch.scss @@ -365,13 +365,18 @@ dl.list-features { } .artifact-container { display: flex; + flex-flow: row wrap; + gap: 1em; .artifact-explain { width : 66%; + flex-grow: 1; + >p:last-child { + margin-bottom: 0; + } } .download-panel { - margin-left: 1em; flex-grow: 1; @include sans-serif; @@ -388,6 +393,31 @@ dl.list-features { max-width: none; } } + .extra-instructions-group { + width: 100%; + flex-shrink: 0; + + .highlight { + margin: 0 0 15px; + } + } + + .instruction-label { + margin: 0 0 .2rem; + + a { + @include sans-serif; + font-weight: 400; + font-size: 1.2rem; + float: right; + margin-top: .6rem; + line-height: 1; + + &:visited { + color: inherit; + } + } + } } .artifact-standalone { diff --git a/assets/js/mod/select_logic.js b/assets/js/mod/select_logic.js index 4b1e3ed036..b0d75a85e2 100644 --- a/assets/js/mod/select_logic.js +++ b/assets/js/mod/select_logic.js @@ -1,15 +1,23 @@ define([ 'jquery' //requires jquery ], function( $ ) { - function selectExtras($extras,id) { - $extras.children().show(); - $extras.children(':not(.extra_'+id+')').hide(); //$artifactSelect.val() + function selectExtras($root) { + var + $artifactSelect = $root, + $artifactSelectVal = $artifactSelect.val(), + $extraLinks = $artifactSelect.parent().find('.extra-links-group'), + $extraInstructions = $artifactSelect.parent().parent().children('.extra-instructions-group'); + + $extraLinks.children().show(); + $extraLinks.children(':not(.extra_'+$artifactSelectVal+')').hide(); + + $extraInstructions.children('.extra_' + $artifactSelectVal).show(); + $extraInstructions.children(':not(.extra_' + $artifactSelectVal + ')').hide(); } function selectPlatform($root) { - var + var $platformSelect = $root, $artifactSelect = $platformSelect.parent().children('.dl-artifact-select'), - $extraLinks = $platformSelect.parent().children('.extra-links-group'), firstItemVal; $artifactSelect.children().show(); @@ -17,19 +25,14 @@ define([ firstItemVal = $artifactSelect.children('.platform_'+$platformSelect.val()).first().val(); $artifactSelect.val(firstItemVal); - $extraLinks.children().show(); - $extraLinks.children(':not(.extra_'+$platformSelect.val()+')').hide(); - selectExtras($extraLinks,firstItemVal); + selectExtras($artifactSelect); } $(".dl-platform-select").change(function() { selectPlatform($(this)); }); $(".dl-artifact-select").change(function() { - var - $artifactSelect = $(this), - $extraLinks = $artifactSelect.parent().find('.extra-links-group'); - selectExtras($extraLinks,$artifactSelect.val()); + selectExtras($(this)); }); $(".dl-platform-select").each(function(){