This is an automated email from the ASF dual-hosted git repository.
carlosrovira pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/royale-docs.git
The following commit(s) were added to refs/heads/master by this push:
new 131c0ec trying new search docs capability
131c0ec is described below
commit 131c0ec42593493f67e66a8ecf9de9aa232b277a
Author: Carlos Rovira <[email protected]>
AuthorDate: Tue Aug 27 20:03:37 2019 +0200
trying new search docs capability
---
_config.yml => Gemfile | 13 ++++----
Gemfile.lock | 87 ++++++++++++++++++++++++++++++++++++++++++++++++
_config.yml | 6 +++-
_includes/algolia.html | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++
_layouts/docpage.html | 19 +++++++++++
5 files changed, 207 insertions(+), 7 deletions(-)
diff --git a/_config.yml b/Gemfile
similarity index 81%
copy from _config.yml
copy to Gemfile
index 164691b..6d4ff7e 100644
--- a/_config.yml
+++ b/Gemfile
@@ -13,9 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-title: Apache Royale Documentation
-baseurl: /royale-docs
-highlighter: rouge
-sass:
- sass_dir: _sass
- style: compressed # possible values: nested expanded compact compressed
\ No newline at end of file
+source 'https://rubygems.org'
+
+gem 'jekyll', '~> 3.6'
+
+group :jekyll_plugins do
+ gem 'jekyll-algolia'
+end
\ No newline at end of file
diff --git a/Gemfile.lock b/Gemfile.lock
new file mode 100644
index 0000000..b00e6b3
--- /dev/null
+++ b/Gemfile.lock
@@ -0,0 +1,87 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ addressable (2.6.0)
+ public_suffix (>= 2.0.2, < 4.0)
+ algolia_html_extractor (2.6.2)
+ json (~> 2.0)
+ nokogiri (~> 1.10.4)
+ algoliasearch (1.26.1)
+ httpclient (~> 2.8, >= 2.8.3)
+ json (>= 1.5.1)
+ colorator (1.1.0)
+ concurrent-ruby (1.1.5)
+ em-websocket (0.5.1)
+ eventmachine (>= 0.12.9)
+ http_parser.rb (~> 0.6.0)
+ eventmachine (1.2.7)
+ ffi (1.11.1)
+ filesize (0.2.0)
+ forwardable-extended (2.6.0)
+ http_parser.rb (0.6.0)
+ httpclient (2.8.3)
+ i18n (0.9.5)
+ concurrent-ruby (~> 1.0)
+ jekyll (3.8.6)
+ addressable (~> 2.4)
+ colorator (~> 1.0)
+ em-websocket (~> 0.5)
+ i18n (~> 0.7)
+ jekyll-sass-converter (~> 1.0)
+ jekyll-watch (~> 2.0)
+ kramdown (~> 1.14)
+ liquid (~> 4.0)
+ mercenary (~> 0.3.3)
+ pathutil (~> 0.9)
+ rouge (>= 1.7, < 4)
+ safe_yaml (~> 1.0)
+ jekyll-algolia (1.4.11)
+ algolia_html_extractor (~> 2.6)
+ algoliasearch (~> 1.25)
+ filesize (~> 0.1)
+ jekyll (~> 3.0)
+ json (~> 2.0)
+ nokogiri (~> 1.6)
+ progressbar (~> 1.9)
+ verbal_expressions (~> 0.1.5)
+ jekyll-sass-converter (1.5.2)
+ sass (~> 3.4)
+ jekyll-watch (2.2.1)
+ listen (~> 3.0)
+ json (2.2.0)
+ kramdown (1.17.0)
+ liquid (4.0.3)
+ listen (3.1.5)
+ rb-fsevent (~> 0.9, >= 0.9.4)
+ rb-inotify (~> 0.9, >= 0.9.7)
+ ruby_dep (~> 1.2)
+ mercenary (0.3.6)
+ mini_portile2 (2.4.0)
+ nokogiri (1.10.4)
+ mini_portile2 (~> 2.4.0)
+ pathutil (0.16.2)
+ forwardable-extended (~> 2.6)
+ progressbar (1.10.1)
+ public_suffix (3.1.1)
+ rb-fsevent (0.10.3)
+ rb-inotify (0.10.0)
+ ffi (~> 1.0)
+ rouge (3.9.0)
+ ruby_dep (1.5.0)
+ safe_yaml (1.0.5)
+ sass (3.7.4)
+ sass-listen (~> 4.0.0)
+ sass-listen (4.0.0)
+ rb-fsevent (~> 0.9, >= 0.9.4)
+ rb-inotify (~> 0.9, >= 0.9.7)
+ verbal_expressions (0.1.5)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ jekyll (~> 3.6)
+ jekyll-algolia
+
+BUNDLED WITH
+ 2.0.2
diff --git a/_config.yml b/_config.yml
index 164691b..99002b8 100644
--- a/_config.yml
+++ b/_config.yml
@@ -18,4 +18,8 @@ baseurl: /royale-docs
highlighter: rouge
sass:
sass_dir: _sass
- style: compressed # possible values: nested expanded compact compressed
\ No newline at end of file
+ style: compressed # possible values: nested expanded compact compressed
+algolia:
+ application_id: RDWVZJYELD
+ index_name: royale_docs
+ search_only_api_key: 890fa760fbe09782229acd811738def3
\ No newline at end of file
diff --git a/_includes/algolia.html b/_includes/algolia.html
new file mode 100644
index 0000000..6df0320
--- /dev/null
+++ b/_includes/algolia.html
@@ -0,0 +1,89 @@
+<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/instantsearch.min.js"></script>
+<script
src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.20.1/moment.min.js"></script>
+<link rel="stylesheet" type="text/css"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/instantsearch.min.css">
+<link rel="stylesheet" type="text/css"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/instantsearch-theme-algolia.min.css">
+<base href="{{ site.baseurl }}">
+
+<script>
+const search = instantsearch({
+ appId: '{{ site.algolia.application_id }}',
+ apiKey: '{{ site.algolia.search_only_api_key }}',
+ indexName: '{{ site.algolia.index_name }}'
+});
+
+const hitTemplate = function(hit) {
+ let url = `{{ site.baseurl }}${hit.url}#${hit.anchor}`;
+
+ const title = hit._highlightResult.title.value;
+
+ let breadcrumbs = '';
+ if (hit._highlightResult.headings) {
+ breadcrumbs = hit._highlightResult.headings.map(match => {
+ return `<span class="post-breadcrumb">${match.value}</span>`
+ }).join(' > ')
+ }
+ const content = hit._highlightResult.html.value;
+
+ return `
+ <div class="post-item">
+ <h2><a class="post-link" href="${url}">${title}</a></h2>
+ {{#breadcrumbs}}<a href="${url}"
class="post-breadcrumbs">${breadcrumbs}</a>{{/breadcrumbs}}
+ <div class="post-snippet">${content}</div>
+ </div>
+ `;
+}
+
+search.addWidget(
+ instantsearch.widgets.searchBox({
+ container: '#search-searchbar',
+ placeholder: 'Search into pages...',
+ poweredBy: true
+ })
+);
+
+search.addWidget(
+ instantsearch.widgets.hits({
+ container: '#search-hits',
+ templates: {
+ item: hitTemplate
+ }
+ })
+);
+
+search.start();
+</script>
+
+<style>
+.ais-search-box {
+ max-width: 100%;
+ margin-bottom: 15px;
+}
+.post-item {
+ margin-bottom: 30px;
+}
+.post-link .ais-Highlight {
+ color: #111;
+ font-style: normal;
+ text-decoration: underline;
+}
+.post-breadcrumbs {
+ color: #424242;
+ display: block;
+}
+.post-breadcrumb {
+ font-size: 18px;
+ color: #424242;
+}
+.post-breadcrumb .ais-Highlight {
+ font-weight: bold;
+ font-style: normal;
+}
+.post-snippet .ais-Highlight {
+ color: #2a7ae2;
+ font-style: normal;
+ font-weight: bold;
+}
+.post-snippet img {
+ display: none;
+}
+</style>
\ No newline at end of file
diff --git a/_layouts/docpage.html b/_layouts/docpage.html
index 4496045..75239de 100644
--- a/_layouts/docpage.html
+++ b/_layouts/docpage.html
@@ -105,14 +105,31 @@ limitations under the License.
</header>
<div class="toc_and_doc">
+
<div class="content" id="content">
+
{{content}}
+
+ <div class="post-list" id="search-hits">
+ {% for post in site.pages %}
+ <div class="post-item">
+ <h3>
+ <a class="post-link" href="{{ page.url | relative_url }}">{{
page.title | escape }}</a>
+ </h3>
+ <div class="post-snippet">{{ page.description | description
}}</div>
+ </div>
+ {% endfor %}
+ </div>
+
+
+
<div class="bottom-links">
<a href="https://github.com/apache/royale-docs/edit/master/{{
page.path }}" target="_blank">Edit this page</a>
</div>
</div>
<div class="toc" id="toc">
+ <div id="search-searchbar"></div>
{% assign pagepathparts = page.path | split: "/" %}
{% assign numparts = pagepathparts | size %}
@@ -406,5 +423,7 @@ limitations under the License.
</div>
</div>
+ {% include algolia.html %}
+
</body>
</html>