2023-05-29 18:35:38 +00:00
|
|
|
# Jekyll to Hugo Converter
|
|
|
|
|
|
|
|
Jekyll to Hugo Converter is a simple tool to convert Jekyll posts to Hugo posts.
|
|
|
|
|
2023-06-03 12:37:50 +00:00
|
|
|
I've used this tool to convert [my blog](https://blog.nuculabs.dev) from WorPress to Jekyll to Hugo.
|
2023-05-29 18:35:38 +00:00
|
|
|
|
2023-06-03 12:37:50 +00:00
|
|
|
Note: This tool is not perfect, it will not convert everything. If you find a bug, please open a PR.
|
|
|
|
|
|
|
|
## Table of Contents
|
|
|
|
|
|
|
|
* [Usage](#usage)
|
|
|
|
* [PiPy](#pipy)
|
|
|
|
* [Python From Source](#python-from-source)
|
|
|
|
* [Docker](#docker)
|
|
|
|
* [Configuration](#configuration)
|
|
|
|
* [License](#license)
|
2023-05-29 18:58:32 +00:00
|
|
|
|
2023-05-29 18:35:38 +00:00
|
|
|
## Usage
|
|
|
|
|
2023-06-03 13:09:43 +00:00
|
|
|
### PiPy or Pipx
|
2023-06-03 12:37:50 +00:00
|
|
|
|
|
|
|
If you have Python installed, you can use the following commands:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
pip install jekyll-to-hugo
|
|
|
|
jekyll-to-hugo
|
|
|
|
```
|
|
|
|
|
|
|
|
You will need to create a `config.yaml` file in the current directory. See example [here](./config.yaml).
|
|
|
|
|
2023-06-03 13:09:43 +00:00
|
|
|
_`pipx` is a tool to install Python CLI tools in isolated environments_
|
|
|
|
|
2023-06-03 12:37:50 +00:00
|
|
|
### Python From Source
|
2023-06-03 12:13:36 +00:00
|
|
|
|
|
|
|
If you have Python installed, you can use the following commands:
|
|
|
|
|
2023-05-29 18:35:38 +00:00
|
|
|
```bash
|
|
|
|
pip install -r requirements.txt
|
|
|
|
python3 jekyll-to-hugo.py <jekyll_post_path> <hugo_post_path>
|
|
|
|
```
|
|
|
|
|
2023-05-29 19:02:49 +00:00
|
|
|
To change the config, edit `config.yaml`.
|
|
|
|
|
|
|
|
The configuration file path can be configured with the `CONFIG_PATH` environment variable.
|
|
|
|
|
2023-06-03 12:13:36 +00:00
|
|
|
### Docker
|
|
|
|
|
|
|
|
If you don't have Python installed, you can use Docker:
|
|
|
|
|
|
|
|
1. Build the image.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker build -t jekyll-to-hugo .
|
|
|
|
```
|
|
|
|
|
|
|
|
2. Run the image. You will need to mount the following directories: config file, Jekyll posts directory, Hugo posts directory.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker run -it --rm -v $(pwd):/app jekyll-to-hugo
|
|
|
|
```
|
|
|
|
|
2023-06-03 12:37:50 +00:00
|
|
|
## Configuration
|
|
|
|
|
|
|
|
The configuration file is a YAML file. See example [here](./config.yaml).
|
|
|
|
The configuration file path can be configured with the `CONFIG_PATH` environment variable.
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
This project is licensed under the GPL-3.0 license - see the [LICENSE](LICENSE) file for details.
|
|
|
|
|
2023-05-29 18:35:38 +00:00
|
|
|
---
|
2023-05-31 15:30:13 +00:00
|
|
|
Made with ❤️ by [NucuLabs.dev](https://blog.nuculabs.dev)
|