PageRenderTime 21ms CodeModel.GetById 31ms RepoModel.GetById 0ms app.codeStats 0ms

/tipue_search/README.md

https://gitlab.com/unofficial-mirrors/pelican-plugins
Markdown | 99 lines | 64 code | 35 blank | 0 comment | 0 complexity | 975042c568fe4191c165da3277cca52f MD5 | raw file
  1. Tipue Search
  2. ============
  3. > :warning: **Instead of this plugin, please use the [Pelican Search](https://github.com/pelican-plugins/search) plugin.**
  4. > :warning: **This plugin, and the jQuery code upon which it depends, _is abandoned and no longer maintained_.**
  5. Purpose
  6. -------
  7. Serialize generated HTML content to a JS variable for use by the Tipue static search jQuery plugin.
  8. Installation
  9. ------------
  10. This plugin can be installed via:
  11. python -m pip install -e "git+https://github.com/getpelican/pelican-plugins/#egg=pelican-tipue-search&subdirectory=tipue_search"
  12. Why Do You Need It?
  13. -------------------
  14. Static sites do not offer search feature out of the box. [Tipue Search](https://web.archive.org/web/20200703134724/https://tipue.com/search/)
  15. is a jQuery plugin that search the static site without using any third party service, like DuckDuckGo or Google.
  16. Tipue search requires the textual content of site in a JS variable.
  17. How Tipue Search Works
  18. ----------------------
  19. Tipue Search serializes the generated HTML into JSON and saves it into a JS variable. Format of JSON is as follows
  20. ```javascript
  21. var tipuesearch = {
  22. "pages": [
  23. {
  24. "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero.",
  25. "tags": "Example Category",
  26. "url" : "http://oncrashreboot.com/plugin-example.html",
  27. "title": "Everything you want to know about Lorem Ipsum"
  28. },
  29. {
  30. "text": "Sed dignissim lacinia nunc. Curabitur tortor. Pellentesque nibh. Aenean quam. In scelerisque sem at dolor. Maecenas mattis. Sed convallis tristique sem. Proin ut ligula vel nunc egestas porttitor. Morbi lectus risus, iaculis vel, suscipit quis, luctus non, massa. Fusce ac turpis quis ligula lacinia aliquet. Mauris ipsum. Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh.",
  31. "tags": "Example Category",
  32. "url" : "http://oncrashreboot.com/plugin-example-2.html",
  33. "title": "Review of the book Lorem Ipsum"
  34. }
  35. ]
  36. };
  37. ```
  38. JS variable is written to file `tipuesearch_content.js` which is created in the root of `output` directory.
  39. How to Use
  40. ----------
  41. Your theme needs to have Tipue Search properly configured in it. [Official documentation](https://web.archive.org/web/20200703134724/https://tipue.com/search/help/) has the required details.
  42. In addition to the instructions from Tipue, the following has to be added in `pelicanconf.py`.
  43. ```python
  44. DIRECT_TEMPLATES = ['index', 'tags', 'categories', 'authors', 'archives', 'search']
  45. ```
  46. Furthermore, the generated JavaScript variable has to be sourced in the relevant HTML pages.
  47. ```html
  48. <script src="{{ SITEURL }}tipuesearch_content.js"></script>
  49. ```
  50. Pelican [Plumage theme](https://github.com/kdeldycke/plumage) has Tipue Search configured. Check out its code to understand the configuration.
  51. Backward Compatibility
  52. ----------------------
  53. This plugin requires Tipue Search Version 7.0 or higher.
  54. Tipue used to expect content in a JSON file. Around Version 7.0, Tipue maintainers made a switch to JavaScript variable. tipue_search plugin was updated to reflect this change in commit `4a5f171fc`. Latest version of tipue_search plugin will not work with older versions of Tipue Search.
  55. If you are using older Tipue Search, prior to 7.0 release, then you will find old version of tipue_search plugin in commit `2dcdca8c8`.
  56. Source Archive
  57. --------------
  58. The Tipue Search project itself seems to have been long abandoned. There is no
  59. longer any official canonical reference of source code or documentation. There
  60. only some artifacts left that were archived by the community:
  61. * [Archived Tipue Search homepage](https://web.archive.org/web/20200703134724/https://tipue.com/search/)
  62. * [Archived Tipue plugin help page](https://web.archive.org/web/20200703134724/https://tipue.com/search/help/)
  63. * [Archived Tipue Search code v7.1](https://web.archive.org/web/20200703134724/https://www.tipue.com/search/tipuesearch.zip)
  64. * [GitHub repository copy](https://notabug.org/jorgesumle/Tipue-Search)