self-host the build_success_brightgreen.svg image
This commit is contained in:
parent
78c7f82ef8
commit
3c54a6eff4
4
pages.go
4
pages.go
@ -193,7 +193,7 @@ func (this *Application) Repopage(w http.ResponseWriter, r *http.Request, repoNa
|
||||
// We add some extra badges based on special text entries
|
||||
extraBadgesMd := ``
|
||||
if !hasArticleTag {
|
||||
extraBadgesMd += ` ![](https://img.shields.io/badge/build-success-brightgreen)`
|
||||
extraBadgesMd += ` %%REPLACEME__BADGE%%`
|
||||
}
|
||||
extraBadgesMd += ` [![](https://img.shields.io/badge/vcs-git-green?logo=git)](` + repoURL + `)`
|
||||
|
||||
@ -211,6 +211,8 @@ func (this *Application) Repopage(w http.ResponseWriter, r *http.Request, repoNa
|
||||
return
|
||||
}
|
||||
|
||||
readmeHtml = []byte(strings.Replace(string(readmeHtml), `%%REPLACEME__BADGE%%`, `<img src="/static/build_success_brightgreen.svg" style="width:90px;height:20px;">`, 1))
|
||||
|
||||
images, err := this.imageFilesForRepo(ctx, repoName)
|
||||
if err != nil {
|
||||
this.internalError(w, r, fmt.Errorf("listing images: %w", err))
|
||||
|
2
static/build_success_brightgreen.svg
Normal file
2
static/build_success_brightgreen.svg
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="90" height="20" role="img" aria-label="build: success"><title>build: success</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="90" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="37" height="20" fill="#555"/><rect x="37" width="53" height="20" fill="#4c1"/><rect width="90" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="195" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="270">build</text><text x="195" y="140" transform="scale(.1)" fill="#fff" textLength="270">build</text><text aria-hidden="true" x="625" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">success</text><text x="625" y="140" transform="scale(.1)" fill="#fff" textLength="430">success</text></g></svg>
|
After Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in New Issue
Block a user