Skip to content

Commit

Permalink
Merge pull request #549 from cloud-elements/optimize
Browse files Browse the repository at this point in the history
Optimize
  • Loading branch information
Clayton Shaver committed Apr 11, 2017
2 parents 4b9fbac + 2ca26aa commit 674505e
Show file tree
Hide file tree
Showing 1,205 changed files with 3,599 additions and 1,408 deletions.
4 changes: 4 additions & 0 deletions 0.9
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Successfully installed rb-inotify-0.9.8
Parsing documentation for rb-inotify-0.9.8
Installing ri documentation for rb-inotify-0.9.8
Done installing documentation for rb-inotify after 0 seconds
16 changes: 16 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
source 'https://rubygems.org'

gem 'json', '~> 1.8.6'

gem 'rb-inotify', '~> 0.9.7'

gem 'jekyll'

gem 'rake'

group :jekyll_plugins do
gem 'algoliasearch-jekyll', '~> 0.8.0'
gem 'jekyll-redirect-from'
gem 'redcarpet'
gem 'jekyll-youtube'
end
82 changes: 82 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.5.0)
public_suffix (~> 2.0, >= 2.0.2)
algoliasearch (1.12.6)
httpclient (~> 2.8.3)
json (>= 1.5.1)
algoliasearch-jekyll (0.8.0)
algoliasearch (~> 1.4)
appraisal (~> 2.1.0)
awesome_print (~> 1.6)
json (~> 1.8)
nokogiri (~> 1.6)
verbal_expressions (~> 0.1.5)
appraisal (2.1.0)
bundler
rake
thor (>= 0.14.0)
awesome_print (1.7.0)
colorator (1.1.0)
ffi (1.9.17)
forwardable-extended (2.6.0)
httpclient (2.8.3)
jekyll (3.4.0)
addressable (~> 2.4)
colorator (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 3.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (~> 1.7)
safe_yaml (~> 1.0)
jekyll-redirect-from (0.12.1)
jekyll (~> 3.3)
jekyll-sass-converter (1.5.0)
sass (~> 3.4)
jekyll-watch (1.5.0)
listen (~> 3.0, < 3.1)
jekyll-youtube (1.0.0)
jekyll
json (1.8.6)
kramdown (1.13.2)
liquid (3.0.6)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
mercenary (0.3.6)
mini_portile2 (2.1.0)
nokogiri (1.7.0.1)
mini_portile2 (~> 2.1.0)
pathutil (0.14.0)
forwardable-extended (~> 2.6)
public_suffix (2.0.5)
rake (12.0.0)
rb-fsevent (0.9.8)
rb-inotify (0.9.8)
ffi (>= 0.5.0)
redcarpet (3.4.0)
rouge (1.11.1)
safe_yaml (1.0.4)
sass (3.4.23)
thor (0.19.4)
verbal_expressions (0.1.5)

PLATFORMS
ruby

DEPENDENCIES
algoliasearch-jekyll (~> 0.8.0)
jekyll
jekyll-redirect-from
jekyll-youtube
json (~> 1.8.6)
rake
rb-inotify (~> 0.9.7)
redcarpet

BUNDLED WITH
1.14.5
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# devportal <sub><sup>| Cloud Elements developer portal</sup></sub>
# devportal 2.0 <sub><sup>| Cloud Elements developer portal</sup></sub>

** Please Note: Layouts, installation, and usage instructions have changed for devportal 2.0 **

This site is based on [Jekyll](http://jekyllrb.com/), with a dash of [Twitter Bootstrap](http://themes.getbootstrap.com/products/dashboard) added.

Expand All @@ -23,15 +25,17 @@ _Please_, feel free to make any contributions you feel will make Cloud Elements
```bash
$ git clone [email protected]:cloud-elements/devportal.git
$ cd devportal
$ sudo gem install jekyll redcarpet jekyll-sitemap jekyll-redirect-from jekyll-youtube
$ bundle install
```

## Usage

```bash
$ jekyll serve
$ bundle exec jekyll serve --incremental
```

**Note:** The `--incremental` flag will build only the changed files.

Now browse to [http://127.0.0.1:4000/](http://127.0.0.1:4000/) and code away!

## Site Structure
Expand Down Expand Up @@ -95,7 +99,7 @@ heading: Salesforce CRM
seo: Overview | Salesforce CRM | Cloud Elements API Docs
title: Overview
description: Integrate Salesforce CRM into your application via the Cloud Elements APIs.
layout: docs
layout: sidebarelementdoc
breadcrumbs: /docs/elements.html
elementId: 23
parent: Back to Element Guides
Expand All @@ -112,7 +116,7 @@ heading: Instance APIs
seo: Instance APIs Overview | Cloud Elements API Docs
title: Overview
description: Find API documentation and example API calls.
layout: docs
layout: sidebarleft
platform: instances
breadcrumbs: /docs/platform/platform-docs.html
parent: Back to Platform Docs
Expand All @@ -121,6 +125,23 @@ sitemap: false
---
```

## Layouts:

There are three layouts that can be used.

- Element Pages should use the `sidebarelementdoc` layout
- Product Pages (non element pages) should use the `sidebarleft` layout
- Any pages that include swagger should use the `sidebarapidocs` layout

## Alternate content tab usage:

In order to create the alternate tab content, one of two values is added to the YAMl at the top of the page.

- To point to alternate API content from a UI page:
- `restContentVersion: <link to rest content>`
- To point to alternate UI content from a API page:
- `uiContentVersion`: <link to UI content>`

## License
(The MIT License)

Expand Down
19 changes: 19 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,22 @@ url: https://developers.cloud-elements.com
gems:
- jekyll-redirect-from
- jekyll-youtube
- algoliasearch-jekyll

algolia:
application_id: 'G8W6UO94HX'
index_name: 'developer_portal_pages'
settings:
attributesToIndex:
- title
- heading
- seo
- description
- h1
- h2
- h3
- h4
- h5
- h6
- unordered(text)
- unordered(tags)
21 changes: 21 additions & 0 deletions _includes/contentToggle.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<link href="/assets/css/contentToggle.css" rel="stylesheet">
{% if page.restContentVersion != null%}
<div class="toggleButtonWrapper">
<a class="button leftButton active">
UI
</a>
<a class="button rightButton" href={{page.restContentVersion}}>
API
</a>
</div>
{% endif %}
{% if page.uiContentVersion != null%}
<div class="toggleButtonWrapper">
<a class="button leftButton" href={{page.uiContentVersion}}>
UI
</a>
<a class="button rightButton active">
API
</a>
</div>
{% endif %}
125 changes: 63 additions & 62 deletions _includes/nav.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,40 @@
<!-- Main Nav -->
<!-- Include the aloglia light search client from jsdelivr-->
<script src="https://cdn.jsdelivr.net/algoliasearch/3/algoliasearchLite.min.js"></script>
<script type="text/javascript">
let client = algoliasearch('G8W6UO94HX', 'f8dafac4c9e969eecadf7f97f8d3f15f');
let index = client.initIndex('developer_portal_pages');
let results;
function executeSearch(){
let resultsList = document.getElementById('resultsList');
resultsList.innerHTML = '';
let searchTerm = document.getElementById('searchBox').value;
// Only execute the search if the user has entered at least 3 characters
if(searchTerm.length >= 3){
index.search(searchTerm, function searchDone(err, content) {
// Loop through the results returned by aloglia
console.log(content);
content.hits.forEach(element => {
let listItem = document.createElement('li');
listItem.setAttribute("class", "resultsItem");
listItem.innerHTML =
listItem.innerHTML + '<a href='+element.url+'>' + element.heading + ' | ' + element.title + '</a>' + '<br/>' + element._snippetResult.text.value;
resultsList.appendChild(listItem);
})
});
}
if(searchTerm.length >= 3){
document.getElementById("resultsContainer").className = "searchResultsContainerActive";
}
else{
document.getElementById("resultsContainer").className = "searchResultsContainer";
}
}
</script>
<link href="/assets/css/navbar.css" rel="stylesheet">
<nav class="nav navbar navbar-light navbar-fixed-top">
<div id="search-bar-wrapper" class="search-bar-wrapper">
<a class="icon icon-database status-link" href="http://status.cloud-elements.com/" target="_blank">STATUS</a>
<a class="icon icon-text-document status-link" href="http://changelog.cloud-elements.com/" target="_blank">CHANGE LOG</a>
<div class="flextable">
<div class="flextable-item flextable-primary">
<form action="{{ '/search' | prepend: site.baseurl }}" method="GET">
<input type="text" name="query" class="form-control" placeholder="Search Docs">
</form>
</div>
<div class="flextable-item flextable-primary icon">
<span class="icon icon-magnifying-glass"></span>
</div>
</div>
</div>
<div class="container-fluid navbar-wraper">
<div class="navbar-header">
<div class="navbar-header col-md-2">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
Expand All @@ -26,57 +45,30 @@
<img src="/assets/img/cloud-elements-logo.png" alt="Cloud Elements Logo" />
</a>
</div>
<div class="filler"></div>
<div id="navbar" class="navbar-collapse collapse">
<div class="searchBoxContainer col-md-4 hidden-sm hidden-xs">
<div class="searchBoxWrapper">
<input
id="searchBox"
class="searchBox"
type="text"
placeholder="Search the docs..."
onkeyup="executeSearch()"
autocomplete="off"
>
<span class="icon icon-magnifying-glass"></span>
</div>
</div>
<div id="navbar" class="navbar-collapse collapse col-md-6 float-right">
<ul class="nav navbar-nav">
{% if page.url == '/' or page.url == '/index.html'%}
<li class="active">
{% else %}
<li>
{% endif %}
<a href="/">PORTAL HOME</a>
</li>

{% if page.url == '/docs/overview/overview.html' %}
<li class="active">
{% else %}
<li>
{% endif %}
<a href="/docs/overview/overview.html">
OVERVIEW
</a>
</li>

{% if page.url == '/docs/elements.html' %}
<li class="active">
{% else %}
<li>
{% endif %}
<a href="/docs/elements.html">
ELEMENT DOCS
</a>
<li>
<a href="http://status.cloud-elements.com/">Status</a>
</li>

{% if page.url == '/docs/guides/home.html' %}
<li class="active">
{% else %}
<li>
{% endif %}
<a href="/docs/guides/home.html">
INTEGRATION GUIDES
</a>
<li>
<a href="http://changelog.cloud-elements.com/">Change Log</a>
</li>

{% if page.url == '/docs/hubs/hub-docs.html' %}
<li class="active">
{% else %}
<li>
{% endif %}
<a href="/docs/hubs/hub-docs.html">
HUB API DOCS
</a>
<li>
<a href="https://support.cloud-elements.com/hc/en-us">Support</a>
</li>

<li>
<a href="https://console.cloud-elements.com/elements/jsp/signup.jsp" target="_blank">
<button type="button" class="btn btn-lg btn-danger try-it">Try it For Free! <i class="fa fa-caret-right"></i></button>
Expand All @@ -85,5 +77,14 @@
</ul>
</div>
</div>
<div class="searchResultsContainer" id='resultsContainer'>
<div class="leftPadding col-md-3"> </div>
<div class="resultsWrapper col-md-6">
<ul id="resultsList">

</ul>
</div>
<div class="rightPadding col-md-3"></div>
</div>
</nav>
<!-- END Main Nav -->
Loading

0 comments on commit 674505e

Please sign in to comment.