djencks commented on a change in pull request #163: Pr/algolia search
URL: https://github.com/apache/camel-website/pull/163#discussion_r387152601
 
 

 ##########
 File path: antora-ui-camel/src/partials/footer-scripts.hbs
 ##########
 @@ -1,5 +1,6 @@
 <script src="{{uiRootPath}}{{asset 'js/site.js'}}"></script>
 <script async src="{{uiRootPath}}{{asset 'js/vendor/highlight.js'}}"></script>
 <script async src="{{uiRootPath}}{{asset 
'js/vendor/svg4everybody.js'}}"></script>
+<script async 
src="https://cdn.jsdelivr.net/npm/algoliasearch@4/dist/algoliasearch-lite.umd.js";></script>
 
 Review comment:
   It's much simpler to use the ui builder to pull in and browserify the 
sources. You do this with code like Nayananga suggested:
   ```
   ;(function () {
   var algoliasearch = require('algoliasearch')
   return algoliasearch()
   })()
   ````
   listing the `algoliasearch` in your package.json for the ui project, but 
naming the file `algoliasearch.bundle.js`.  The 'bundle' in the filename tells 
the builder to convert the require into a sort of 'include'.  
   In addition, copying the actual algoliasearch.js into the vendor directory 
will subject it to linting which will likely fail and involve you in hours of 
attempting to correct it or disabling the linting step on vendor.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to