summaryrefslogtreecommitdiffstats
path: root/helpers/path.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-06-20 12:46:03 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-06-20 13:41:48 +0200
commit19f2e729135af700c5d4aa06e7b3540e6d4847fd (patch)
tree6f6b26222306c66b78bfa032de8d3e4bfce05f68 /helpers/path.go
parent0f40e1fadfca2276f65adefa6d7d5d63aef9160a (diff)
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
Diffstat (limited to 'helpers/path.go')
-rw-r--r--helpers/path.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/helpers/path.go b/helpers/path.go
index 679740de9..640c97aa2 100644
--- a/helpers/path.go
+++ b/helpers/path.go
@@ -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) {