Closed Natfan closed 7 years ago
htaccess would be the simplest fix for your situation. The script uses .html extensions to function.
You could use another bash script. After bashblog runs, and before uploading to webhost, grab all the files in the blog and rename all the .html files, removing the extension and modifying them with sed.
sed to replace
<a href="article-title.html">Article Title</a>
with
<a href="article-title">Article Title</a>
Note there are a few replacements to be made, the all_tags.html page, all_posts.html, etc.
That's a rather good idea, I'll give it a crack.
How would that work with 'htaccess'?
https://github.com/Natfan/FunLittleThings/tree/master/HTMLFixer
Here's a quick HTML linter that removes all instances of .html
within <a> tags in all HTML files within the directory that you run it in.
@aggsol
Thank you @Natfan @Justin-Chaschowy
No problem man, feel free to fork and improve my code if you want :)
@aggsol
When I link pages within my site, I prefer to not use file extensions at the end. Is there any way to remove
.html
from all links within the site via the script, then rebuild every page? Or will I have to try to figure out a way withhtaccess
or something?