Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add algolia search #963

Merged
merged 2 commits into from
Dec 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/landing/_template/landing.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
}
</script>
<!-- OneTrust Cookies Consent Notice (Production Standard, scala-sbt.org, en-GB) end -->

<link rel="stylesheet"href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
</head>
<body class="landing">
<header>
Expand All @@ -37,6 +39,10 @@
</div>
</div>
<div class="col-md-9">
<div class="docsearch">
<input type="text" id="doc-search-bar" placeholder="Search...">
<ul class="result-container" id="result-container" style="display: none;"></ul>
</div>
<div class="nav" id="topbar">
<a href="learn.html">Learn</a>
<a href="download.html">Download</a>
Expand Down Expand Up @@ -195,5 +201,13 @@ You can use sbt-native-packager to build native formats like Docker, sbt-release
ga('tsTracker.linker:autoLink', ['typesafe.com','playframework.com','scala-lang.org','scaladays.org','spray.io','akka.io','scala-sbt.org']);
ga('tsTracker.send', 'pageview');
</script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
<script type="text/javascript"> docsearch({
apiKey: 'e47ee877a07ea1c48722f08430d54913',
indexName: 'scala-sbt',
inputSelector: '#doc-search-bar',
debug: false // Set debug to true if you want to inspect the dropdown
});
</script>
</body>
</html>
14 changes: 14 additions & 0 deletions src/landing/_template/page.st
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
}
</script>
<!-- OneTrust Cookies Consent Notice (Production Standard, scala-sbt.org, en-GB) end -->

<link rel="stylesheet"href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
</head>
<body class="default">
<header>
Expand All @@ -35,6 +37,10 @@
</div>
</div>
<div class="col-md-9">
<div class="docsearch">
<input type="text" class = "ds-input" id="doc-search-bar" placeholder="Search...">
<ul class="result-container" id="result-container" style="display: none;"></ul>
</div>
<div class="nav" id="topbar">
<a href="/learn.html">Learn</a>
<a href="/download.html">Download</a>
Expand Down Expand Up @@ -152,5 +158,13 @@
ga('tsTracker.linker:autoLink', ['lightbend.com','playframework.com','scala-lang.org','scaladays.org','spray.io','akka.io','scala-sbt.org']);
ga('tsTracker.send', 'pageview');
</script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
<script type="text/javascript"> docsearch({
apiKey: 'e47ee877a07ea1c48722f08430d54913',
indexName: 'scala-sbt',
inputSelector: '#doc-search-bar',
debug: false // Set debug to true if you want to inspect the dropdown
});
</script>
</body>
</html>
17 changes: 15 additions & 2 deletions src/landing/assets/stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ body {
text-rendering: optimizeLegibility;
}
body header nav .row > div {
float: left;
/* float: left; */
}
body header nav .row > div:last-child {
float: right;
Expand Down Expand Up @@ -465,4 +465,17 @@ body .optanon-alert-box-wrapper .optanon-alert-box-bottom-padding {
color: white
}

/* test */
div.docsearch {
height:75px;
display:block;
float: left;

display: flex;
justify-content: center;
align-items: center;
}

div.docsearch input.ds-input {
max-width:200px;
float:left;
}
2 changes: 2 additions & 0 deletions src/reference/_sphinx/themes/sbt/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
{% set css_files = css_files + ['_static/docs.css'] %}
{% set css_files = css_files + ['_static/syntax.css'] %}
{% set css_files = css_files + ['https://fonts.googleapis.com/css?family=Exo:300,400,600,700'] %}
{% set css_files = css_files + ['https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css'] %}


{# do not display relbars #}
{% block relbar1 %}{% endblock %}
Expand Down
20 changes: 15 additions & 5 deletions src/reference/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ div.toccolumn {

div.header {
font-size: 18px;
color: #ffffff;
background-color: #ffffff;
height: 75px;
border-top: 5px solid #1a84ad; /* Lightbend azure */
border-top: 5px solid #1a84ad;
-webkit-box-shadow: 0px 4px 2px 0px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 4px 2px 0px rgba(0,0,0,0.3);
box-shadow: 0px 4px 2px 0px rgba(0,0,0,0.3);
Expand Down Expand Up @@ -48,10 +46,22 @@ div.header .nav {
border-bottom: 0px solid transparent;
}

div.header #topbar {
div.docsearch {
height:75px;
display:block;
float: left;

display: flex;
justify-content: center;
align-items: center;
}

div.docsearch input.ds-input {
max-width:200px;
float:left;
}

div.header .nav a {
div.header .nav>a {
display: inline-block;
font-weight: 400;
font-style: normal;
Expand Down
8 changes: 8 additions & 0 deletions src/reference/layouts/footer.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@
</footer>
<script src="/assets/versions.js"></script>
<script src="/assets/set-versions.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
<script type="text/javascript"> docsearch({
apiKey: 'e47ee877a07ea1c48722f08430d54913',
indexName: 'scala-sbt',
inputSelector: '#doc-search-bar',
debug: false // Set debug to true if you want to inspect the dropdown
});
</script>
24 changes: 15 additions & 9 deletions src/reference/layouts/header.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<link href="https://fonts.googleapis.com/css?family=Roboto:100normal,100italic,300normal,300italic,400normal,400italic,500normal,500italic,700normal,700italic,900normal,900italicc" rel="stylesheet" type="text/css"/>
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700,900,400italic,700italic" rel="stylesheet" type="text/css">
<!-- Algolia stylesheet -->
<link href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" rel="stylesheet" type = "text/css">
<div class="container-fluid top nav">
<div class="row w-100">
<div class="col-md-4">
Expand All @@ -9,15 +11,19 @@
</div>
</div>
<div class="col-md-8">
<div class="nav" id="topbar">
<a href="../../learn.html">Learn</a>
<a href="../../download.html">Download</a>
<a href="../../support.html">Support</a>
<a href="../../community.html">Get Involved</a>
<a id="source-code" href="https://github.com/sbt/sbt"><img src="files/github-logo-teal.svg" alt="Source code" class="social"></a>
<a id="twitter" href="https://twitter.com/scala_sbt"><img src="files/twitter-logo-teal.svg" alt="sbt on Twitter" class="social"></a>
<a id="edit-on-github" href="https://github.com/sbt/website/edit/develop/src/reference/$page.localPath$"><img src="files/octicon-pencil.svg" alt="Edit on GitHub"></a>
</div>
<div class="docsearch">
<input type="text" id="doc-search-bar" placeholder="Search...">
<ul class="result-container" id="result-container" style="display: none;"></ul>
</div>
<div class="nav" id="topbar">
<a href="../../learn.html">Learn</a>
<a href="../../download.html">Download</a>
<a href="../../support.html">Support</a>
<a href="../../community.html">Get Involved</a>
<a id="source-code" href="https://github.com/sbt/sbt"><img src="files/github-logo-teal.svg" alt="Source code" class="social"></a>
<a id="twitter" href="https://twitter.com/scala_sbt"><img src="files/twitter-logo-teal.svg" alt="sbt on Twitter" class="social"></a>
<a id="edit-on-github" href="https://github.com/sbt/website/edit/develop/src/reference/$page.localPath$"><img src="files/octicon-pencil.svg" alt="Edit on GitHub"></a>
</div>
</div>
</div>
</div>
Expand Down