Support non-md files as archetype files

It now properly uses the extension of the target file to determine archetype file.

Fixes #3597
Fixes #3618
This commit is contained in:
Bjørn Erik Pedersen
2017-06-20 12:46:03 +02:00
parent 0f40e1fadf
commit 19f2e72913
3 changed files with 23 additions and 8 deletions

View File

@@ -287,6 +287,12 @@ func GetDottedRelativePath(inPath string) string {
return dottedPath
}
// Ext takes a path and returns the extension, including the delmiter, i.e. ".md".
func Ext(in string) string {
_, ext := fileAndExt(in, fpb)
return ext
}
// Filename takes a path, strips out the extension,
// and returns the name of the file.
func Filename(in string) (name string) {