Add custom css

This commit is contained in:
bootstraponline
2012-11-07 19:40:52 -07:00
parent 3a56f39f6a
commit 7c4052906c
6 changed files with 24 additions and 0 deletions
+8
View File
@@ -536,6 +536,14 @@ Note that filenames on windows must not contain any of the following characters
Gollum optionally takes a `--config file`. See [config.rb](https://github.com/github/gollum/blob/master/config.rb) for an example.
## CUSTOM CSS
The `--css` flag will inject `custom.css` from the root of your git repository into each page. Here's an example of floating the sidebar to the left.
```css
#wiki-rightbar { float: left !important; }
```
## CONTRIBUTE
If you'd like to hack on Gollum, start by forking my repo on GitHub:
+4
View File
@@ -45,6 +45,10 @@ opts = OptionParser.new do |opts|
options['irb'] = true
end
opts.on("--css", "Inject custom css. Uses custom.css from root repository") do
wiki_options[:css] = true
end
opts.on("--page-file-dir [PATH]", "Specify the sub directory for all page files (default: repository root).") do |path|
wiki_options[:page_file_dir] = path
end
+2
View File
@@ -238,6 +238,7 @@ module Precious
@content = @page.formatted_data
@toc_content = wiki.universal_toc ? @page.toc_data : nil
@mathjax = wiki.mathjax
@css = wiki.css
@editable = false
mustache :page
end
@@ -360,6 +361,7 @@ module Precious
@content = page.formatted_data
@toc_content = wiki.universal_toc ? @page.toc_data : nil
@mathjax = wiki.mathjax
@css = wiki.css
mustache :page
elsif file = wiki.file(fullpath)
content_type file.mime_type
@@ -6,6 +6,7 @@
<link rel="stylesheet" type="text/css" href="{{base_url}}/css/editor.css" media="all">
<link rel="stylesheet" type="text/css" href="{{base_url}}/css/dialog.css" media="all">
<link rel="stylesheet" type="text/css" href="{{base_url}}/css/template.css" media="all">
{{#css}}<link rel="stylesheet" type="text/css" href="/custom.css" media="all">{{/css}}
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="{{base_url}}/css/ie7.css" media="all">
+4
View File
@@ -80,6 +80,10 @@ module Precious
@mathjax
end
def css # custom css
@css
end
# Access to embedded metadata.
#
# Examples
+5
View File
@@ -137,6 +137,10 @@ module Gollum
# Gets the boolean live preview value.
attr_reader :live_preview
# Injects custom css from custom.css in root repo.
# Defaults to false
attr_reader :css
# Public: Initialize a new Gollum Repo.
#
# path - The String path to the Git repository that holds the Gollum
@@ -191,6 +195,7 @@ module Gollum
@mathjax = options.fetch :mathjax, false
@show_all = options.fetch :show_all, false
@collapse_tree = options.fetch :collapse_tree, false
@css = options.fetch :css, false
end
# Public: check whether the wiki's git repo exists on the filesystem.