HTML Fixer
The fixer tool in site/fixer/ converts standalone .html files into folder-based structures with index.html inside.
Problem
Some HTML files are structured as:
public/calculadoras/calculadora.htmlBut they should be:
public/calculadoras/calculadora/index.htmlSolution
For each .html file (except index.html):
- Creates a folder with the same name (without
.html) - Moves the file inside as
index.html
Usage
Using Make
# Preview changesmake fix-posts-dry
# Apply fixesmake fix-postsUsing Binary
# Buildgo build -o fixer/fixposts ./fixer/cmd/fixposts
# Run on public directory./fixer/fixposts -dir public
# Dry run./fixer/fixposts -dir public -dry-run
# Verbose./fixer/fixposts -dir public -vSafety
- Files already named
index.htmlare skipped - If target folder exists, file is skipped
- Use
-dry-runfirst to preview