Sunday, 13 February 2022

r pkgdown docsearch algolia

I am having trouble understanding how to implement the docsearch snippet into my github pages (I am using bootstrap 3).

From the package documentation:

  1. Once you have published your pkgdown website, submit the pkgdown site URL to Docsearch. DONE

  2. Put the value of the apiKey and indexName parameters into your site _pkgdown.yml. DONE


Given my lack of knowledge, I am now having hard time understanding this.

The Docsearch\Algolia emailed me:

CSS

Copy this snippet at the end of the HTML head tag

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@alpha"/></pre></li>

JavaScript

Copy this snippet at the end of the HTML body tag

<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@alpha"></script>

<script type="text/javascript">

  docsearch({

    appId: xxxxxx,

    apiKey: xxxxxx,

    indexName: xxxxxx,

    container: '### REPLACE ME WITH A CONTAINER (e.g. div) ###'

    debug: false // Set debug to true if you want to inspect the modal

  });

</script>

QUESTION: Shall I copy these snippets on every html page generated by pkgdown or there is an automatic way to do so?



from r pkgdown docsearch algolia

No comments:

Post a Comment