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

Peter add algolia #6692

Merged
merged 44 commits into from
Mar 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
2c22e1c
add algolia index to base config
Feb 24, 2020
7196cd4
add algolia gem
Feb 26, 2020
f6db2a0
Added the algoliaSearchLite and instantsearch libraries
mbesada Feb 24, 2020
cbd2352
Added the algolia configuration for app key and and index name
mbesada Feb 24, 2020
fe9e092
Changed the search for the instantsearch plugin
mbesada Feb 24, 2020
b3acd64
Remove unused algolia libraries
mbesada Feb 24, 2020
1a248e9
Styles for the results page
mbesada Feb 24, 2020
ada5440
update image
Feb 27, 2020
189728e
update image
Feb 27, 2020
a02041e
fix command
Feb 27, 2020
924d04a
update make and pr file
Feb 27, 2020
78e7d91
fix env name
Feb 27, 2020
48d9f5b
fix env func
Feb 27, 2020
20a9f5e
parens
Mar 2, 2020
0aa97c6
remove env prefix
Mar 2, 2020
85e4bd9
export
Mar 2, 2020
afa6f63
test
Mar 2, 2020
871c658
make file testing
Mar 2, 2020
57a68e0
no run
Mar 2, 2020
b78bf34
pass alg key to container
Mar 2, 2020
3f3efb7
cleanup
Mar 2, 2020
de54855
cleanup
Mar 2, 2020
066643a
add run
Mar 2, 2020
c00fe41
one line
Mar 2, 2020
2468daa
Merge branch 'peter-add-algolia' into mbesada/search-client-config
anagio Mar 3, 2020
15abce9
remove echo
Mar 3, 2020
36048dd
inline our urls
Mar 3, 2020
476edbc
remove docs prefix from hit url
Mar 3, 2020
2ea4b0a
remove docs prefix from hit url
Mar 3, 2020
66a0950
test netlify
Mar 3, 2020
7471786
test netlify
Mar 3, 2020
8fcb622
run algolia for my branch
Mar 3, 2020
c6f46d9
run algolia for my branch
Mar 3, 2020
7c7bb9c
use prod index
Mar 3, 2020
23cb20b
rebuild index once
Mar 3, 2020
ff93b38
prod only
Mar 3, 2020
5172eb5
Index only dev version documents if no stable version exists
mbesada Mar 4, 2020
fddfbc1
Merge pull request #6759 from mbesada/mbesada-index-filter-fix
anagio Mar 4, 2020
28298fa
force reindex
Mar 4, 2020
0584ee0
Fix issue highlighting results when there are no content match
mbesada Mar 4, 2020
ac6b9a9
Fix cockroachdb - cockroachcloud header links to match mockups
mbesada Mar 4, 2020
2c6a5aa
Merge pull request #6765 from mbesada/mbesada/fix-ui-issues
anagio Mar 4, 2020
ac5358b
Exclude training documents from index
mbesada Mar 6, 2020
a9f7ac0
Merge pull request #6775 from mbesada/mbesada/exclude-training-documents
Mar 6, 2020
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
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ gem "jekyll-sitemap", "~> 1.3.1"
gem "liquid-c", "~> 4.0.0"
gem "redcarpet", "~> 3.4"
gem "sassc", "~> 2.2"

group :jekyll_plugins do
gem 'jekyll-algolia', "~> 1.0", path: "./jekyll-algolia-dev"
end
30 changes: 29 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,41 @@ GIT
safe_yaml (~> 1.0)
terminal-table (~> 1.8)

PATH
remote: jekyll-algolia-dev
specs:
jekyll-algolia (1.6.0)
algolia_html_extractor (~> 2.6)
algoliasearch (~> 1.26)
filesize (~> 0.1)
jekyll (>= 3.6, < 5.0)
json (~> 2.0)
nokogiri (~> 1.6)
progressbar (~> 1.9)
verbal_expressions (~> 0.1.5)

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.27.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 (1.6.0)
concurrent-ruby (~> 1.0)
jekyll-redirect-from (0.15.0)
Expand All @@ -43,6 +64,7 @@ GEM
jekyll (>= 3.7, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
json (2.3.0)
kramdown (2.1.0)
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
Expand All @@ -54,8 +76,12 @@ GEM
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
mercenary (0.3.6)
mini_portile2 (2.4.0)
nokogiri (1.10.8)
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)
Expand All @@ -69,17 +95,19 @@ GEM
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.6.0)
verbal_expressions (0.1.5)

PLATFORMS
ruby

DEPENDENCIES
jekyll!
jekyll-algolia (~> 1.0)!
jekyll-redirect-from (~> 0.15)
jekyll-sitemap (~> 1.3.1)
liquid-c (~> 4.0.0)
redcarpet (~> 3.4)
sassc (~> 2.2)

BUNDLED WITH
2.0.2
2.1.4
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
# is where Homebrew will install a more up-to-date version of Ruby on macOS.
export GEM_HOME := vendor
export PATH := $(GEM_HOME)/bin:/usr/local/opt/ruby/bin:$(PATH)

# HACK: Make has a fast path and a slow path for command execution,
# but the fast path uses the PATH variable from when make was started,
# not the one we set on the previous line. In order for the above
Expand Down
11 changes: 11 additions & 0 deletions _config_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ exclude:
- "ci"
- "scripts"
- "vendor"
- "jekyll-algolia-dev"
- "hackathon.md"

keep_files: [_internal]
Expand All @@ -66,3 +67,13 @@ defaults:
type: "pages"
values:
layout: "page"

algolia:
application_id: 7RXZLDVR5F
search_api_key: d3908f7681c855f6ba95c2a14d063d89
index_name: cockroachcloud_docs
files_to_exclude:
- index.html
- index.md
- search.html
- "**/training/*.*"
5 changes: 3 additions & 2 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@
<script src="{{ 'js/jquery.cookie.min.js' | relative_url }}"></script>
<script src="{{ 'js/jquery.navgoco.min.js' | relative_url }}"></script>
<script src="{{ 'js/bootstrap.min.js' | relative_url }}"></script>
<script src="{{ 'js/algoliasearch.min.js' | relative_url }}"></script>
<script src="{{ 'js/autocomplete.jquery.min.js' | relative_url }}"></script>
<script src="{{ 'js/algoliasearchLite.min.js' | relative_url }}"></script>
<script src="{{ 'js/instantsearch.production.min.js' | relative_url }}"></script>

<script src="{{ 'js/toc.js' | relative_url }}"></script>
<script src="{{ 'js/cookieUtils.js' | relative_url }}"></script>
<script src="{{ 'js/clipboard.min.js' | relative_url }}"></script>
Expand Down
2 changes: 1 addition & 1 deletion _includes/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div class="search">
<span class="fas fa-search"></span>
<form class="search-form" method="GET" action="{{ 'search.html' | relative_url }}">
<input type="text" id="search-input" name="q" placeholder="Search docs">
<input type="text" id="search-input" name="query" placeholder="Search docs">
<span class="clear-search"></span>
</form>
</div>
Expand Down
17 changes: 0 additions & 17 deletions _includes/version-nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@
class="version-nav__link version-nav__link--crdb {% unless site.cockroachcloud %}version-nav__link--active{% endunless %}"
href="{% if site.cockroachcloud %}{{ "/../stable/" | relative_url }}{% else %}{{ "/stable/" | relative_url }}{% endif %}"
>
<img
class="version-nav__link-icon version-nav__link-icon--crdb version-nav__link-icon--standard"
src="{{ 'images/docs.svg' | relative_url }}"
alt="Go to CockroachDB docs"
>
<img
class="version-nav__link-icon version-nav__link-icon--crdb version-nav__link-icon--hover"
src="{{ 'images/docs-hover.svg' | relative_url }}" alt="Go to CockroachDB docs"
>
<span class="version-nav__link-text version-nav__link-text--crdb" ></span>
</a>

Expand All @@ -21,14 +12,6 @@
href="{% if site.cockroachcloud %}{{ "/stable/" | relative_url }}{% else %}{{ "/cockroachcloud/stable/" | relative_url }}{% endif %}"
data-proofer-ignore
>
<img
class="version-nav__link-icon version-nav__link-icon--managed version-nav__link-icon--standard"
src="{{ 'images/docs-managed.svg' | relative_url }}" alt="Go to CockroachCloud docs"
>
<img
class="version-nav__link-icon version-nav__link-icon--managed version-nav__link-icon--hover"
src="{{ 'images/docs-managed-hover.svg' | relative_url }}" alt="Go to CockroachCloud docs"
>
<span class="version-nav__link-text version-nav__link-text--managed"></span>
</a>
{% if page.version %}
Expand Down
1 change: 1 addition & 0 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM alpine:3.10

COPY Gemfile Gemfile.lock /tmp/bundler/
COPY /jekyll-algolia-dev /tmp/bundler/jekyll-algolia-dev

RUN apk add --update \
bash \
Expand Down
3 changes: 2 additions & 1 deletion ci/builder
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

image=cockroachdb/docs-builder
version=${COCKROACH_DOCS_BUILDER_VERSION:-20191011-103751}
version=${COCKROACH_DOCS_BUILDER_VERSION:-20200227-133747}

root=$(cd "$(dirname "$0")" && pwd)
repo_root=$root/..
Expand Down Expand Up @@ -31,6 +31,7 @@ case "$command" in
--user "$(id -u):$(id -g)" \
--env AWS_ACCESS_KEY_ID \
--env AWS_SECRET_ACCESS_KEY \
--env ALGOLIA_DOCS_STAGING \
--volume="$repo_root:/docs" \
"$image:$version" "$@"
;;
Expand Down
60 changes: 57 additions & 3 deletions css/customstyles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

115 changes: 115 additions & 0 deletions jekyll-algolia-dev/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
Hi collaborator!

If you have a fix or a new feature, please start by checking in the [issues][1]
if it is already referenced. If not, feel free to open one.

We use [pull requests][2]
for collaboration. The workflow is as follow:

- Create a local branch, starting from `develop`
- Submit the PR on `develop`
- Wait for review
- Do the changes requested (if any)
- We may ask you to rebase the branch to latest `develop` if it gets out of sync
- Receive the thanks of the Algolia team :)

# Development workflow

Start by running `bundle install` to get all the dependencies up to date.

## Testing

Run `rake test` to launch the test suite. Run `./scripts/test_all_ruby_versions`
to run the test on all the supported ruby versions (requires `rvm`).

## TDD

Run `rake watch` to start a watcher on the code and test files. Whenever you
update the code, the relevant tests will be run. Incredibly useful for TDD.

## Testing local changes on an existing Jekyll website

If you want to test the plugin on an existing Jekyll website while developping,
we suggest updating the website `Gemfile` to point to the correct local directory

```ruby
group :jekyll_plugins do
gem "jekyll-algolia", :path => "/path/to/local/gem/folder"
end
```

## Running integration tests

Integration tests will do a full jekyll run, and push data to an Algolia index,
checking that records and settings are correctly saved. It is the slowest
possible kind of tests, but also the one closest to a real implementation.

Running those tests requires a real Algolia plan. You need to define
`ALGOLIA_APPLICATION_ID`, `ALGOLIA_API_KEY` and `ALGOLIA_INDEX_NAME` (we suggest
using `direnv` for that), and then run `./scripts/test_integration`.

## Linting

Run `rake lint` to check the style of all ruby files. Run `rake
lint:auto_correct` to try to automatically correct the potential violations.
It's always a good practice to double check the modification after an
auto-correct.

# Git Hooks

If you plan on submitting a PR, we suggest you install the git hooks located in
`./scripts/git_hook`. Those hooks will run the linter on each commit, and the
tests before each push. This greatly help reduce the chances of breaking the
build on Travis.

The easiest way is to create a symlink from your `.git/hooks` folder:

```sh
$ git root
$ rm ./.git/hooks
$ ln -s ./scripts/git_hooks/ ./.git/hooks
```

# Tagging and releasing

If you need to release a new version of the gem, run `rake release` from the
`develop` branch. It will ask you for the new version and automatically create
the git tags, create the gem and push it to Rubygems.

# Documentation

## Requirements

The documentation website uses Metalsmith (and not Jekyll), so you'll need:

- Node.js >= v9.2.0, use nvm - [install instructions][3]
- Yarn >= v1.3.2 - [install instructions][4]

## Development

All the documentation source files live in the `./docs-src` folder.

To serve a local version of the documentation (including livereload), run `rake
docs:serve`. The documentation will be available on
[localhost:3000](http://localhost:3000/).

This will create a `./docs-dev` folder and serve files from there. This folder
is ignored by git.

## Deploying docs

To update the documentation website, you should run `rake docs:deploy` from the
`develop` branch. This will merge `develop` into master, build the documentation
into `docs` and push it. The content of the `./docs` folder will then be server
by GitHub pages.

# Project owner

[@pixelastic][5]


[1]: https://github.com/algolia/jekyll-algolia/issues
[2]: https://github.com/algolia/jekyll-algolia/pulls
[3]: https://github.com/creationix/nvm#install-script
[4]: https://yarnpkg.com/en/docs/install#alternatives-tab
[5]: https://github.com/pixelastic
Loading