From e2708fe202a9257b2a79d3d1a9bf8dc00139e355 Mon Sep 17 00:00:00 2001 From: K Siva Prasad Reddy Date: Tue, 28 Mar 2023 10:30:46 +0530 Subject: [PATCH 01/11] Temp preview for generic TC Intro guide --- build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.sh b/build.sh index 4b7e6eb..de827d2 100644 --- a/build.sh +++ b/build.sh @@ -23,6 +23,12 @@ for repo_name in "${GUIDE_REPOS[@]}"; do rm -rf "${GUIDES_TARGET_DIR:?}/${repo_name}" cp -r "${GUIDE_REPOS_CLONE_DIR}/${repo_name}/guide/." "${GUIDES_TARGET_DIR}" done + +echo "Cloning ${GIT_ORG}/tc-guide-getting-started-with-testcontainers-for-java.git" +git clone -b generic-tc-intro "${GIT_ORG}/tc-guide-getting-started-with-testcontainers-for-java.git" "${GUIDE_REPOS_CLONE_DIR}/tc-guide-getting-started-with-testcontainers-for-java/" +rm -rf "${GUIDES_TARGET_DIR:?}/tc-guide-getting-started-with-testcontainers-for-java" +cp -r "${GUIDE_REPOS_CLONE_DIR}/tc-guide-getting-started-with-testcontainers-for-java/guide/." "${GUIDES_TARGET_DIR}" + echo "------------------Guides Setup Completed ---------------------------" # output some version numbers: From 013ee711dcde0c9d25a637c4ed4613b2fe0622ea Mon Sep 17 00:00:00 2001 From: K Siva Prasad Reddy Date: Tue, 28 Mar 2023 10:36:41 +0530 Subject: [PATCH 02/11] Temp preview for generic TC Intro guide --- build.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/build.sh b/build.sh index de827d2..cf6d836 100644 --- a/build.sh +++ b/build.sh @@ -24,11 +24,6 @@ for repo_name in "${GUIDE_REPOS[@]}"; do cp -r "${GUIDE_REPOS_CLONE_DIR}/${repo_name}/guide/." "${GUIDES_TARGET_DIR}" done -echo "Cloning ${GIT_ORG}/tc-guide-getting-started-with-testcontainers-for-java.git" -git clone -b generic-tc-intro "${GIT_ORG}/tc-guide-getting-started-with-testcontainers-for-java.git" "${GUIDE_REPOS_CLONE_DIR}/tc-guide-getting-started-with-testcontainers-for-java/" -rm -rf "${GUIDES_TARGET_DIR:?}/tc-guide-getting-started-with-testcontainers-for-java" -cp -r "${GUIDE_REPOS_CLONE_DIR}/tc-guide-getting-started-with-testcontainers-for-java/guide/." "${GUIDES_TARGET_DIR}" - echo "------------------Guides Setup Completed ---------------------------" # output some version numbers: From 92314a0967b818f28d4990a73476e265e9389879 Mon Sep 17 00:00:00 2001 From: Leo Date: Sat, 8 Apr 2023 14:28:05 +0100 Subject: [PATCH 03/11] Fix tag taxonomy term content (#32) * Fix localstack content in spring boot tag term * Fix getting started content in localstack tag term * Fix getting started content in junit tag term --- content/tags/junit/_index.md | 6 +++--- content/tags/localstack/_index.md | 6 +++--- content/tags/spring-boot/_index.md | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/content/tags/junit/_index.md b/content/tags/junit/_index.md index 91d959c..68b9994 100644 --- a/content/tags/junit/_index.md +++ b/content/tags/junit/_index.md @@ -1,4 +1,4 @@ --- -title: Getting Started -slug: getting-started ---- \ No newline at end of file +title: JUnit +slug: junit +--- diff --git a/content/tags/localstack/_index.md b/content/tags/localstack/_index.md index 91d959c..55339d5 100644 --- a/content/tags/localstack/_index.md +++ b/content/tags/localstack/_index.md @@ -1,4 +1,4 @@ --- -title: Getting Started -slug: getting-started ---- \ No newline at end of file +title: LocalStack +slug: localstack +--- diff --git a/content/tags/spring-boot/_index.md b/content/tags/spring-boot/_index.md index 0361064..26e4101 100644 --- a/content/tags/spring-boot/_index.md +++ b/content/tags/spring-boot/_index.md @@ -1,4 +1,4 @@ --- -title: LocalStack -slug: localstack ---- \ No newline at end of file +title: Spring Boot +slug: spring-boot +--- From 77351fd47b5c35519e3e7a2528e73b49386c0173 Mon Sep 17 00:00:00 2001 From: Leo Date: Tue, 11 Apr 2023 13:14:46 +0100 Subject: [PATCH 04/11] Add mobile menu and cloud link (#34) * Add mobile menu toggle * Add cloud link to main menu --- assets/js/main.js | 6 ++ assets/sass/_header.scss | 141 +++++++++++++++++++++++++++-------- layouts/partials/header.html | 24 +++++- 3 files changed, 136 insertions(+), 35 deletions(-) diff --git a/assets/js/main.js b/assets/js/main.js index a666af3..dc541ce 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -1,3 +1,9 @@ +const mobileToggle = document.getElementById("mobile-menu-toggle"); +function toggleMobileMenu() { + document.body.classList.toggle('mobile-menu'); +} +mobileToggle.addEventListener("click", toggleMobileMenu); + const allParentMenuItems = document.querySelectorAll("#site-header .menu-item.has-children"); function clearActiveMenuItem() { diff --git a/assets/sass/_header.scss b/assets/sass/_header.scss index b3960b5..697cde3 100644 --- a/assets/sass/_header.scss +++ b/assets/sass/_header.scss @@ -12,6 +12,17 @@ padding: 20px 40px; } + @media (max-width: 1023px) { + flex-direction: column; + } + + .brand { + display: flex; + justify-content: space-between; + gap: 20px; + width: 100%; + } + .logo { display: flex; @@ -25,6 +36,27 @@ } } + #mobile-menu-toggle { + background: none; + border: none; + display: flex; + align-items: center; + gap: 10px; + cursor: pointer; + color: $eggplant; + padding: 0; + margin: 0; + font-weight: 500; + + body.mobile-menu & { + color: $topaz; + } + + @media (min-width: 1024px) { + display: none; + } + } + ul { list-style: none; padding: 0; @@ -32,24 +64,49 @@ } nav { + display: none; + + @media (max-width: 1023px) { + body.mobile-menu & { + display: flex; + } + + position: relative; + width: 100%; + flex-direction: column; + border: 1px solid $mist; + border-radius: 6px; + background: #fff; + box-shadow: 0px 30px 35px rgba($smoke, 0.75); + min-width: 200px; + } + @media (min-width: 1024px) { + display: block; + } } .menu { - display: flex; - justify-content: center; - gap: 20px; - - @media (min-width: 500px) { + @media (min-width: 1024px) { + display: flex; + justify-content: center; gap: 30px; } } .menu-item { display: flex; - align-items: center; - @media (min-width: 500px) { + @media (max-width: 1023px) { + flex-direction: column; + + + .menu-item { + border-top: 1px solid $mist; + } + } + + @media (min-width: 1024px) { + align-items: center; position: relative; } @@ -66,10 +123,14 @@ font-weight: 500; color: $eggplant; text-decoration: none; - font-size: rem(12px); + font-size: rem(14px); transition: color 0.2s ease; - @media (min-width: 500px) { + @media (max-width: 1023px) { + padding: 10px 20px; + } + + @media (min-width: 1024px) { min-height: 48px; gap: 8px; font-size: rem(16px); @@ -78,6 +139,12 @@ &:hover { color: $topaz; } + + .icon-external { + margin-left: auto; + opacity: .3; + flex-shrink: 0; + } } .icon-caret { @@ -100,29 +167,34 @@ } .menu-dropdown { + flex-direction: column; + @at-root body.js & { display: none; } - position: absolute; - top: 100%; - right: -8px; - flex-direction: column; - border: 1px solid $mist; - border-radius: 6px; - background: #fff; - box-shadow: 0px 30px 35px rgba($smoke, 0.75); - min-width: 200px; + @media (max-width: 1023px) { - @media (max-width: 499px) { - top: calc(100% - 20px); - right: 20px; - width: calc(100% - 40px); + } + + @media (min-width: 1024px) { + position: absolute; + top: 100%; + right: -8px; + border: 1px solid $mist; + border-radius: 6px; + background: #fff; + box-shadow: 0px 30px 35px rgba($smoke, 0.75); + min-width: 200px; } } .menu-item.has-children.active .menu-dropdown { display: flex; + + @media (max-width: 1023px) { + border-top: 1px solid $mist; + } } .menu-dropdown-item { @@ -145,21 +217,26 @@ &:hover { background-color: rgba($catskill, 0.45); + + .icon-external { + color: $topaz; + } } - } - img { - height: 24px; - } + @media (max-width: 1023px) { + padding: 10px 20px 10px 30px; + } - .icon-external { - margin-left: auto; - color: $fog; - flex-shrink: 0; + .icon-external { + margin-left: auto; + color: $fog; + flex-shrink: 0; + opacity: 1; + } } - a:hover .icon-external { - color: $topaz; + img { + height: 24px; } } } \ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 8426c8a..3802b43 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,7 +1,17 @@ \ No newline at end of file + From 9dab634ee9ee26422429c9c8798953bd1d6ab01c Mon Sep 17 00:00:00 2001 From: Leo Date: Thu, 13 Apr 2023 10:43:55 +0100 Subject: [PATCH 09/11] Featured guides (#36) * Add caret to svg sprite * Update dev script * Add featured block to guides * Update featured guide title and description * Fix featured guides mobile response --- assets/sass/guides/_guides-banner.scss | 84 +++++++++++++++++++++++++- assets/sass/guides/_guides-list.scss | 2 +- content/guides/_index.md | 13 ++++ dev.sh | 4 +- layouts/guides/list.html | 19 ++++++ layouts/guides/single.html | 7 ++- layouts/modules/single.html | 7 ++- layouts/partials/header.html | 4 +- layouts/partials/svgs/sprite.html | 4 ++ 9 files changed, 138 insertions(+), 6 deletions(-) diff --git a/assets/sass/guides/_guides-banner.scss b/assets/sass/guides/_guides-banner.scss index f06cc78..4baf982 100644 --- a/assets/sass/guides/_guides-banner.scss +++ b/assets/sass/guides/_guides-banner.scss @@ -18,8 +18,90 @@ } } - .search { + .featured { + border: 1px solid $mist; + border-radius: 6px; margin-top: 40px; + display: grid; + + @media (min-width: 880px) { + grid-template-columns: repeat(3, 1fr); + } + } + + .featured-item { + padding: 20px; + display: flex; + flex-direction: column; + gap: 20px; + text-decoration: none; + color: inherit; + transition: background-color 0.2s ease; + + + .featured-item { + border-color: $mist; + border-style: solid; + border-width: 1px 0 0 0; + + @media (min-width: 880px) { + border-width: 0 0 0 1px; + } + } + + &:hover { + background: rgba($catskill, 0.45); + + .link-label { + color: $topaz; + } + } + + .header { + display: flex; + gap: 10px; + } + + .index { + font-weight: 500; + font-size: rem(20px); + line-height: 1.3; + color: $aqua; + } + + h2 { + font-size: rem(20px); + line-height: 1.3; + overflow-wrap: anywhere; + } + + .description { + font-size: rem(16px); + } + + .link { + margin-top: auto; + display: grid; + grid-template-columns: auto 20px; + overflow: hidden; + align-items: center; + + .icon-caret { + transform: rotate(-90deg); + justify-self: flex-end; + } + } + + .link-label { + font-weight: 500; + color: $eggplant; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + } + } + + .search { + margin-top: 60px; input { padding: 15px 20px; diff --git a/assets/sass/guides/_guides-list.scss b/assets/sass/guides/_guides-list.scss index 3cca93c..659f668 100644 --- a/assets/sass/guides/_guides-list.scss +++ b/assets/sass/guides/_guides-list.scss @@ -2,7 +2,7 @@ padding: 30px 0 60px 0; @media (min-width: 500px) { - padding: 60px 0; + padding: 40px 0 60px 0; } .guides-list-items { diff --git a/content/guides/_index.md b/content/guides/_index.md index eaf866a..23220c8 100644 --- a/content/guides/_index.md +++ b/content/guides/_index.md @@ -1,4 +1,17 @@ --- title: Getting Started Guides description: The following guides provide practical projects to learn Testcontainers by getting your hands dirty. Whether you’re looking to ramp up from zero to proficient, or are already an expert, there should be a guide for you. +featuredItems: + - title: Introduction + description: Learn the basics of how Testcontainers works. + link: /guides/introducing-testcontainers/ + linkLabel: What is Testcontainers, and why should you use it? + - title: Basic setup + description: See how to use Testcontainers with Java. + link: /guides/getting-started-with-testcontainers-for-java/ + linkLabel: Getting started with Testcontainers for Java + - title: Create a project + description: Use Testcontainers in a Spring Boot project. + link: /guides/testing-spring-boot-rest-api-using-testcontainers/ + linkLabel: Getting started with Testcontainers in a Java Spring Boot Project --- \ No newline at end of file diff --git a/dev.sh b/dev.sh index 769f071..f2a0d79 100644 --- a/dev.sh +++ b/dev.sh @@ -3,10 +3,12 @@ echo "---------------- Downloading Guides -----------------------------" GIT_ORG="https://github.com/testcontainers" GUIDE_REPOS=( - 'tc-guide-introducing-testcontainers' + 'tc-guide-introducing-testcontainers' + 'tc-guide-getting-started-with-testcontainers-for-java' 'tc-guide-testing-spring-boot-rest-api' 'tc-guide-testcontainers-lifecycle' 'tc-guide-configuration-of-services-running-in-container' + 'tc-guide-replace-h2-with-real-database-for-testing' ) GUIDE_REPOS_CLONE_DIR="./guide-repos" diff --git a/layouts/guides/list.html b/layouts/guides/list.html index eaa74a8..18a38ff 100644 --- a/layouts/guides/list.html +++ b/layouts/guides/list.html @@ -13,6 +13,25 @@

{{ .Title }}

{{ .Description | markdownify }}
+ {{ with .Params.featuredItems }} +
+ {{ end }} diff --git a/layouts/guides/single.html b/layouts/guides/single.html index 9a60fc9..e3731b7 100644 --- a/layouts/guides/single.html +++ b/layouts/guides/single.html @@ -13,7 +13,12 @@

diff --git a/layouts/modules/single.html b/layouts/modules/single.html index de0c5a5..b5a24a1 100644 --- a/layouts/modules/single.html +++ b/layouts/modules/single.html @@ -14,7 +14,12 @@