summaryrefslogtreecommitdiff
path: root/plugins/tipue-search/README.md
blob: 18178f9979545defb8a681cb4378621cade38704 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Tipue Search
============

A Pelican plugin to serialize generated HTML to JSON.

- Copyright (c) Talha Mansoor
- Copyright (c) 2020 - 2022 Jesús E.

Original Authority
=================

Author          | Talha Mansoor
----------------|-----
Author Email    | talha131@gmail.com
Author Homepage | http://onCrashReboot.com
Github Account  | https://github.com/talha131

Modification
============

Author          | Jesús E.
----------------|-----
Author Email    | heckyel@hyperbola.info
Author Homepage | https://jestupinanm.ga
Gitea  Account  | https://hgit.ga/heckyel

Why do you need it?
===================

Static sites do not offer search feature out of the box. [Tipue Search](http://www.tipue.com/search/)
is a jQuery plugin that search the static site without using any third party service, like DuckDuckGo or Google.

Tipue Search offers 4 search modes. Its [JSON search mode](http://www.tipue.com/search/docs/json/) is the best search mode
especially for large sites.

Tipue's JSON search mode requires the textual content of site in JSON format.

Requirements
============

Tipue Search requires BeautifulSoup.

```bash
pip install beautifulsoup4
```

How Tipue Search works
=========================

Tipue Search serializes the generated HTML into JSON. Format of JSON is as follows

```python

  "videos": [
    {
      "title": "Usar cuenta Jabber/XMPP",
      "description": "Usar cuenta Jabber/XMPP Usar una cuenta de Jabber/XMPP es muy fácil. Instalar gajim en Hyperbola GNU/Linux-libre: $ sudo pacman -S gajim python2-axolotl Mostrar Más ¿Qué es Jabber/XMPP? Extensible Messaging and Presence Protocol, más conocido como XMPP (Protocolo extensible de mensajería y comunicación de presencia) (anteriormente llamado Jabber​), es un protocolo abierto y extensible basado en XML, originalmente ideado para mensajería instantánea. Con el protocolo XMPP queda establecida una plataforma para el intercambio de datos XML que puede ser usada en aplicaciones de mensajería instantánea. Las características en cuanto a adaptabilidad y sencillez del XML son heredadas de este modo por el protocolo XMPP. A diferencia de los protocolos privativos de intercambio de mensajes como ICQ, Y! y Windows Live Messenger, se encuentra documentado y se insta a utilizarlo en cualquier proyecto. Existen servidores y clientes libres que pueden ser usados sin coste alguno. Tras varios años de su existencia, ha sido adoptado por empresas como Facebook, WhatsApp Messenger y Nimbuzz, entre otras, para su servicio de chat.",
      "videoThumbnail": "https://saravia.org/media/theme/../wp-content/uploads/article/poster/2020/05/usar-xmpp.jpeg",
      "formatStreams": {
        "url": "https://archive.org/download/libreweb/uso-de-cuenta-xmpp.webm"
      },
      "author": "Jesús E.",
      "authorUrl": "https://saravia.org/media/author/jesus-e/",
      "published": "2020-05-20T15:23:44+02:00",
      "publishedText": "mié, 20 mayo, 2020",
      "time": "16:51",
      "tags": "Tutorial",
      "url": "https://saravia.org/media/usar-cuenta-jabber-xmpp/"
    },
    {
      "title": "Happy Birthday To GNU",
      "description": "Happy Birthday To GNU Sr. Stephen Fry introduces you to free software, and reminds you of a very special birthday. In this film, Stephen Fry, the actor, humorist and author introduces the viewer to free software and GNU. Along the way, he compares proprietary software to the 'tyranny' of scientific research that cannot be shared, studied and distributed by others. Show More Credits of video Free distros",
      "videoThumbnail": "https://saravia.org/media/theme/../wp-content/uploads/article/poster/2008/09/happy-gnu.jpg",
      "formatStreams": {
        "url": "https://archive.org/download/libreweb/sf-large.webm"
      },
      "author": "Free Software Foundation",
      "authorUrl": "https://saravia.org/media/author/free-software-foundation/",
      "published": "2008-09-02T21:04:48+02:00",
      "publishedText": "mar, 02 septiembre, 2008",
      "time": "5:51",
      "tags": "GNU",
      "url": "https://saravia.org/media/happy-birthday-to-gnu/"
    }
  ]
}
```

JSON is written to file `tipuesearch_content.json` which is created in the root of `output` directory.

How to use
==========

To utilize JSON Search mode, your theme needs to have Tipue Search properly configured in it. [Official documentation](http://www.tipue.com/search/docs/#json) has the required details.

Pelican [Elegant Theme](https://github.com/talha131/pelican-elegant) and [Plumage
theme](https://github.com/kdeldycke/plumage) have Tipue Search configured. You can view their
code to understand the configuration.