Skip to content

Commit

Permalink
Add support for .htm extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl Ramberg committed May 4, 2022
1 parent f5d9f78 commit 0c538ff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions websiteBuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ func main() {

// Delete old HTML files
filepath.Walk(outputFolder, func(path string, info os.FileInfo, err error) error {
if filepath.Ext(path) == ".html" {
extension := filepath.Ext(path)
if extension == ".html" || extension == ".htm" {
os.Remove(path)
}
return nil
Expand Down Expand Up @@ -80,7 +81,8 @@ func main() {

// If an HTML file is found, generate a completed one
// and write it to the same location in the output folder
if filepath.Ext(path) == ".html" {
extension := filepath.Ext(path)
if extension == ".html" || extension == ".htm" {
// Read in contents of input file
content, err := ioutil.ReadFile(path)
if err != nil {
Expand Down

0 comments on commit 0c538ff

Please sign in to comment.