Add post: 暗黑能天使
This commit is contained in:
8
layouts/partials/utils/camelize.html
Normal file
8
layouts/partials/utils/camelize.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{{ $input := . }}
|
||||
{{ $regexp := "(-|_)([a-z])" }}
|
||||
{{ $matches := findRE $regexp $input }}
|
||||
{{ range $matches }}
|
||||
{{ $input = $input | replaceRE . (upper .) }}
|
||||
{{ end }}
|
||||
{{ $input = $input | replaceRE "(-|_)" "" }}
|
||||
{{ return $input }}
|
||||
Reference in New Issue
Block a user