diff --git a/CHANGES b/CHANGES
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,18 @@
+Version 0.6.5 released 06 Oct 2009
+
+* Added metadata to Page and Context, provided askMeta for plugins.
+  This patch gives plugins access to all of the key/value pairs
+  in the page metadata block.  Thanks to Dan Cook.
+
+* Added PigLatin plugin to demonstrate use of askMeta.
+
+* Display informative message on authentication failure.
+
+Version 0.6.4 released 28 Sep 2009
+
+* Fixed preview javascript so that tex math works properly in
+  preview.
+
 Version 0.6.3 released 27 Sep 2009
 
 * Fixed MathML conversion so it doesn't happen when exporting to
diff --git a/Network/Gitit/Authentication.hs b/Network/Gitit/Authentication.hs
--- a/Network/Gitit/Authentication.hs
+++ b/Network/Gitit/Authentication.hs
@@ -368,7 +368,7 @@
       addCookie sessionTime (mkCookie "sid" (show key))
       seeOther (encUrl destination) $ toResponse $ p << ("Welcome, " ++ uname)
     else
-      loginUserForm
+      withMessages ["Invalid username or password."] loginUserForm
 
 encUrl :: String -> String
 encUrl = encString True isAscii
diff --git a/Network/Gitit/ContentTransformer.hs b/Network/Gitit/ContentTransformer.hs
--- a/Network/Gitit/ContentTransformer.hs
+++ b/Network/Gitit/ContentTransformer.hs
@@ -116,7 +116,8 @@
                            , ctxCacheable = True
                            , ctxTOC = tableOfContents cfg
                            , ctxBirdTracks = showLHSBirdTracks cfg
-                           , ctxCategories = [] }
+                           , ctxCategories = []
+                           , ctxMeta = [] }
 
 -- | Converts a @ContentTransformer@ into a @GititServerPart@;
 -- specialized to wiki pages.
@@ -318,7 +319,8 @@
 pageToPandoc :: Page -> ContentTransformer Pandoc
 pageToPandoc page' = do
   modifyContext $ \ctx -> ctx{ ctxTOC = pageTOC page'
-                             , ctxCategories = pageCategories page' }
+                             , ctxCategories = pageCategories page'
+                             , ctxMeta = pageMeta page' }
   return $ readerFor (pageFormat page') (pageLHS page') (pageText page')
 
 -- | Converts contents of page file to Page object.
diff --git a/Network/Gitit/Interface.hs b/Network/Gitit/Interface.hs
--- a/Network/Gitit/Interface.hs
+++ b/Network/Gitit/Interface.hs
@@ -115,6 +115,7 @@
                                , askUser
                                , askRequest
                                , askFileStore
+                               , askMeta
                                , doNotCache
                                , getContext
                                , modifyContext
@@ -151,6 +152,10 @@
 -- | Returns the wiki filestore.
 askFileStore :: PluginM FileStore
 askFileStore = liftM pluginFileStore ask
+
+-- | Returns the page meta data
+askMeta :: PluginM [(String, String)]
+askMeta = liftM ctxMeta getContext
 
 -- | Indicates that the current page or file is not to be cached.
 doNotCache :: PluginM ()
diff --git a/Network/Gitit/Page.hs b/Network/Gitit/Page.hs
--- a/Network/Gitit/Page.hs
+++ b/Network/Gitit/Page.hs
@@ -97,7 +97,8 @@
                    , pageTOC         = tableOfContents conf
                    , pageTitle       = pagename
                    , pageCategories  = []
-                   , pageText        = filter (/= '\r') rest }
+                   , pageText        = filter (/= '\r') rest
+                   , pageMeta        = ls }
   in  foldr adjustPage page' ls
 
 adjustPage :: (String, String) -> Page -> Page
diff --git a/Network/Gitit/Types.hs b/Network/Gitit/Types.hs
--- a/Network/Gitit/Types.hs
+++ b/Network/Gitit/Types.hs
@@ -138,6 +138,7 @@
   , pageTitle       :: String
   , pageCategories  :: [String]
   , pageText        :: String
+  , pageMeta        :: [(String, String)]
 } deriving (Read, Show)
 
 type SessionKey = Integer
@@ -191,6 +192,7 @@
                        , ctxTOC             :: Bool
                        , ctxBirdTracks      :: Bool
                        , ctxCategories      :: [String]
+                       , ctxMeta            :: [(String, String)]
                        }
 
 class (Monad m) => HasContext m where
diff --git a/gitit.cabal b/gitit.cabal
--- a/gitit.cabal
+++ b/gitit.cabal
@@ -1,5 +1,5 @@
 name:                gitit
-version:             0.6.4
+version:             0.6.5
 Cabal-version:       >= 1.2
 build-type:          Simple
 synopsis:            Wiki using happstack, git or darcs, and pandoc.
@@ -69,6 +69,7 @@
                      data/markupHelp/LaTeX, data/markupHelp/LaTeX+LHS,
                      data/markupHelp/HTML,
                      plugins/CapitalizeEmphasis.hs,
+                     plugins/PigLatin.hs,
                      plugins/Dot.hs,
                      plugins/ImgTex.hs,
                      plugins/Interwiki.hs,
@@ -95,6 +96,8 @@
                      Network.Gitit.Authentication, Network.Gitit.Page, Network.Gitit.Feed
   if flag(plugins)
     exposed-modules: Network.Gitit.Interface
+    build-depends:   ghc, ghc-paths
+    cpp-options:     -D_PLUGINS
   build-depends:     base >= 3, pandoc >= 1.1, filepath
   ghc-options:       -Wall
   ghc-prof-options:  -auto-all -caf-all
diff --git a/plugins/PigLatin.hs b/plugins/PigLatin.hs
new file mode 100644
--- /dev/null
+++ b/plugins/PigLatin.hs
@@ -0,0 +1,31 @@
+module PigLatin (plugin) where
+
+-- This plugin converts a page to pig latin if the 'language' metadata
+-- field is set to 'pig latin'. This demonstrates how to get access to
+-- metadata in a plugin.
+
+import Network.Gitit.Interface
+import Data.Char (toLower, toUpper, isLower, isUpper, isLetter)
+
+plugin :: Plugin
+plugin = PageTransform $ \doc -> do
+  meta <- askMeta
+  case lookup "language" meta of
+       Just s | map toLower s == "pig latin" ->
+         return $ processWith pigLatinStr doc
+       _ -> return doc
+
+pigLatinStr :: Inline -> Inline
+pigLatinStr (Str "") = Str ""
+pigLatinStr (Str (c:cs)) | isLower c && isConsonant c =
+  Str (cs ++ (c : "ay"))
+pigLatinStr (Str (c:cs)) | isUpper c && isConsonant c =
+  Str (capitalize cs ++ (toLower c : "ay"))
+pigLatinStr (Str x@(c:cs)) | isLetter c = Str (x ++ "yay")
+pigLatinStr x       = x
+
+isConsonant c = c `notElem` "aeiouAEIOU" 
+
+capitalize :: String -> String
+capitalize "" = ""
+capitalize (c:cs) = toUpper c : cs
