-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 DocSearch as search provider #168
Conversation
7f0fe75
to
e894fc7
Compare
docs/.vuepress/config.js
Outdated
@@ -1,4 +1,6 @@ | |||
module.exports = _ctx => ({ | |||
module.exports = (_ctx) => ({ | |||
sourceDir: 'docs', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the source directory is now specified in the config as opposed to an inline argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few inline suggestions. Additionally—and I don't have a source for this so consider it a nitpick—I think that .env.dist
might be a more common name for the "distributed" template version of .env
. We could rename that file if that resonates with you.
.circleci/config.yml
Outdated
yarn build | ||
./ci-build.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could maybe simplify this by inlining the CI-specific check here:
if [[ -z "$ALGOLIA_API_KEY" || -z "$ALGOLIA_INDEX_NAME" ]]
then
printf 'ERROR: %s\n' 'Algolia API key or index name not set.' >&2
exit 1
fi
And we could continue to use yarn build
(more below).
(Two subtle changes made to this snippet: [[
in place of [
and single quotes to avoid the escapes.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inlined in config.yml
in 2d8c946
b8449b1
to
80b9815
Compare
This comment has been minimized.
This comment has been minimized.
@rekmarks not too familiar with Algolia. I'm assuming this is going to make searching the docs quicker and more accurate? 🙂 Nice find! |
@BboyAkers even better, it'll enable full-text search! Right now we only have headers. I should add some more of my research to this PR, I'll do that tomorrow 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Added some context in the PR description, thanks @whymarrh and @BboyAkers! |
This adds Algolia DocSearch as our search provider, enabling full-text search for our docs. The default VuePress search provider is an-inline JavaScript implementation that only searches Markdown headers. Algolia is used by a ton of popular JavaScript projects, including Babel, TypeScript, React, and Bootstrap.
dotenv
dev dependency for Algolia DocSearch secretsbuild.js
for local buildsdotenv
ci-build.sh
for CI buildsbuild.js
.env-template
is deleted.env
file in readme