Static Blog Export

Exporting To A Static Blog

TooLoo can export an index page, and details pages, for each of your documented commands.

The current version assumes you're using Hugo external link icon with our default site setup external link icon , or more likely, some beautifully tweaked variant of it.

A demo of the default site structure and theme is available at demo.tooloo.dev external link icon

Using the Default Site Structure

  1. clone the latest version from GitHub.
  2. by default context/_index.md is a symlink to all_commands/_index.md This means you'll have a functional home page that links to all your commands by default. However, you'll probably want a custom home page, so feel free to delete that symlink and replace it with a real hugo file to introduce people to your collection of tools.

That's it really. You can customize it like any other Hugo site, just keep in mind that all the commands under the content/all_commands folder, and the _index.md file there, will get replaced every time you regenerate the site.

Generating the site

Assuming you're using our default site structure, you'll execute the following to generate your files:

tooloo export hugo ~/path/to/tooloo_blank_hugo_site/content/all_commands

Note that we're telling it to store the files in the all_commands directory.

The theme has a concept of "chapters" and "all_commands" is the first "chapter". You can, of course, change this. It's ultimately a variation of the Hugo Learn Theme external link icon which has good documentation external link icon .

Customizing The Generated Markdown

The main table of contents page all_commands/_index.md starts off with placeholder text.

The first time you run tooloo export two Markdown templates will be created in XDG_CONFIG_HOME/toolo/ They are markdown_index_template.tt and markdown_details_template.tt

The markdown_index_template.tt is used to customize the main page with the table that links to all the other commands. It's the Markdown equivalent of tooloo list

The markdown_details_template.tt documents the individual commands. It's the markdown equivalent of tooloo show <some_command>

The files use the Template6 external link icon templating language which is based on Perl 5's Template Toolkit external link icon . The Template6 docs are fairly thin right now, but Template Toolkit is well documented and should answer any questions you may have.

As with the template.toml used to document new commands, you don't have to worry about messing things up. If you delete the file it'll just regenerate a new one with the default setup the next time you export.

Note 1: XDG_CONFIG_HOME defaults to ~/.config on most systems.