{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Setting up Search\n", "\n", "> Using Google Custom Search\n", "\n", "- toc:false" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you want to include Search functionality on your docs site, you need to set up a [Google Custom Search](https://cse.google.com/cse/all), and then link it to your nbdev project. Here's all the steps you need to follow (replace anything in `{}` with the value your have in `settings.ini`:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "1. Go to [Google Custom Search](https://cse.google.com/cse/all) and click 'add'.\n", "1. In \"Sites to search\" type the URL of your docs site (e.g. `{owner}.github.io/{lib_name}`), and in \"Name of the search engine\" type \"{lib_name} docs\". Then click \"CREATE\"\n", "1. Click \"Control Panel\"\n", "1. In the \"Basics\" tab, click \"Copy to clipboard\" in the \"Search engine ID\" row\n", "1. Paste that as the value for \"google_search:\" in `docs/_config.yml` in your project. (If you don't already have this file, run `nbdev_build_lib` to create it, once you've set up your `settings.ini`)\n", "1. Click \"Advanced\" (far-right tab), then \"CSE Context\", then \"Download (XML)\"\n", "1. Open the downloaded `cse.xml` file in a text editor, and delete everything from the line starting with `