mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-28 22:39:05 +08:00
add supporters template
This commit is contained in:
14
handlers/supporters.go
Normal file
14
handlers/supporters.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
// SupportersHandler handles the supporters page
|
||||
func SupportersHandler(w http.ResponseWriter, r *http.Request) {
|
||||
t := template.Must(template.New("supporters.html").Delims("[[", "]]").ParseFiles("templates/supporters.html", "templates/footer.html"))
|
||||
t.Execute(w, map[string]interface{}{
|
||||
"google_analytics_key": googleAnalyticsKey,
|
||||
})
|
||||
}
|
||||
1
main.go
1
main.go
@@ -132,6 +132,7 @@ func main() {
|
||||
http.HandleFunc(m.instrument("/report/", makeHandler("report", handlers.ReportHandler)))
|
||||
http.HandleFunc(m.instrument("/badge/", makeHandler("badge", handlers.BadgeHandler)))
|
||||
http.HandleFunc(m.instrument("/high_scores/", handlers.HighScoresHandler))
|
||||
http.HandleFunc(m.instrument("/supporters/", handlers.SupportersHandler))
|
||||
http.HandleFunc(m.instrument("/about/", handlers.AboutHandler))
|
||||
http.HandleFunc(m.instrument("/", handlers.HomeHandler))
|
||||
|
||||
|
||||
@@ -47,6 +47,9 @@
|
||||
<span class="header-item">
|
||||
<a href="https://github.com/gojp/goreportcard">GitHub</a>
|
||||
</span>
|
||||
<span class="header-item">
|
||||
<a href="/supporters">Supporters</a>
|
||||
</span>
|
||||
<span class="header-item is-active">
|
||||
<a href="/about">About</a>
|
||||
</span>
|
||||
|
||||
@@ -47,6 +47,9 @@
|
||||
<span class="header-item">
|
||||
<a href="https://github.com/gojp/goreportcard">GitHub</a>
|
||||
</span>
|
||||
<span class="header-item">
|
||||
<a href="/supporters">Supporters</a>
|
||||
</span>
|
||||
<span class="header-item">
|
||||
<a href="/about">About</a>
|
||||
</span>
|
||||
|
||||
@@ -45,6 +45,9 @@
|
||||
<span class="header-item">
|
||||
<a href="https://github.com/gojp/goreportcard">GitHub</a>
|
||||
</span>
|
||||
<span class="header-item">
|
||||
<a href="/supporters"><b>Supporters</b></a>
|
||||
</span>
|
||||
<span class="header-item">
|
||||
<a href="/about">About</a>
|
||||
</span>
|
||||
|
||||
68
templates/supporters.html
Normal file
68
templates/supporters.html
Normal file
@@ -0,0 +1,68 @@
|
||||
<!doctype html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Go Report Card | Go project code quality report cards</title>
|
||||
<link rel="stylesheet" href="/assets/bulma.0.0.23.min.css">
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', '[[ .google_analytics_key ]]', 'auto');
|
||||
ga('send', 'pageview');
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.header .is-active {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header class="header">
|
||||
<div class="container">
|
||||
<!-- Left side -->
|
||||
<div class="header-left">
|
||||
<a class="header-item" href="/">
|
||||
<h3 class="title">Go Report Card</h3>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Hamburger menu (on mobile) -->
|
||||
<span class="header-toggle">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</span>
|
||||
|
||||
<!-- Right side -->
|
||||
<div class="header-right header-menu">
|
||||
<span class="header-item">
|
||||
<a href="/high_scores">High Scores</a>
|
||||
</span>
|
||||
<span class="header-item">
|
||||
<a href="https://github.com/gojp/goreportcard">GitHub</a>
|
||||
</span>
|
||||
<span class="header-item is-active">
|
||||
<a href="/supporters">Supporters</a>
|
||||
</span>
|
||||
<span class="header-item">
|
||||
<a href="/about">About</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h1 class="title">Supporters</h1>
|
||||
<ul>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
[[ template "footer" . ]]
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user