Skip to content
Snippets Groups Projects
Commit 7c405290 authored by bootstraponline's avatar bootstraponline
Browse files

Add custom css

parent 3a56f39f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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:
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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">
Loading
Loading
Loading
Loading
@@ -80,6 +80,10 @@ module Precious
@mathjax
end
 
def css # custom css
@css
end
# Access to embedded metadata.
#
# Examples
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
@@ -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.
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment