diff --git a/assets/_home.scss b/assets/_home.scss index a05e56d..7167254 100644 --- a/assets/_home.scss +++ b/assets/_home.scss @@ -41,6 +41,11 @@ margin-right: 20px; padding: 20px; text-align: left; + a:first-child { + display: flex; + flex-direction: column; + height: 100%; + } * { color: white @@ -57,7 +62,6 @@ .card-info { flex: 1 1; width: 100%; - padding-bottom: 30px; } .card-cta { @@ -82,6 +86,12 @@ } } + @media (max-width: 900px) { + .home .user-card .card-img { + padding: 0px !important; + } + } + @media (max-width: 768px) { .home { .book-search { diff --git a/assets/search.js b/assets/search.js index 2a30cec..7eee5b2 100644 --- a/assets/search.js +++ b/assets/search.js @@ -119,19 +119,35 @@ resultCard(`Not Found`, `Sorry, we couldn't find any matches. Try searching for a different keyword`) return } + const currentPathname = window.location.pathname + searchHits.forEach((hit) => { const document = documents.get(Number(hit.ref)) if (!document) return + if ((isSdk6(currentPathname) && isSdk7(document.href)) + || (isSdk7(currentPathname) && isSdk6(document.href)) + ) return const highlightedContent = highlightContent(document.content, hit) resultCard(document.title, highlightedContent, document.href) }); } + function isSdk6(href) { + return href && href.includes('creator/development-guide') && !href.includes('sdk7') + } + + function isSdk7(href) { + return href && href.includes('creator/development-guide/sdk7') + } + function resultCard(title, content, href) { - const li = element('