From 21379e30a18fed473ae2bbeb41332919ff80497d Mon Sep 17 00:00:00 2001 From: slene Date: Thu, 20 Mar 2014 17:31:18 +0800 Subject: [PATCH] fix link --- modules/base/markdown.go | 4 ++-- public/css/gogs.css | 8 ++++++++ templates/repo/single_file.tmpl | 10 +++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/modules/base/markdown.go b/modules/base/markdown.go index a9f4cbf0d..e49e111c0 100644 --- a/modules/base/markdown.go +++ b/modules/base/markdown.go @@ -36,7 +36,7 @@ func isLink(link []byte) bool { func IsMarkdownFile(name string) bool { name = strings.ToLower(name) switch filepath.Ext(name) { - case "md", "markdown": + case "md", "markdown", "mdown": return true } return false @@ -61,7 +61,7 @@ type CustomRender struct { func (options *CustomRender) Link(out *bytes.Buffer, link []byte, title []byte, content []byte) { if len(link) > 0 && !isLink(link) { if link[0] == '#' { - link = append([]byte(options.urlPrefix), link...) + // link = append([]byte(options.urlPrefix), link...) } else { link = []byte(path.Join(options.urlPrefix, string(link))) } diff --git a/public/css/gogs.css b/public/css/gogs.css index a4767c1c8..83d1b96fe 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -647,6 +647,14 @@ html, body { padding: 30px 30px 50px; } +.file-content .file-body.file-code { + padding: 0; +} + +.file-content .file-body.file-code > pre { + border: none; +} + .branch-list th, .commit-list th { background-color: #FFF; line-height: 28px !important; diff --git a/templates/repo/single_file.tmpl b/templates/repo/single_file.tmpl index b4626053f..0c1c3713f 100644 --- a/templates/repo/single_file.tmpl +++ b/templates/repo/single_file.tmpl @@ -1,6 +1,10 @@
- {{.FileName}} + {{if .ReadmeExist}} + + {{else}} + + {{end}}{{.FileName}}
{{if .FileIsLarge}} {{else}} -
-
{{.FileContent}}
+
+
{{.FileContent}}
{{end}} {{end}}