| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
MathiasSM.Content
Description
Typed views of the content files: posts and pages (front matter)
Synopsis
- data Language
- languageCode :: Language -> String
- data Post = Post {}
- data NavEntry = NavEntry {}
- isDraft :: Metadata -> Bool
- isHidden :: Env -> Metadata -> Bool
- isIndex :: Metadata -> Bool
- isSitemapExcluded :: Metadata -> Bool
- isTemplated :: Compiler Bool
- groupOf :: FilePath -> Identifier -> Metadata -> Maybe String
- aliasesOf :: Metadata -> Either [String] [FilePath]
- parseAliasesYaml :: String -> Either [String] [FilePath]
- parsePost :: Metadata -> Either [String] Post
- parsePostYaml :: String -> Either [String] Post
- parseNavEntry :: Metadata -> Either [String] (Maybe NavEntry)
- parseNavYaml :: String -> Either [String] (Maybe NavEntry)
- showcaseKey :: Project -> (Int, Down Day)
- requirePost :: Compiler Post
- requirePostOf :: Identifier -> Compiler Post
- requireLanguage :: Identifier -> Compiler Language
- requireNav :: Identifier -> Compiler (Maybe NavEntry)
- requireProject :: Item String -> Compiler Project
- requireSocials :: Item String -> Compiler [Social]
Documentation
Language a page is written in
Instances
| FromJSON Language Source # | |
Defined in MathiasSM.Content | |
| Bounded Language Source # | |
| Enum Language Source # | |
Defined in MathiasSM.Content | |
| Show Language Source # | |
| Eq Language Source # | |
languageCode :: Language -> String Source #
The code used in front matter and in lang attributes
What a post (blog, creative-writing) needs to be published
Constructors
| Post | |
Constructors
| NavEntry | |
Instances
isDraft :: Metadata -> Bool Source #
Whether an item is marked `draft: true`, and so left out of the site
isHidden :: Env -> Metadata -> Bool Source #
Whether a draft item is hidden from this build (dev shows drafts, prod hides them)
isIndex :: Metadata -> Bool Source #
Whether an item is a group index page (`index: true` in its front matter)
isSitemapExcluded :: Metadata -> Bool Source #
Whether an item is marked `sitemap: false`, and so left out of the sitemap
isTemplated :: Compiler Bool Source #
Whether the current item is marked `templated: true`, and so may use template syntax in its body
groupOf :: FilePath -> Identifier -> Metadata -> Maybe String Source #
The group an item belongs to: its `group:` front matter, or the folder it sits in under `writings/`
aliasesOf :: Metadata -> Either [String] [FilePath] Source #
Old paths an item should redirect from (`aliases: [old]`, or a single `aliases: old`)
Each must be an absolute path other than the home page.
parseAliasesYaml :: String -> Either [String] [FilePath] Source #
aliasesOf on YAML text (the same shape as front matter)
parsePost :: Metadata -> Either [String] Post Source #
Parses front matter, reporting every problem (not just the first)
parsePostYaml :: String -> Either [String] Post Source #
parsePost on YAML text (the same shape as front matter)
parseNavEntry :: Metadata -> Either [String] (Maybe NavEntry) Source #
The menu entry a page asks for, if it has a `nav:` label (it then also needs navOrder
and path)
parseNavYaml :: String -> Either [String] (Maybe NavEntry) Source #
parseNavEntry on YAML text (the same shape as front matter)
showcaseKey :: Project -> (Int, Down Day) Source #
Sort key for the showcase: projects with a priority first (lowest number
first), then the rest, newest start first
requirePost :: Compiler Post Source #
Parses the current item's front matter, failing the build with the problems found
requirePostOf :: Identifier -> Compiler Post Source #
Parses the front matter of any item, failing the build (naming it) with the problems found
requireLanguage :: Identifier -> Compiler Language Source #
The language of an item, failing the build if it's not a known one
requireNav :: Identifier -> Compiler (Maybe NavEntry) Source #
The menu entry of any page, failing the build (naming the page) if it's invalid