From e9a9eb1779b879b47b5e002f19d42481df2114c7 Mon Sep 17 00:00:00 2001 From: bootstraponline Date: Sat, 5 May 2012 13:49:01 -0600 Subject: [PATCH] Add header. --- README.md | 8 +++++++- lib/gollum/frontend/app.rb | 1 + lib/gollum/frontend/templates/page.mustache | 7 +++++++ lib/gollum/frontend/views/create.rb | 5 +++++ lib/gollum/frontend/views/edit.rb | 11 +++++++++++ lib/gollum/frontend/views/page.rb | 15 ++++++++++++++- lib/gollum/page.rb | 9 ++++++++- test/test_app.rb | 6 ++++-- 8 files changed, 57 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d8d9aa62..7f6c10b5 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,13 @@ are named `_Sidebar.ext` where the extension is one of the supported formats. Sidebars affect all pages in their directory and any subdirectories that do not have a sidebar file of their own. +## HEADER FILES + +Header files allow you to add a simple header to your wiki. Header files must +be named `_Header.ext` where the extension is one of the supported formats. +Like sidebars, headers affect all pages in their directory and any +subdirectories that do not have a header file of their own. + ## FOOTER FILES Footer files allow you to add a simple footer to your wiki. Footer files must @@ -113,7 +120,6 @@ be named `_Footer.ext` where the extension is one of the supported formats. Like sidebars, footers affect all pages in their directory and any subdirectories that do not have a footer file of their own. - ## HTML SANITIZATION For security and compatibility reasons Gollum wikis may not contain custom CSS diff --git a/lib/gollum/frontend/app.rb b/lib/gollum/frontend/app.rb index 05db3563..01ab8d82 100644 --- a/lib/gollum/frontend/app.rb +++ b/lib/gollum/frontend/app.rb @@ -63,6 +63,7 @@ module Precious update_wiki_page(wiki, page, params[:content], commit, name, params[:format]) + update_wiki_page(wiki, page.header, params[:header], commit) if params[:header] update_wiki_page(wiki, page.footer, params[:footer], commit) if params[:footer] update_wiki_page(wiki, page.sidebar, params[:sidebar], commit) if params[:sidebar] committer.commit diff --git a/lib/gollum/frontend/templates/page.mustache b/lib/gollum/frontend/templates/page.mustache index 8d29fb4c..4400181b 100644 --- a/lib/gollum/frontend/templates/page.mustache +++ b/lib/gollum/frontend/templates/page.mustache @@ -20,6 +20,13 @@