Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
6fbdbaae
authored
2013-08-01 11:57:29 +0800
by
miraclesu
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Refactor template
1 parent
5ccdaeb0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
template.go
template.go
View file @
6fbdbaa
...
...
@@ -51,19 +51,13 @@ func (self *templatefile) visit(paths string, f os.FileInfo, err error) error {
if
f
==
nil
{
return
err
}
if
f
.
IsDir
()
{
if
f
.
IsDir
()
||
(
f
.
Mode
()
&
os
.
ModeSymlink
)
>
0
{
return
nil
}
else
if
(
f
.
Mode
()
&
os
.
ModeSymlink
)
>
0
{
return
nil
}
else
{
hasExt
:=
false
for
_
,
v
:=
range
BeeTemplateExt
{
if
strings
.
HasSuffix
(
paths
,
v
)
{
hasExt
=
true
break
}
if
!
HasTemplateEXt
(
paths
)
{
return
nil
}
if
hasExt
{
replace
:=
strings
.
NewReplacer
(
"
\\
"
,
"/"
)
a
:=
[]
byte
(
paths
)
a
=
a
[
len
([]
byte
(
self
.
root
))
:
]
...
...
@@ -76,9 +70,16 @@ func (self *templatefile) visit(paths string, f os.FileInfo, err error) error {
self
.
files
[
subdir
]
=
m
}
return
nil
}
func
HasTemplateEXt
(
paths
string
)
bool
{
for
_
,
v
:=
range
BeeTemplateExt
{
if
strings
.
HasSuffix
(
paths
,
"."
+
v
)
{
return
true
}
}
return
nil
return
false
}
func
AddTemplateExt
(
ext
string
)
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment