]> source.dussan.org Git - gitea.git/commitdiff
fix link
authorslene <vslene@gmail.com>
Thu, 20 Mar 2014 09:31:18 +0000 (17:31 +0800)
committerslene <vslene@gmail.com>
Thu, 20 Mar 2014 09:31:18 +0000 (17:31 +0800)
modules/base/markdown.go
public/css/gogs.css
templates/repo/single_file.tmpl

index a9f4cbf0d7b2036490c7d9f24a326ade7192a978..e49e111c0e10eb5e5f9b72222f1478d607affe58 100644 (file)
@@ -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)))
                }
index a4767c1c8bfcf888efe74c384b41d3ab0ab60c49..83d1b96fe237180a3c08aa5a86eef6db27f4e7c1 100755 (executable)
@@ -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;
index b4626053fda442fd79b11d74750e532d8226a1be..0c1c3713f69be9567928e91e1dae63141ca1824e 100644 (file)
@@ -1,6 +1,10 @@
 <div class="panel panel-default file-content">
     <div class="panel-heading file-head">
-        <i class="icon fa fa-book"></i> {{.FileName}}
+        {{if .ReadmeExist}}
+            <i class="icon fa fa-book"></i>
+        {{else}}
+            <i class="icon fa fa-file-text-o"></i>
+        {{end}}{{.FileName}}
     </div>
     {{if .FileIsLarge}}
         <div class="panel-footer">
@@ -12,8 +16,8 @@
                 {{.FileContent|str2html}}
             </div>
         {{else}}
-            <div class="panel-body file-body markdown">
-                <pre><code>{{.FileContent}}</code></pre>
+            <div class="panel-body file-body file-code markdown">
+                <pre class="linenums"><code>{{.FileContent}}</code></pre>
             </div>
         {{end}}
     {{end}}