Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Łukasz Nowak
caddy
Commits
3fd3feef
Commit
3fd3feef
authored
Jul 11, 2016
by
Matthew Holt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Ext action to template context (closes #844)
parent
62622eb8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
caddyhttp/httpserver/context.go
caddyhttp/httpserver/context.go
+8
-0
No files found.
caddyhttp/httpserver/context.go
View file @
3fd3feef
...
...
@@ -7,6 +7,7 @@ import (
"net"
"net/http"
"net/url"
"path"
"strings"
"text/template"
"time"
...
...
@@ -158,6 +159,13 @@ func (c Context) StripHTML(s string) string {
return
buf
.
String
()
}
// Ext returns the suffix beginning at the final dot in the final
// slash-separated element of the pathStr (or in other words, the
// file extension).
func
(
c
Context
)
Ext
(
pathStr
string
)
string
{
return
path
.
Ext
(
pathStr
)
}
// StripExt returns the input string without the extension,
// which is the suffix starting with the final '.' character
// but not before the final path separator ('/') character.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment