You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ct...@apache.org on 2020/01/07 15:19:36 UTC
[lucene-solr] 01/06: WIP redesign of Ref Guide layout: bootstrap
upgrade, replace TOC functions
This is an automated email from the ASF dual-hosted git repository.
ctargett pushed a commit to branch jira/solr-14173
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
commit 47f656d625027c45f30523129cc1dc3337b0146f
Author: Cassandra Targett <ca...@lucidworks.com>
AuthorDate: Sat Dec 7 08:28:12 2019 -0600
WIP redesign of Ref Guide layout: bootstrap upgrade, replace TOC functions
---
solr/solr-ref-guide/src/_includes/head.html | 17 ++--
solr/solr-ref-guide/src/_includes/sidebar.html | 35 ++++++--
solr/solr-ref-guide/src/_includes/topnav.html | 43 +++-------
solr/solr-ref-guide/src/_layouts/default.html | 27 +++---
solr/solr-ref-guide/src/_layouts/home.html | 2 +-
solr/solr-ref-guide/src/_layouts/page.html | 15 ++--
solr/solr-ref-guide/src/_templates/open.html.slim | 2 +-
solr/solr-ref-guide/src/css/customstyles.css | 100 +++++++++++++++++++---
solr/solr-ref-guide/src/css/lavish-bootstrap.css | 5 +-
solr/solr-ref-guide/src/css/ref-guide.css | 3 +-
solr/solr-ref-guide/src/css/theme-solr.css | 2 +-
solr/solr-ref-guide/src/index.adoc | 17 ++--
solr/solr-ref-guide/src/js/customscripts.js | 21 ++++-
13 files changed, 195 insertions(+), 94 deletions(-)
diff --git a/solr/solr-ref-guide/src/_includes/head.html b/solr/solr-ref-guide/src/_includes/head.html
index 94d4fef..07a90b7 100755
--- a/solr/solr-ref-guide/src/_includes/head.html
+++ b/solr/solr-ref-guide/src/_includes/head.html
@@ -7,19 +7,24 @@
<title>{% if page_id != "index" %}{{ page.title }} | {% endif %}{{ site.site_title }} {{ site.solr-attributes.solr-guide-version}}</title>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
-<!--<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">-->
-<link rel="stylesheet" href="{{ "css/lavish-bootstrap.css" }}">
+<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="{{ "css/customstyles.css" }}">
<link rel="stylesheet" href="{{ "css/theme-solr.css" }}">
<link rel="stylesheet" href="{{ "css/ref-guide.css" }}">
-<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
+<!-- Scrollbar Custom CSS -->
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.min.css">
+<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
+
+<script
+ src="https://code.jquery.com/jquery-3.4.1.min.js"
+ integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
+ crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script src="{{ "js/jquery.navgoco.min.js" }}"></script>
-<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
-<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/2.0.0/anchor.min.js"></script>
-<script src="{{ "js/toc.js" }}"></script>
+<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.2.0/anchor.min.js"></script>
<script src="{{ "js/customscripts.js" }}"></script>
<link rel="shortcut icon" href="{{ "images/icons/favicon.ico" }}">
diff --git a/solr/solr-ref-guide/src/_includes/sidebar.html b/solr/solr-ref-guide/src/_includes/sidebar.html
index a87fe37..ed9524d 100755
--- a/solr/solr-ref-guide/src/_includes/sidebar.html
+++ b/solr/solr-ref-guide/src/_includes/sidebar.html
@@ -1,13 +1,37 @@
{% assign sidebar = site.data.sidebar %}
-
-<ul id="mysidebar" class="nav">
- <li class="sidebarTitle">{{sidebar.title}}</li>
+<div class="sidebar-header">
+ <h4 class="text-center">{{sidebar.title}}</h4>
{% if "" != site.solr-attributes.solr-guide-draft-status %}
- <li class="draft-notice">
+ <p class="draft-notice">
This is an unofficial DRAFT of the Guide for {{ site.solr-attributes.solr-docs-version }}.
<a href="https://lucene.apache.org/solr/guide/">Official releases are available from the Solr website</a>.
- </li>
+ </p>
{% endif %}
+
+ <!--comment out this block if you want to hide search-->
+ <!--start search-->
+ <form id="search-demo-container" class="form-row container">
+ <input type="text" id="search-input" class="form-control" placeholder="{{site.data.strings.search_placeholder_text}}">
+ <ul id="results-container"></ul>
+ </form>
+ <script src="{{ "js/jekyll-search.js"}}" type="text/javascript"></script>
+ <script type="text/javascript">
+ SimpleJekyllSearch.init({
+ searchInput: document.getElementById('search-input'),
+ resultsContainer: document.getElementById('results-container'),
+ dataSource: '{{ "search.json" }}',
+ searchResultTemplate: '<li><a href="{url}" title="{{page.title | replace: "'", "\"}}">{title}</a></li>',
+ noResultsText: '{{site.data.strings.search_no_results_text}}',
+ limit: 10,
+ fuzzy: true,
+ })
+ </script>
+ <!--end search-->
+
+ </div>
+
+
+<ul class="nav" id="mysidebar">
{% for level1item in sidebar.kids %}
<li class="sb-level1">
<a href="{{level1item.url | remove: "/"}}">{{ level1item.title }}</a>
@@ -46,6 +70,7 @@
</li>
{% endfor %}
</ul>
+
{% comment %}
<!-- if you aren't using the accordion, uncomment this block:
<p class="external">
diff --git a/solr/solr-ref-guide/src/_includes/topnav.html b/solr/solr-ref-guide/src/_includes/topnav.html
index 03008a0..1b4e1b0 100755
--- a/solr/solr-ref-guide/src/_includes/topnav.html
+++ b/solr/solr-ref-guide/src/_includes/topnav.html
@@ -1,17 +1,18 @@
<!-- Navigation -->
-<nav class="navbar navbar-inverse navbar-fixed-top">
- <div class="container topnavlinks">
+<nav class="navbar navbar-expand-lg fixed-top">
+ <div class="container">
<div class="navbar-header">
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
+ <button type="button" id="sidebarCollapse" class="btn btn-info">
+ <i class="fa fa-bars"></i>
+ <span>Sidebar</span>
+ </button>
{% comment %} NOTE: Explicitly using *SOLR* version here (not guide){% endcomment %}
- <a class="fa fa-home fa-lg navbar-brand" href="index.html"> <span class="projectTitle"> {{site.topnav_title}} {{ site.solr-attributes.solr-docs-version }}</span></a>
+ <a class="navbar-brand" href="index.html">
+ <img src="images/solr-sunOnly-small.png" width="30" height="30">
+ <span class="projectTitle"> Solr {{ site.solr-attributes.solr-docs-version }}</span>
+ </a>
</div>
- <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
+ <div class="collapse navbar-collapse justify-content-end" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<!-- Link to Solr website -->
<li><a href="https://lucene.apache.org/solr/" target="_blank">Solr Website</a></li>
@@ -32,27 +33,7 @@
<li><a href="https://lucene.apache.org/solr/community.html" target="_blank">Solr Community Links</a></li>
</ul>
</li>
- <!--comment out this block if you want to hide search-->
- <li>
- <!--start search-->
- <div id="search-demo-container">
- <input type="text" id="search-input" placeholder="{{site.data.strings.search_placeholder_text}}">
- <ul id="results-container"></ul>
- </div>
- <script src="{{ "js/jekyll-search.js"}}" type="text/javascript"></script>
- <script type="text/javascript">
- SimpleJekyllSearch.init({
- searchInput: document.getElementById('search-input'),
- resultsContainer: document.getElementById('results-container'),
- dataSource: '{{ "search.json" }}',
- searchResultTemplate: '<li><a href="{url}" title="{{page.title | replace: "'", "\"}}">{title}</a></li>',
- noResultsText: '{{site.data.strings.search_no_results_text}}',
- limit: 10,
- fuzzy: true,
- })
- </script>
- <!--end search-->
- </li>
+
</ul>
</div>
</div>
diff --git a/solr/solr-ref-guide/src/_layouts/default.html b/solr/solr-ref-guide/src/_layouts/default.html
index 249f10a..ba628b2 100755
--- a/solr/solr-ref-guide/src/_layouts/default.html
+++ b/solr/solr-ref-guide/src/_layouts/default.html
@@ -34,25 +34,22 @@
</script>
</head>
<body class="{{ site.solr-attributes.solr-guide-draft-status }}" id="{{ page_id }}">
-{% include topnav.html %}
-<!-- Page Content -->
-<div class="container">
- <div class="col-lg-12"> </div>
- <!-- Content Row -->
- <div class="row">
- <!-- Sidebar Column -->
- <nav class="col-md-3">
- {% include sidebar.html %}
- </nav>
- <!-- Content Column -->
- <article class="col-md-9 post-content">
+<div class="wrapper">
+ <nav id="sidebar">
+ {% include sidebar.html %}
+</nav>
+ <div id="content">
+ {% include topnav.html %}
+ <article class="post-content">
{{content}}
</article>
- <!-- /.row -->
+ {% include footer.html %}
</div>
- {% include footer.html %}
- <!-- /.container -->
</div>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
+
+<script src="https://cdnjs.cloudflare.com/ajax/libs/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.concat.min.js"></script>
+
</body>
</html>
diff --git a/solr/solr-ref-guide/src/_layouts/home.html b/solr/solr-ref-guide/src/_layouts/home.html
index cfaac56..8af80f8 100644
--- a/solr/solr-ref-guide/src/_layouts/home.html
+++ b/solr/solr-ref-guide/src/_layouts/home.html
@@ -10,7 +10,7 @@ layout: default
{% comment %}NOTE: page_id is also definied in default.html{% endcomment %}
{% assign page_id = page.url | split: '/' | last | remove: '.html' %}
<div class="post-header">
- <h1 class="post-title-main"></h1>
+ <h1 class="title-main"></h1>
</div>
<div class="post-content">
diff --git a/solr/solr-ref-guide/src/_layouts/page.html b/solr/solr-ref-guide/src/_layouts/page.html
index 12adbb9..ebb017a 100755
--- a/solr/solr-ref-guide/src/_layouts/page.html
+++ b/solr/solr-ref-guide/src/_layouts/page.html
@@ -7,13 +7,15 @@ layout: default
<h1 class="title-main">{{ page.title }}</h1>
</header>
- {% unless page.toc == false %}
- {% include toc.html %}
- {% endunless %}
+<div class="container">
+ <nav class="toc float-right justify-content-end">
+ {{page.document | tocify_asciidoc }}
+</nav>
+ <section class="content">
+ {{ content }}
+ </section>
+
-<section class="content">
- {{content}}
-</section>
<!-- Adds tags, if any -->
<div class="tags">
@@ -40,3 +42,4 @@ layout: default
{% endif %}
</nav>
{% endif %}
+</div>
diff --git a/solr/solr-ref-guide/src/_templates/open.html.slim b/solr/solr-ref-guide/src/_templates/open.html.slim
index 9a0d280..c84bde5 100644
--- a/solr/solr-ref-guide/src/_templates/open.html.slim
+++ b/solr/solr-ref-guide/src/_templates/open.html.slim
@@ -4,4 +4,4 @@
blockquote =content
- elsif style != 'partintro' || partintro_allowed?
= block_with_title :class=>['openblock', (style if style != 'open')]
- .content =content
+ .content.row =content
diff --git a/solr/solr-ref-guide/src/css/customstyles.css b/solr/solr-ref-guide/src/css/customstyles.css
index a220103..808f024 100755
--- a/solr/solr-ref-guide/src/css/customstyles.css
+++ b/solr/solr-ref-guide/src/css/customstyles.css
@@ -1,4 +1,81 @@
+/** Sets page wrapper and sidebar **/
+.wrapper {
+ display: flex;
+ width: 100%;
+}
+
+#sidebar {
+ width: 275px;
+ position: fixed;
+ top: 0;
+ left: 0;
+ height: 100vh;
+ z-index: 999;
+ background: #305CB3;
+ transition: all 0.3s;
+}
+
+#sidebar.active {
+ margin-left: -275px;
+}
+
+
+@media (max-width: 768px) {
+ #sidebar {
+ margin-left: -250px;
+ }
+ #sidebar.active {
+ margin-left: 0;
+ }
+}
+
+.sidebar-header {
+ padding-left: 5px;
+ color: #fff;
+}
+
+.sidebar-header h4 {
+ color: #fff;
+ font-size: 20px;
+ font-weight: bold;
+ margin-bottom: 20px;
+}
+
+.sidebar-header a {
+ color: #fff;
+}
+
+#mysidebar.nav a {
+ color: #fff;
+}
+
+#mysidebar.nav > li {
+ width: 275px;
+}
+
+#mysidebar.nav ul {
+ background-color: #FF833D;
+}
+
+#mysidebar.nav ul li a {
+ background-color: #FF833D;
+ font-weight: bold;
+ color: white;
+ border: none;
+}
+
+.navbar .container {
+ margin-left: 275px;
+ border: solid;
+ border-color: whitesmoke;
+ background-color: white;
+}
+
+.form-row {
+ padding-bottom: 15px;
+}
+
.gi-2x{font-size: 2em;}
.gi-3x{font-size: 3em;}
.gi-4x{font-size: 4em;}
@@ -35,6 +112,10 @@
.breadcrumb > .active {color: #777 !important;}
+/* .post-content {
+ width: calc(100% - 250px);
+} */
+
.post-content img {
margin: 12px 0 3px 0;
width: auto;
@@ -62,6 +143,7 @@ ul.nav.nav-pills li {
margin-bottom:12px;
}
+
.bs-example{
margin: 20px;
}
@@ -243,7 +325,6 @@ background-color: #347DBE;
.nav li a {
line-height: 18px;
padding: 2px 10px;
- background-color: #f1f1f1;
}
.nav li.draft-notice {
/* we don't want the draft water mark to make this hard to notice */
@@ -271,7 +352,7 @@ background-color: #347DBE;
line-height: 30px;
}
-ul#mysidebar {
+ul#sidebar {
border-radius:0;
}
@@ -560,9 +641,7 @@ ol.series li {
display:block;
}
-#mysidebar .nav ul {
- background-color: #FAFAFA;
-}
+
.nav ul.series li {
list-style: decimal;
font-size:12px;
@@ -673,21 +752,14 @@ span.soft {
}
@media (max-width: 990px) {
- #mysidebar {
+ #sidebar {
position: relative;
}
}
-@media (min-width: 1000px) {
-
- ul#mysidebar {
- width: 225px;
- }
-}
-
@media (max-width: 900px) {
- ul#mysidebar {
+ ul#sidebar {
max-width: 100%;
}
}
diff --git a/solr/solr-ref-guide/src/css/lavish-bootstrap.css b/solr/solr-ref-guide/src/css/lavish-bootstrap.css
index d0c30db..49051eb 100755
--- a/solr/solr-ref-guide/src/css/lavish-bootstrap.css
+++ b/solr/solr-ref-guide/src/css/lavish-bootstrap.css
@@ -155,6 +155,8 @@ textarea {
overflow: auto;
vertical-align: top;
}
+
+/** Remove print style
@media print {
* {
text-shadow: none !important;
@@ -226,7 +228,8 @@ textarea {
.table-bordered td {
border: 1px solid #ddd !important;
}
-}
+} **/
+
html {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
diff --git a/solr/solr-ref-guide/src/css/ref-guide.css b/solr/solr-ref-guide/src/css/ref-guide.css
index 6ea3085..795eed0 100644
--- a/solr/solr-ref-guide/src/css/ref-guide.css
+++ b/solr/solr-ref-guide/src/css/ref-guide.css
@@ -57,7 +57,7 @@ script {
display: none!important;
}
-html {
+html, body, p {
font-family: 'Noto Sans', sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
@@ -990,6 +990,7 @@ p a > code:hover
#content
{
margin-top: 1.25em;
+ width: calc(100% - 250px);
}
#content:before
diff --git a/solr/solr-ref-guide/src/css/theme-solr.css b/solr/solr-ref-guide/src/css/theme-solr.css
index 91ddf54..7f52435 100644
--- a/solr/solr-ref-guide/src/css/theme-solr.css
+++ b/solr/solr-ref-guide/src/css/theme-solr.css
@@ -60,7 +60,7 @@ a[data-toggle="tooltip"] {
.btn-info,
a[data-toggle].btn-info {
- background-color: #FF833D;
+ background-color: #F35B38;
font-size: 16px;
text-decoration: none;
color: #FFFFFF;
diff --git a/solr/solr-ref-guide/src/index.adoc b/solr/solr-ref-guide/src/index.adoc
index f187d2a..471557b 100644
--- a/solr/solr-ref-guide/src/index.adoc
+++ b/solr/solr-ref-guide/src/index.adoc
@@ -57,10 +57,9 @@ endif::[]
The Guide includes the following sections:
-[.row.match-my-cols]
--
.Getting Started with Solr
-[sidebar.col-sm-6.col-md-4]
+[sidebar.col-sm]
****
The *<<getting-started.adoc#getting-started,Getting Started>>* section guides you through the installation and setup of Solr. A detailed tutorial for first-time users shows many of Solr's features.
@@ -69,7 +68,7 @@ The *<<getting-started.adoc#getting-started,Getting Started>>* section guides yo
****
.Deploying Solr
-[sidebar.col-sm-6.col-md-4]
+[sidebar.col-sm]
****
*<<deployment-and-operations.adoc#deployment-and-operations,Deployment and Operations>>*: Once you have Solr configured, you want to deploy it to production and keep it up to date. This section includes information about how to take Solr to production, run it in HDFS or AWS, and information about upgrades and managing Solr from the command line.
@@ -78,17 +77,15 @@ The *<<getting-started.adoc#getting-started,Getting Started>>* section guides yo
****
--
-[.row]
--
'''
--
-[.row.match-my-cols]
--
.Indexing Documents
-[sidebar.col-sm-6.col-md-4]
+[sidebar.col-sm]
****
*<<indexing-and-basic-data-operations.adoc#indexing-and-basic-data-operations,Indexing and Basic Data Operations>>*: This section describes the indexing process and basic index operations, such as commit, optimize, and rollback.
@@ -98,7 +95,7 @@ The *<<getting-started.adoc#getting-started,Getting Started>>* section guides yo
****
.Searching Documents
-[sidebar.col-sm-6.col-md-4]
+[sidebar.col-sm]
****
*<<searching.adoc#searching,Searching>>*: This section presents an overview of the search process in Solr. It describes the main components used in searches, including request handlers, query parsers, and response writers. It lists the query parameters that can be passed to Solr, and it describes features such as boosting and faceting, which can be used to fine-tune search results.
@@ -109,17 +106,15 @@ The *<<getting-started.adoc#getting-started,Getting Started>>* section guides yo
****
--
-[.row]
--
'''
--
-[.row.match-my-cols]
--
.Scaling Solr
-[sidebar.col-sm-6.col-md-4]
+[sidebar.col-sm]
****
*<<solrcloud.adoc#solrcloud,SolrCloud>>*: This section describes SolrCloud, which provides comprehensive distributed capabilities.
@@ -127,7 +122,7 @@ The *<<getting-started.adoc#getting-started,Getting Started>>* section guides yo
****
.Advanced Configuration
-[sidebar.col-sm-6.col-md-4]
+[sidebar.col-sm]
****
*<<securing-solr.adoc#securing-solr,Securing Solr>>*: When planning how to secure Solr, you should consider which of the available features or approaches are right for you.
diff --git a/solr/solr-ref-guide/src/js/customscripts.js b/solr/solr-ref-guide/src/js/customscripts.js
index 29c4f2e..8c1d44d 100755
--- a/solr/solr-ref-guide/src/js/customscripts.js
+++ b/solr/solr-ref-guide/src/js/customscripts.js
@@ -1,5 +1,5 @@
-$('#mysidebar').height($(".nav").height());
+//$('#sidebar').height($(".nav").height());
$( document ).ready(function() {
@@ -101,3 +101,22 @@ $(function() {
}
});
});
+
+
+$(document).ready(function () {
+
+ $("#sidebar").mCustomScrollbar({
+ theme: "minimal"
+ });
+
+ $('#sidebarCollapse').on('click', function () {
+ // open or close navbar
+ $('#sidebar').toggleClass('active');
+ // close dropdowns
+ $('.collapse.in').toggleClass('in');
+ // and also adjust aria-expanded attributes we use for the open/closed arrows
+ // in our CSS
+ $('a[aria-expanded=true]').attr('aria-expanded', 'false');
+ });
+
+});