diff options
Diffstat (limited to 'routers/repo/view.go')
-rw-r--r-- | routers/repo/view.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go index f4242cd5..74c5f1ce 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -70,7 +70,6 @@ func Home(ctx *context.Context) { ctx.Handle(404, "repo.Home", nil) return } - if entry != nil && !entry.IsDir() { blob := entry.Blob() @@ -92,9 +91,12 @@ func Home(ctx *context.Context) { _, isTextFile := base.IsTextFile(buf) _, isImageFile := base.IsImageFile(buf) + _, isPDFFile := base.IsPDFFile(buf) ctx.Data["IsFileText"] = isTextFile switch { + case isPDFFile: + ctx.Data["IsPDFFile"] = true case isImageFile: ctx.Data["IsImageFile"] = true case isTextFile: |