diff --git a/README.md b/README.md index 37a157bb..cd6bb94a 100644 --- a/README.md +++ b/README.md @@ -544,11 +544,7 @@ Gollum optionally takes a `--config file`. See [config.rb](https://github.com/gi ## CUSTOM CSS -The `--css` flag will inject `custom.css` from the root of your git repository into each page. `custom.css` must be commited to git or you will get a 302 redirect to the create page. Here's an example of floating the sidebar to the left. - -```css -#wiki-rightbar { float: left !important; } -``` +The `--css` flag will inject `custom.css` from the root of your git repository into each page. `custom.css` must be commited to git or you will get a 302 redirect to the create page. ## CONTRIBUTE diff --git a/lib/gollum/frontend/app.rb b/lib/gollum/frontend/app.rb index 67ef0a2b..d8c0d850 100644 --- a/lib/gollum/frontend/app.rb +++ b/lib/gollum/frontend/app.rb @@ -388,11 +388,15 @@ module Precious if page = wiki.paged(name, path, exact = true) @page = page @name = name + @content = page.formatted_data + + # Extensions and layout data @editable = true - @content = page.formatted_data @toc_content = wiki.universal_toc ? @page.toc_data : nil - @mathjax = wiki.mathjax + @mathjax = wiki.mathjax @h1_title = wiki.h1_title + @bar_side = wiki.bar_side + mustache :page elsif file = wiki.file(fullpath) content_type file.mime_type diff --git a/lib/gollum/frontend/public/gollum/css/gollum.css b/lib/gollum/frontend/public/gollum/css/gollum.css index ba59d912..b0e8ab3b 100755 --- a/lib/gollum/frontend/public/gollum/css/gollum.css +++ b/lib/gollum/frontend/public/gollum/css/gollum.css @@ -74,6 +74,12 @@ a:hover, a:visited { } /* @section body */ + +.has-leftbar #wiki-body { + float: right; + clear: right; +} + #wiki-body { display: block; float: left; @@ -83,7 +89,7 @@ a:hover, a:visited { width: 100%; } -.has-rightbar #wiki-body { +.has-sidebar #wiki-body { width: 68%; } @@ -93,7 +99,7 @@ a:hover, a:visited { border: 1px solid #DDD; font-size: 13px; padding: 0px 5px; - float:left; + float: left; margin-bottom: 20px; min-width: 33%; @@ -105,12 +111,19 @@ a:hover, a:visited { border: none; } -/* @section rightbar */ -#wiki-rightbar { +/* @section sidebar */ +.has-leftbar #wiki-sidebar { + float: left; +} + +.has-rightbar #wiki-sidebar { + float: right; +} + +#wiki-sidebar { background-color: #f7f7f7; border: 1px solid #ddd; font-size: 13px; - float: right; padding: 7px; width: 25%; color: #555; @@ -120,15 +133,15 @@ a:hover, a:visited { -webkit-border-radius: 0.5em; } -#wiki-rightbar p { +#wiki-sidebar p { margin: 13px 0 0; } -#wiki-rightbar > p:first-child { +#wiki-sidebar > p:first-child { margin-top: 10px; } -#wiki-rightbar p.parent { +#wiki-sidebar p.parent { border-bottom: 1px solid #bbb; font-weight: bold; margin: 0 0 0.5em 0; @@ -137,7 +150,7 @@ a:hover, a:visited { } /* Back arrow */ -#wiki-rightbar p.parent:before { +#wiki-sidebar p.parent:before { color: #666; content: "← "; } @@ -149,7 +162,7 @@ a:hover, a:visited { margin: 2em 0 5em; } -.has-rightbar #wiki-footer { +.has-sidebar #wiki-footer { width: 70%; } diff --git a/lib/gollum/frontend/templates/create.mustache b/lib/gollum/frontend/templates/create.mustache index ba3d981d..a6a805dd 100644 --- a/lib/gollum/frontend/templates/create.mustache +++ b/lib/gollum/frontend/templates/create.mustache @@ -3,7 +3,7 @@