Diego is a data importer extension for Hugo.
Diego integrates with Hugo as a CLI tool to assist in importing and utilizing exported social media data from various services on Hugo websites.
diego
is a CLI tool designed to import official CSV
and JSON
data files from popular services like Goodreads, IMDb, Instapaper, Letterboxd, Spotify, and YouTube into Hugo.
diego
provides:
- Automatic
CSV
andJSON
conversion into Hugo data files - Support for all Hugo data file formats
- Easy data management in a human-readable format (
YAML
) - Automatic generation of Hugo shortcodes for imported data
- Optional scrape capabilities for fetching missing fields
- Flags suited for scripting and pipelines
- Persistent configuration
For a basic workflow example using diego
to import data, see the demonstration.
For real usage examples, you can check the collections section on my personal Hugo website. I utilize diego
to showcase my favorite albums, films, TV shows, music videos, and books.
Installing diego
is easy. You can either compile it from source or download the official binaries from the releases.
Tip
After following the instructions for your preferred installation method, run diego -v
to test the installed version.
If the target system has go
installed, you can compile and install diego
using the following command:
go install github.com/ttybitnik/diego@latest
You can also install diego
by downloading the latest release for your system and moving its binary and man pages to the appropriate system paths. Use one of the commands below to simplify this process:
Tip
In case of uncertainty about the machine architecture, run uname -m
to check it.
x86_64
curl -L https://github.com/ttybitnik/diego/releases/latest/download/diego_0.4.0_Linux_x86_64.tar.gz | tar -xzvf - -C /tmp/ && cp /tmp/diego ~/.local/bin/ && cp /tmp/man/*.1 ~/.local/share/man/man1/ # x-release-please-version
arm64
curl -L https://github.com/ttybitnik/diego/releases/latest/download/diego_0.4.0_Linux_arm64.tar.gz | tar -xzvf - -C /tmp/ && cp /tmp/diego ~/.local/bin/ && cp /tmp/man/*.1 ~/.local/share/man/man1/ # x-release-please-version
i386
curl -L https://github.com/ttybitnik/diego/releases/latest/download/diego_0.4.0_Linux_i386.tar.gz | tar -xzvf - -C /tmp/ && cp /tmp/diego ~/.local/bin/ && cp /tmp/man/*.1 ~/.local/share/man/man1/ # x-release-please-version
x86_64
curl -L https://github.com/ttybitnik/diego/releases/latest/download/diego_0.4.0_Freebsd_x86_64.tar.gz | tar -xzvf - -C /tmp/ && cp /tmp/diego ~/.local/bin/ && cp /tmp/man/*.1 ~/.local/share/man/man1/ # x-release-please-version
arm64
curl -L https://github.com/ttybitnik/diego/releases/latest/download/diego_0.4.0_Freebsd_arm64.tar.gz | tar -xzvf - -C /tmp/ && cp /tmp/diego ~/.local/bin/ && cp /tmp/man/*.1 ~/.local/share/man/man1/ # x-release-please-version
i386
curl -L https://github.com/ttybitnik/diego/releases/latest/download/diego_0.4.0_Freebsd_i386.tar.gz | tar -xzvf - -C /tmp/ && cp /tmp/diego ~/.local/bin/ && cp /tmp/man/*.1 ~/.local/share/man/man1/ # x-release-please-version
x86_64
curl -L https://github.com/ttybitnik/diego/releases/latest/download/diego_0.4.0_Darwin_x86_64.tar.gz | tar -xzvf - -C /tmp/ && cp /tmp/diego ~/.local/bin/ && cp /tmp/man/*.1 ~/.local/share/man/man1/ # x-release-please-version
arm64
curl -L https://github.com/ttybitnik/diego/releases/latest/download/diego_0.4.0_Darwin_arm64.tar.gz | tar -xzvf - -C /tmp/ && cp /tmp/diego ~/.local/bin/ && cp /tmp/man/*.1 ~/.local/share/man/man1/ # x-release-please-version
x86_64
Invoke-WebRequest -Uri "https://github.com/ttybitnik/diego/releases/latest/download/diego_0.4.0_Windows_x86_64.zip" -OutFile "$env:USERPROFILE\Downloads\diego_x86_64.zip" # x-release-please-version
Once installed, run diego
and follow the instructions to start using it.
Run either diego help [command]
or diego [command] -h
to discover more about a specific command.
For complete details on using diego
, read the Diego User Guide.
- diego completion :: generate the autocompletion script for the specified shell
- diego import :: import data from various services into Hugo
- diego import goodreads :: import data from Goodreads
- diego import imdb :: import data from IMDb
- diego import instapaper :: import data from Instapaper
- diego import letterboxd :: import data from Letterboxd
- diego import spotify :: import data from Spotify
- diego import youtube :: import data from YouTube
- diego set :: set a configuration option
- diego set all :: enable or disable the all flag by default
- diego set defaults :: restore Diego default settings
- diego set format :: set output format for the Hugo data file (default "yaml")
- diego set hugodir :: set path to the Hugo directory (default ".")
- diego set overwrite :: enable or disable the overwrite flag by default
- diego set scrape :: enable or disable the scrape flag by default
- diego set shortcode :: enable or disable the shortcode flag by default
- diego settings :: show current settings
To request support for a new service or file, submit a feature request with a small sample of the official exported file.
In case of unexpected behavior, please open a bug report.
To contribute to diego
development, refer to the contributing instructions.
Email workflow is also available.
Feel free to send patches, questions, or discussions related to diego
to the ~ttybitnik/general mailing list.
This project is licensed under the GNU General Public License v3.0 (GPL-3.0), unless an exception is made explicit in context. The GPL is a copyleft license that guarantees the freedom to use, modify, and distribute software. It ensures that users have control over the software they use and promotes collaboration and sharing of knowledge. By requiring that derivative works of GPL-licensed software also be licensed under the GPL, the license ensures that the freedoms it provides are extended to future generations of users and developers.
See the COPYING
file for more information.
The source code for this project is available at https://github.com/ttybitnik/diego.