Skip to main content

An incredibly simple python script that makes working with archtypes in Hugo 0.5x much easier.

Project description

hugon

https://img.shields.io/pypi/v/hugon.svg

An incredibly simple python script that makes working with archetypes in Hugo 0.5x much easier.

  • Free software: MIT license

Why

  • When working with archetypes, the CLI expects us to mention the exact file name we want to create, instead of converting simply converting a provided string into a filename.

  • When working with pages that require us to create multiple markdown files in sequence (Example, creating an FAQ’s Markdown Page with faq-1.md, faq-2.md, faq-3.md file names), we’re expected to enter them manually each time.

Features

  • Enter a string with as many special characters you wish to enter, the script will conver it into a suitable filename. Eg: “This new blog post I want to write!” in the command line would be converted into “this-new-blog-post-i-want-to-write.md”.

  • Enter the archetype you wish to enter, the script will check if the archetype exists. If it doesn’t exist, Hugo CLI will prompt you with an error.

  • Let’s you use a custom prefix CLI if you’re using any other CLI that handshakes with hugo. Only changes prefix that could replace the “hugo new” function

  • Enter the amount of files you want to create in sequence, the script will create everything.

  • Colour codes the output (uses Colorama!) for you to differenciate between outputs.

  • Let’s you use a custom separator if you’d like something apart from ‘-’ hyphens in your file name.

Requirements

  • Python 3.x

  • Hugo CLI (Tested on 0.59.1)

How To Use

  1. pip install hugon

  2. cd Into your hugo initialized folder.

  3. run the command ‘hugon -name “N3w F!le” -arch “default” -sequence “5”

Syntax

Command

Description

Required?

Example

Converts Into

-archetype

Define Archetype Name (without file extension). The Archetype file of this name should be present in the archetype folder. (Name is automatically converted to lowercase)

Yes

Default

default

-name

Filename you’d want to set. Can contain spaces, numbers, special characters, all which will be stripped (and converted to lowercase) to create a seamless file name to send to Hugo CLI.

Yes

FILE NAM3 Ex@mple

file-nam3-exmple.md

-sequence

Let’s you create multiple files with a sequence as a postfix. Helpful of you’re working with FAQ’s, or other pages where file name doesn’t necessarily matter. Value has to be more than 1, with sequence kicking off skipping 0.

No

5

file-nam3-exmple1.md

file-nam3-exmple2.md

file-nam3-exmple3.md

file-nam3-exmple4.md

file-nam3-exmple5.md

-separator

Let’s you define a custom separatorthat’s not “-” a hyphen.

No

_

file_nam3_example.md

-prefix

Use another command instead of “hugo new”.

No

npm run customdev

npm run customdev default/file_nam3_example.md

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2019-12-06)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hugon-0.1.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

hugon-0.1.0-py2.py3-none-any.whl (7.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file hugon-0.1.0.tar.gz.

File metadata

  • Download URL: hugon-0.1.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.0

File hashes

Hashes for hugon-0.1.0.tar.gz
Algorithm Hash digest
SHA256 448ba4ebd1cdeda8fb26b1493d27315c102f8f6dd34090d7e7e76862956834e0
MD5 35df6322882ea8399fb87f8ed8d61eb4
BLAKE2b-256 5a8c2fee9a57f9d1e78d104ca185ef7f14311dbe27a042a152b46c0dee07ffeb

See more details on using hashes here.

File details

Details for the file hugon-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: hugon-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.0

File hashes

Hashes for hugon-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4e44bd08bb638dc24cd464a261594301d0b962899b4ab9032867a5e4b48f30e9
MD5 acad3995d551ae87b2d57c07bbf7e03d
BLAKE2b-256 3719885de4c9fdd4cd52c80d132789ab38b42ae8cb2c9c9e8dc265a439dce5c3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page