Skip to content

Commit

Permalink
* Add downloads section with tabs
Browse files Browse the repository at this point in the history
* Add faq section with expanding items
* Add footer
  • Loading branch information
limptwiglet committed Jan 15, 2024
1 parent 3035d4c commit 90041bb
Show file tree
Hide file tree
Showing 11 changed files with 640 additions and 5 deletions.
19 changes: 18 additions & 1 deletion _docs_theme/static.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<title>WireMock - flexible, open source API mocking | WireMock</title>
{% for path in config.theme.css %}
<link rel="stylesheet" href="{{ path | url }}" />
{% endfor %}
{% for path in config.extra_css %}
<link rel="stylesheet" href="{{ path | url }}" />
{% endfor %}
<link href="https://fonts.googleapis.com/css?family=DM+Sans:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&amp;display=fallback" rel="stylesheet">
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.svg">
</head>
<body class="static">
{% set staticPage = true %}
Expand All @@ -23,6 +24,22 @@
{{ page.content }}
{% endblock %}


<div class="page__footer">
<footer>
<div class="page__footer-copyright">
<img src="/images/shortLogo.png" class="short-logo">
<span class="footer-copyright-description">© 2024</span>
<ul class="footer-social-links">
<li><a href="http://github.com/wiremock" target="_blank"> <img src="/images/githubIcon.svg"> </a></li>
</ul>
</div>
</footer>
</div>

{% for path in config.extra_javascript %}
<script src="{{ path | url }}"></script>
{% endfor %}
</body>
</html>

17 changes: 14 additions & 3 deletions _site/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ template: static.html
</div>
<div id="wiremock-cloud-learn-more">
<div class="container">
<a id="a-wiremock-cloud" href="#wiremock-cloud-learn-more">z</a>
<a id="a-wiremock-cloud" href="#wiremock-cloud-learn-more"></a>
<div class="wiremock-cloud-wrapper">
<div class="wiremock-cloud-img-wrapper">
<img
Expand All @@ -152,7 +152,7 @@ template: static.html

<div id="wiremock-cloud" class="wiremock-cloud-details">
<img
src="/assets/svg/cloud-logo.svg"
src="/images/svg/cloud-logo.svg"
|
alt="wiremock cloud logo"
class="logo"
Expand Down Expand Up @@ -261,7 +261,18 @@ template: static.html
WireMock is available as a standalone service, Java library and
integrations for modern languages and technology stacks.
</p>
</div>

<div id="open-source-get-started" class="container code-tabs-wrapper"><div class="code-tabs-row"><div class="code-tabs-sidebar-wrapper"><div class="code-tabs-sidebar"><div class="code-tabs-example-card"> <img src="https://wiremock.org/images/maven.png" alt="Maven"></div><div class="code-tabs-example-card"> <img src="https://wiremock.org/images/elephantIcon.png" alt="Gradle"></div><div class="code-tabs-example-card"> <img src="https://wiremock.org/images/kotlin.png" alt="Kotlin"></div><div class="code-tabs-example-card"> <img src="https://wiremock.org/images/sbt.png" alt="SBT"></div><div class="code-tabs-example-card"> <img src="https://wiremock.org/images/java.png" alt="Java"></div><div class="code-tabs-example-card"> <img src="https://wiremock.org/images/docker.png" alt="Docker"></div></div></div><div class="code-tabs-main"><div class="code-tabs-main-wrapper"><ul><li class="active-tab-example">Maven</li><li class="">Gradle Groovy</li><li>Gradle Kotlin</li><li>Scala SBT</li><li>Standalone</li><li>Docker</li></ul><div class="code-tabs-main-example"><div class="codeSnippet activeCodeSnippet" data-snippettab="maven"><p class="codeTabDescription">Add the following to your project's <strong>pom.xml</strong> dependencies:</p><figure class="highlight"><pre><code class="language-xml" data-lang="xml"><span class="nt">&lt;dependency&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.wiremock<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>wiremock<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;version&gt;</span>3.3.1<span class="nt">&lt;/version&gt;</span>
<span class="nt">&lt;scope&gt;</span>test<span class="nt">&lt;/scope&gt;</span>
<span class="nt">&lt;/dependency&gt;</span></code></pre></figure><p class="codeTabDescription" style="margin-top:2rem;">Then follow the next steps for <a href="https://wiremock.org/docs/junit-jupiter/">JUnit 5+</a> or <a href="https://wiremock.org/docs/java-usage/">plain Java</a>.</p></div><div class="codeSnippet" data-snippettab="gradle groovy"><p class="codeTabDescription">Add the following to your project's <strong>build.gradle</strong>:</p><figure class="highlight"><pre><code class="language-groovy" data-lang="groovy"><span class="n">testImplementation</span> <span class="s2">"org.wiremock:wiremock:3.3.1"</span></code></pre></figure><p class="codeTabDescription" style="margin-top:2rem;">Then follow the next steps for <a href="https://wiremock.org/docs/junit-jupiter/">JUnit 5+</a> or <a href="https://wiremock.org/docs/java-usage/">plain Java</a>.</p></div><div class="codeSnippet" data-snippettab="gradle kotlin"><p class="codeTabDescription">Add the following to your project's <strong>build.gradle.kts</strong>:</p><figure class="highlight"><pre><code class="language-kotlin" data-lang="kotlin"><span class="nf">testImplementation</span><span class="p">(</span><span class="s">"org.wiremock:wiremock:3.3.1"</span><span class="p">)</span></code></pre></figure><p class="codeTabDescription" style="margin-top:2rem;">Then follow the next steps for <a href="https://wiremock.org/docs/junit-jupiter/">JUnit 5+</a> or <a href="https://wiremock.org/docs/java-usage/">plain Java</a>.</p></div><div class="codeSnippet" data-snippettab="scala sbt"><p class="codeTabDescription">Add the following to your project’s <strong>build.sbt</strong>:</p><figure class="highlight"><pre><code class="language-scala" data-lang="scala"><span class="n">libraryDependencies</span> <span class="o">+=</span>
<span class="s">"org.wiremock"</span> <span class="o">%</span> <span class="s">"wiremock"</span> <span class="o">%</span> <span class="s">"3.3.1"</span> <span class="o">%</span> <span class="nc">Test</span></code></pre></figure></div><div class="codeSnippet" data-snippettab="standalone"><p class="codeTabDescription"> Download the <a id="wiremock-standalone-download" href="https://repo1.maven.org/maven2/org/wiremock/wiremock-standalone/3.3.1/wiremock-standalone-3.3.1.jar">latest standalone JAR</a> then run the following in a terminal:</p><figure class="highlight"><pre><code class="language-bash" data-lang="bash">java <span class="nt">-jar</span> wiremock-standalone-3.3.1.jar</code></pre></figure><p class="codeTabDescription" style="margin-top:2rem;">Learn more in the <a href="https://wiremock.org/docs/running-standalone/">running standalone guide.</a></p></div><div class="codeSnippet" data-snippettab="docker"><p class="codeTabDescription">Run the following in a terminal:</p><figure class="highlight"><pre><code class="language-bash" data-lang="bash">docker run <span class="nt">-it</span> <span class="nt">--rm</span> <span class="se">\</span>
<span class="nt">-p</span> 8080:8080 <span class="se">\</span>
<span class="nt">--name</span> wiremock <span class="se">\</span>
wiremock/wiremock:3.3.1</code></pre></figure><p class="codeTabDescription" style="margin-top:2rem;">Learn more in the <a href="https://wiremock.org/docs/docker/">Docker guide.</a></p></div></div></div></div></div></div>
</div>

<div class="faq-wrapper">
<div class="container faq">
Expand Down
44 changes: 44 additions & 0 deletions _site/js/code-tabs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// For rendering code tabs without UIKit in the original Code Tabs plugin, also with grouping
document.addEventListener("DOMContentLoaded", function() {
var defaultTabs = document.querySelectorAll("#codeblock-default-selection")
for (i = 0; i < defaultTabs.length; i++) {
defaultTabs[i].click();
}
});

function showTab(evt, tabId) {
// Declare all variables
var i, tabcontent, tablinks;
var currentTab = evt.currentTarget
var codeblock = currentTab.parentElement.parentElement

// Get all elements with class="tabcontent" and hide them
tabcontent = codeblock.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}

// Get all elements with class="tablinks" and remove the class "active"
tablinks = codeblock.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}

// Show the current tab, and add an "active" class to the button that opened the tab
codeblock.querySelector("#"+tabId).style.display = "block";
evt.currentTarget.className += " active";
}

function copyCodeTabToClipboard(evt) {
var range = document.createRange();
var currentTab = evt.currentTarget
var activeTab = currentTab.parentElement.querySelector("button.active")
var tabId = activeTab.textContent

var codeblock = currentTab.parentElement.parentElement.querySelector("#"+tabId)
range.selectNode(codeblock);
window.getSelection().removeAllRanges(); // clear current selection
window.getSelection().addRange(range); // to select text
document.execCommand("copy");
window.getSelection().removeAllRanges();// to deselect
}
32 changes: 32 additions & 0 deletions _site/js/codeTab.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const tabNav = document.querySelectorAll(".code-tabs-main-wrapper ul li");
const snippetTab = document.querySelectorAll("[data-snippettab]");

// console.log(snippetTab);

function removeActiveSnippetTab() {
tabNav.forEach((singletab) => {
singletab.classList.remove("active-tab-example");
});
}

function removeActiveSnippetTabDiv() {
snippetTab.forEach((snippetTabDiv) => {
snippetTabDiv.classList.remove("activeCodeSnippet");
});
}

tabNav.forEach((tab) => {
tab.addEventListener("click", () => {
removeActiveSnippetTab();
const tabName = tab.innerHTML.toLowerCase();
removeActiveSnippetTabDiv();
snippetTab.forEach((singleSnippetTab) => {
if (tabName === singleSnippetTab.dataset.snippettab) {
singleSnippetTab.classList.add("activeCodeSnippet");
}
// console.log(singleSnippetTab.dataset.snippettab);
});

tab.classList.add("active-tab-example");
});
});
21 changes: 21 additions & 0 deletions _site/js/faq.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
var faqList = document.querySelector('.faq-list');

if (faqList) {
document.querySelectorAll('.faq-list > dt').forEach(function (dd) {
dd.classList.add('faq-list--collapsed');
});

document.querySelector('.faq-list').addEventListener('click', function (event) {
if (event.target.tagName === 'DT') {
var dd = event.target;

if (dd.classList.contains('faq-list--expanded')) {
dd.classList.remove('faq-list--expanded');
dd.classList.add('faq-list--collapsed');
} else {
dd.classList.add('faq-list--expanded');
dd.classList.remove('faq-list--collapsed');
}
}
});
}
5 changes: 5 additions & 0 deletions _site/js/jquery/jquery-1.12.1.min.js

Large diffs are not rendered by default.

111 changes: 111 additions & 0 deletions extra_sass/_faq.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
.faq-wrapper {
margin: 36px 0;
}

.faq {
margin: 0 auto;

@include breakpoint($medium) {
display: grid;
grid-template-columns: 15% 1fr;
gap: 160px;

&__title {
margin: 0;
padding: 0;
font-size: 32px;
line-height: 40px;
font-weight: 700;
color: unset;
}
}

&__title {
&:before {
margin-bottom: 12px;
width: 38px;
height: 38px;
border-radius: 32px;
content: url(/images/svg/faq.svg);
background: linear-gradient(
rgba(255, 149, 5, 0.5019607843),
rgba(255, 149, 5, 0)
);
display: block;
padding: 6px;
}
}
}

.faq-list {
font-family: 'DM Sans', "Segoe UI", "Helvetica Neue", "Lucida Grande", Arial, sans-serif;

@include breakpoint($large) {
margin-bottom: 100px;
}

dt {
padding: $p-m 0;
font-size: 20px;
color: #000;
font-weight: 500;

@include breakpoint($medium) {
padding: $p-l 0;
font-size: 24px;
line-height: 32px;

&:first-child {
padding-top: 0;
}
}
}

&__icon {
align-self: flex-end;
color: #2d69f6;
margin-left: auto;
font-size: 2em;
}

&--expanded {
.faq-list__icon:after {
content: '-';
}
}

dt {
display: flex;

&.faq-list--collapsed {
border-bottom: 2px solid #dbd8df;

.faq-list__icon:after {
content: '+';
}

& + dd {
display: none;
}
}

&.faq-list--expanded {
border-bottom: none;

& + dd {
border-bottom: 2px solid #dbd8df;
display: block;
}
}
}

dd {
margin: 0;
padding: $p-m 0;
font-size: 16px;

@include breakpoint($medium) {
padding-bottom: $p-l 0;
}
}
}
20 changes: 19 additions & 1 deletion extra_sass/_homepage.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

html {
scroll-behavior: smooth;
}
Expand Down Expand Up @@ -38,6 +39,11 @@ html {
.home-header-hero-text {
flex: 0 1 50%;
padding: $p-xl;

h2 {
font-size: 1.25em;
color: unset;
}
}
}
}
Expand Down Expand Up @@ -399,6 +405,10 @@ html {
border-radius: 100px;
margin-top: 20px;

img {
width: 100%;
}

&:nth-child(even) {
margin-left: auto;
}
Expand Down Expand Up @@ -597,8 +607,9 @@ html {
padding: 0;

li {
margin-bottom: 0.5em;
padding-left: $p-l;
background: url("/assets/svg/bullet.svg") no-repeat left center;
background: url("/images/svg/bullet.svg") no-repeat left center;
}
}

Expand Down Expand Up @@ -626,6 +637,7 @@ html {

.heading {
margin-bottom: $p-l;
color: unset;
}

.p-margin-wiremock-cloud {
Expand Down Expand Up @@ -712,6 +724,7 @@ html {
background: #0b4f6c;

.keyFeaturesTXT {
color: unset;
margin-bottom: $p-l;
font-size: $type-size-1;

Expand Down Expand Up @@ -776,6 +789,11 @@ html {
.downloads-wrapper {
margin-top: $p-3xl;
margin-bottom: $p-3xl;

h2 {
margin: 0 0 12px 0;
color: unset;
}
}

.apis-wrapper {
Expand Down
Loading

0 comments on commit 90041bb

Please sign in to comment.