File tree Expand file tree Collapse file tree 6 files changed +48
-1
lines changed
Expand file tree Collapse file tree 6 files changed +48
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ VOLUME /data
33ENV EXTERNAL_URL=http://localhost:8080
44ENV OAUTH2_CLIENT_ID=""
55ENV OAUTH2_SECRET=""
6+ ENV GBM_CSS_COLUMNS=""
67EXPOSE 8080
78EXPOSE 8443
89COPY gobookmarks /bin/gobookmarks
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ You will require 3 environment arguments:
7171| ` OAUTH2_CLIENT_ID ` | The Client ID generated from setting up Oauth2 on github: https://github.com/settings/developers |
7272| ` OAUTH2_SECRET ` | Secret ID generated from setting up Oauth2 on github: https://github.com/settings/developers |
7373| ` EXTERNAL_URL ` | The fully qualified URL that it is to accept connections from. Ie ` http://localhost:8080 ` |
74+ | ` GBM_CSS_COLUMNS ` | If set (to any value) the ` Column ` keyword in your bookmarks will create CSS multi-column breaks rather than table cells. |
7475
7576## Oauth2 setup
7677
Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ func NewFuncs(r *http.Request) template.FuncMap {
4646 "ref" : func () string {
4747 return r .URL .Query ().Get ("ref" )
4848 },
49+ "useCssColumns" : func () bool {
50+ return UseCssColumns
51+ },
4952 "loggedIn" : func () (bool , error ) {
5053 session := r .Context ().Value (ContextValues ("session" )).(* sessions.Session )
5154 githubUser , ok := session .Values ["GithubUser" ].(* github.User )
Original file line number Diff line number Diff line change @@ -114,3 +114,18 @@ div.title {
114114.category-form textarea {
115115 height : 30vh ;
116116}
117+
118+ .cssColumns .bookmarkColumns {
119+ column-width : 18em ;
120+ column-gap : 1em ;
121+ }
122+
123+ .cssColumns .columnBreak {
124+ break-before : column;
125+ }
126+
127+ .cssColumns .categoryBlock {
128+ break-inside : avoid;
129+ page-break-inside : avoid;
130+ -webkit-column-break-inside : avoid;
131+ }
Original file line number Diff line number Diff line change 1+ package gobookmarks
2+
3+ import "os"
4+
5+ var UseCssColumns = os .Getenv ("GBM_CSS_COLUMNS" ) != ""
Original file line number Diff line number Diff line change 44 <a href= " {{ OAuth2URL }}" >Login</a><br>
55 {{else }}
66 {{- range bookmarkPages }}
7- <div class= " bookmarkPage" >
7+ <div class= " bookmarkPage{{ if useCssColumns }} cssColumns{{ end }} " >
88 {{- range .Blocks }}
99 {{- if .HR }}
1010 <hr class= " bookmarkHr" />
1111 {{- else }}
12+ {{- if useCssColumns }}
13+ <div class= " bookmarkColumns" >
14+ {{- $first := true }}
15+ {{- range .Columns }}
16+ {{- if not $first }}<div class= " columnBreak" ></div>{{ end }}
17+ {{- range .Categories }}
18+ <div class= " categoryBlock" >
19+ <h2>{{ .Name }} <a class= " edit-link" href= " /editCategory?index={{ .Index }}&ref={{ref}}" title= " Edit" >✎</a></h2>
20+ <ul style= " list-style-type: none;" >
21+ {{- range .Entries }}
22+ <li>
23+ <img src= " /proxy/favicon?url={{ .Url }}" alt= " •" style= " width: 1em; max-height: 1em; font-weight: bolder; font-family: -moz-bullet-font;" />
24+ <a href= " {{ .Url }}" target= " _blank" >{{ .Name }}</a>
25+ </li>
26+ {{- end }}
27+ </ul>
28+ </div>
29+ {{- end }}
30+ {{- $first = false }}
31+ {{- end }}
32+ </div>
33+ {{- else }}
1234 <table>
1335 <tr valign= " top" >
1436 {{- range .Columns }}
You can’t perform that action at this time.
0 commit comments