aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md3
-rw-r--r--README.md3
-rw-r--r--config.go2
-rw-r--r--handler_test.go2
-rw-r--r--sally.yaml1
-rw-r--r--templates/index.html11
6 files changed, 21 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 31295a3..3f92d7f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,7 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
-### Changed
+### Added
+- Add an optional `description` field to packages.
- Use a fluid layout for the index page.
This renders better on narrow screens.
diff --git a/README.md b/README.md
index ae1888d..92a8da1 100644
--- a/README.md
+++ b/README.md
@@ -47,6 +47,9 @@ packages:
# Defaults to "master".
branch: master
+ # Optional description of the package.
+ description: A fast, structured-logging library.
+
# Alternative base URL instead of the value configured at the top-level.
# This is useful if the same sally instance is
# hosted behind multiple base URLs.
diff --git a/config.go b/config.go
index d562154..57b5dcd 100644
--- a/config.go
+++ b/config.go
@@ -26,6 +26,8 @@ type Package struct {
Repo string `yaml:"repo"`
Branch string `yaml:"branch"`
URL string `yaml:"url"`
+
+ Desc string `yaml:"description"` // plain text only
}
// Parse takes a path to a yaml file and produces a parsed Config
diff --git a/handler_test.go b/handler_test.go
index 96a10dd..e300d19 100644
--- a/handler_test.go
+++ b/handler_test.go
@@ -17,6 +17,7 @@ packages:
zap:
url: go.uberalt.org
repo: github.com/uber-go/zap
+ description: A fast, structured logging library.
`
@@ -27,6 +28,7 @@ func TestIndex(t *testing.T) {
body := rr.Body.String()
assert.Contains(t, body, "github.com/thriftrw/thriftrw-go")
assert.Contains(t, body, "github.com/yarpc/yarpc-go")
+ assert.Contains(t, body, "A fast, structured logging library.")
}
func TestPackageShouldExist(t *testing.T) {
diff --git a/sally.yaml b/sally.yaml
index ee8ff87..c9a3af8 100644
--- a/sally.yaml
+++ b/sally.yaml
@@ -3,5 +3,6 @@ url: go.uber.org
packages:
thriftrw:
repo: github.com/thriftrw/thriftrw-go
+ description: A customizable implementation of Thrift.
yarpc:
repo: github.com/yarpc/yarpc-go
diff --git a/templates/index.html b/templates/index.html
index 3fc210c..d193263 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -7,6 +7,7 @@
.separator {
margin: 0.25em 0;
}
+ .description { color: #666; }
/* On narrow screens, switch to inline headers. */
.table-header { display: none; }
@@ -44,6 +45,16 @@
</a>
</div>
</div>
+ {{ with .Desc }}
+ <div class="row">
+ <div class="one column">
+ <!-- indent -->
+ </div>
+ <div class="eleven columns description">
+ {{ . }}
+ </div>
+ </div>
+ {{ end }}
{{ end }}
</div>
</body>