]> BookStack Code Mirror - website/blob - readme.md
Updated npm deps, removed old searchbar content
[website] / readme.md
1 # BookStack Site, Documentation & Blog
2
3 This project holds all the data for the https://www.bookstackapp.com/
4
5 This site is built using [Hugo](https://gohugo.io). Images are stored using `git-lfs`.
6 The "extended" version of hugo must be used (Has support for certain features like WebP resize).
7
8 ### Data Locations
9
10 * Blog Posts - `content/posts`
11 * Docs - `content/docs`
12 * Theme - `themes/bookstack`
13
14 ### Hacks
15
16 The website also contains a repository of customization hacks which can be found at [the /hacks](https://www.bookstackapp.com/hacks/) part of the site. 
17 These are managed via a [separate "Hacks" repo](https://github.com/BookStackApp/hacks) which is part of this repository as a git submodule. A symlink is then used to point the `content/hacks` directory to the `hacks/content` directory, where `hacks` is the submodule location.
18
19 ### Theme
20
21 The theme is custom made with snippets taken from the [hugo capser theme](https://github.com/vjeantet/hugo-theme-casper).
22
23 SCSS is used for the styling. Install NPM dependencies via `npm install` or `yarn` then you can use `npm run build` to build the css and site once or `npm run dev` to watch for changes.
24
25 ### Search
26
27 Search is performed using [webidx](https://github.com/gbxyz/webidx), which essentially builds a sqlite database search index, that is then loaded to browser upon search then queried locally in-browser via [sql.js](https://github.com/sql-js/sql.js).
28
29 This files required are all in this repo, and hacked to suit our use-case.
30 The script to build the index is located at `search/webidx.pl`, and can be ran via the npm script
31
32 ```bash
33 npm run build:search
34 ```
35
36 Note: you may need to install some dependencies to run the script see the `search/webidx.pl` for more information.
37
38 The above command will build the sqlite index database to `static/search.db`, intended to be deployed to production. In production use, this should be served with compression active to significantly reduce transfer size.
39
40 Much of the search UI handling logic can be found in our `themes/bookstack/static/js/scripts.js` file.