diff options
-rw-r--r-- | examples/hakyll/tutorial.markdown | 5 | ||||
-rw-r--r-- | src/Hakyll/Core/Identifier.hs | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/examples/hakyll/tutorial.markdown b/examples/hakyll/tutorial.markdown index b3892d5..3fa870f 100644 --- a/examples/hakyll/tutorial.markdown +++ b/examples/hakyll/tutorial.markdown @@ -109,7 +109,10 @@ items it matches -- and matching is done using the `"css/*"` [pattern]. example, `css/screen.css` will be routed to `css/screen.css` -- not very exciting. -[pattern]: TODO: link +Note that a [pattern] matches [identifiers], it doesn't match filenames. + +[pattern]: /reference/Hakyll-Core-Identifier-Pattern.html +[identifiers]: /reference/Hakyll-Core-Identifier.html ~~~~~{.haskell} route "css/*" idRoute diff --git a/src/Hakyll/Core/Identifier.hs b/src/Hakyll/Core/Identifier.hs index ea03e8c..16403e6 100644 --- a/src/Hakyll/Core/Identifier.hs +++ b/src/Hakyll/Core/Identifier.hs @@ -10,6 +10,16 @@ -- -- * @error/404@ -- +-- The most important difference between an 'Identifier' and a file path is that +-- the identifier for an item is not necesserily the file path. +-- +-- For example, we could have an @index@ identifier, generated by Hakyll. The +-- actual file path would be @index.html@, but we identify it using @index@. +-- +-- @posts/foo.markdown@ could be an identifier of an item that is rendered to +-- @posts/foo.html@. In this case, the identifier is the name of the source +-- file of the page. +-- {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Hakyll.Core.Identifier ( Identifier (..) |