Full-text search for your Jekyll blog with ElasticSearch.
## Installation
1. Clone the project
1. run `python3 -m venv venv` to create the virtual env
1. run `. venv/bin/activate` to be able to use the python packages
1. run `pip install -r requirements.txt` to install all packages
To be able to use the linting inside the virtual environment, it is recomended to use the python inside the virtual env folder. Take a look at [here](https://code.visualstudio.com/docs/python/environments#_select-and-activate-an-environment) for vscode
## Development
1. You need a running copy of elasticsearch:
```bash
docker run \
--name elasticsearch \
--rm\
-p 9200:9200 \
-p 9300:9300 \
-e"discovery.type=single-node"\
elasticsearch:7.13.3
```
1. Make sure you are at the virtual env (run `. venv/bin/activate`)
1. To index your content, run: `python3 src/main.py "PATH_TO_YOUR_CONTENT"`
1. run `export FLASK_ENV=development`
1. run `export FLASK_APP=src/app`
1. run `flask run`
## Features
- Parses the html from your Jekyll `_site` directory using BeautifulSoup to get more accurate content instead of using the raw Markdown.
@@ -13,7 +39,7 @@ Full-text search for your Jekyll blog with ElasticSearch.
### Indexing:
- Make sure you have an ElasticSearch server running. If not local, change the config in `indexer.py` to reflect your location.
- Run the command `python main.py <path_to_blog>`, running without an argument will assume your compiled blog is located at `~/blog/_site`.
- Run the command `python src/main.py <path_to_blog>`, running without an argument will assume your compiled blog is located at `~/blog/_site`.
- If the library cannot find your content correctly, modify `indexer.py` to point to the correct HTML elements for title, post content etc (assuming you have unique CSS classes for these).