Automatically reads JSON from a given URL, and parses it into good markdown that fits with Hugo website (any theme).
Here are the instructions to set up:
- Git clone in a folder/directory one step-up from your hugo website
conda env create -f environment.yml
to create conda environemnt.
- Create a new hugo post with
hugo new posts/my_post_here.md
- Surround the part of your page your importing from with with
{{< start_token >}}
and{{< end_token >}}
- Go back to the cloned directory, and edit the
post_to_url.json
file as follows:
{
"jupyter;posts/test_ipynb.md":"https://github.com/chuckles201/VQ-VAE-Implementation/blob/main/data/download.ipynb?raw=true",
}
with the format of "any-language;posts/post_url.md":"githubrawlink"
- Lastly, copy shortcodes for detail_rain, code_output, and others in your
/layouts/shortcodes
directory in your site. For tutorials on creating a custom shortcodes look here. detail_rain is the CSS that displays/formats your code, and the code_output formats your output. I have my examples linked in theexamples
folder, copy all of them here, and modify them later for best results.
Now, running
python siteconverter.py
should automatically update the posts that you've linked!
Leave an issue if this is not working