diff --git a/site/index.html b/site/index.html index 532786548..0da1d56c8 100644 --- a/site/index.html +++ b/site/index.html @@ -117,9 +117,9 @@ let catalogPath; if (isContribFn) { - catalogPath = "/contrib/catalog.json"; + catalogPath = "/contrib/catalog-v2.json"; } else { - catalogPath = "/catalog.json"; + catalogPath = "/catalog-v2.json"; } window.Docsify.get(catalogPath).then(function ( catalogResponse @@ -135,8 +135,10 @@ versionName = pathElements[2]; } - const currentVersion = versionName.replaceAll("v", ""); + const patchSemver = versions[versionName]['LatestPatchVersion'] + const currentVersion = patchSemver.replaceAll("v", ""); const sortedSemvers = Object.keys(versions) + .map((minor) => versions[minor]['LatestPatchVersion']) .sort((a, b) => compareVersions(a, b)) .reverse(); versionDropdown += ` @@ -155,7 +157,7 @@ `; - const examples = catalog[functionName][versionName]; + const examples = catalog[functionName][versionName]['Examples']; const ghElement = document .getElementsByClassName("github-corner") .item(0); @@ -218,9 +220,18 @@

${ versionDropdown + examplesDropdown + ""; + let imageContent = + `
` +
+                    `` +
+                    `gcr.io/kpt-fn${isContribFn ? "-contrib" : ""}/${functionName}:${patchSemver}` +
+                    `` +
+                    `
` const dropdownContainer = document.createElement("div"); + const imageSection = document.createElement("div"); const content = document.getElementsByClassName("markdown-section").item(0); + content.prepend(imageSection) + imageSection.outerHTML = imageContent content.prepend(dropdownContainer); dropdownContainer.outerHTML = dropdowns; // Update title of page to title of document.