func IsMarkdownFile(name string) bool {
name = strings.ToLower(name)
switch filepath.Ext(name) {
- case "md", "markdown":
+ case "md", "markdown", "mdown":
return true
}
return false
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)))
}
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;
<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">
{{.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}}