| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
MathiasSM.Yaml.Website
Description
The site configuration read from website.yaml in the content repo
Synopsis
- loadWebsite :: FilePath -> IO Website
- validateSecurityExpiration :: Website -> IO ()
- data Website = Website {}
- data Site = Site {}
- data Contact = Contact {}
- data Manifest = Manifest {}
- data Mathjax = Mathjax {}
- data Highlight = Highlight {}
- data HighlightStyle
- = Pygments
- | Espresso
- | Zenburn
- | Tango
- | Kate
- | Monochrome
- | BreezeDark
- | Haddock
- highlightStyleName :: HighlightStyle -> String
- parseHighlightStyle :: String -> Maybe HighlightStyle
- toPandocStyle :: HighlightStyle -> Style
- data FeedConfig = FeedConfig {}
- data Security = Security {}
- data Robots = Robots {
- robotsDisallow :: [String]
- data Trust = Trust {}
- data Funding = Funding {}
- data FundingEntity = FundingEntity {}
- data FundingProject = FundingProject {}
- data FundingChannel = FundingChannel {}
- data FundingPlan = FundingPlan {}
Main logic
loadWebsite :: FilePath -> IO Website Source #
Reads and parses contentDir/website.yaml, failing with a clear message
validateSecurityExpiration :: Website -> IO () Source #
Fails if the security.txt expiration is within the configured margin (or already passed)
website.yaml parsing
website:
Everything website.yaml describes
Constructors
| Website | |
Fields | |
site:
The site: section: the site's identity
Constructors
| Site | |
Fields
| |
contact:
The contact: section: how to reach the site owner
Constructors
| Contact | |
Fields
| |
manifest:
The manifest: section: web app manifest colours
Constructors
| Manifest | |
Fields | |
mathjax:
The mathjax: section: which MathJax CDN version renders the site's math
Constructors
| Mathjax | |
Fields | |
highlight:
The highlight: section: which pandoc style renders code blocks
Constructors
| Highlight | |
Fields | |
data HighlightStyle Source #
A pandoc syntax-highlighting style, as spelled in highlight.style
Constructors
| Pygments | |
| Espresso | |
| Zenburn | |
| Tango | |
| Kate | |
| Monochrome | |
| BreezeDark | |
| Haddock |
Instances
highlightStyleName :: HighlightStyle -> String Source #
How a highlight style is spelled
parseHighlightStyle :: String -> Maybe HighlightStyle Source #
Resolves a HighlightStyle from its highlight.style spelling, if known
toPandocStyle :: HighlightStyle -> Style Source #
The pandoc Style backing a HighlightStyle
feed:
data FeedConfig Source #
The feed: section: data behind atom.xml files
Constructors
| FeedConfig | |
Instances
| FromJSON FeedConfig Source # | |
Defined in MathiasSM.Yaml.Website | |
| Show FeedConfig Source # | |
Defined in MathiasSM.Yaml.Website Methods showsPrec :: Int -> FeedConfig -> ShowS # show :: FeedConfig -> String # showList :: [FeedConfig] -> ShowS # | |
| Eq FeedConfig Source # | |
Defined in MathiasSM.Yaml.Website | |
security:
The security: section: data behind .well-known/security.txt
Constructors
| Security | |
robots:
The robots: section: data behind robots.txt
Constructors
| Robots | |
Fields
| |
trust:
The trust: section: data behind .well-known/trust.txt
Constructors
| Trust | |
Fields | |
funding:
The funding: section: data behind funding.json
Constructors
| Funding | |
Fields | |
data FundingEntity Source #
The entity being funded (the funding.entity section)
Constructors
| FundingEntity | |
Fields | |
Instances
| FromJSON FundingEntity Source # | |
Defined in MathiasSM.Yaml.Website Methods parseJSON :: Value -> Parser FundingEntity # parseJSONList :: Value -> Parser [FundingEntity] # | |
| Show FundingEntity Source # | |
Defined in MathiasSM.Yaml.Website Methods showsPrec :: Int -> FundingEntity -> ShowS # show :: FundingEntity -> String # showList :: [FundingEntity] -> ShowS # | |
| Eq FundingEntity Source # | |
Defined in MathiasSM.Yaml.Website Methods (==) :: FundingEntity -> FundingEntity -> Bool # (/=) :: FundingEntity -> FundingEntity -> Bool # | |
data FundingProject Source #
A project listed in funding.json
Constructors
| FundingProject | |
Instances
| FromJSON FundingProject Source # | |
Defined in MathiasSM.Yaml.Website Methods parseJSON :: Value -> Parser FundingProject # parseJSONList :: Value -> Parser [FundingProject] # | |
| Show FundingProject Source # | |
Defined in MathiasSM.Yaml.Website Methods showsPrec :: Int -> FundingProject -> ShowS # show :: FundingProject -> String # showList :: [FundingProject] -> ShowS # | |
| Eq FundingProject Source # | |
Defined in MathiasSM.Yaml.Website Methods (==) :: FundingProject -> FundingProject -> Bool # (/=) :: FundingProject -> FundingProject -> Bool # | |
data FundingChannel Source #
A funding channel in funding.json
Constructors
| FundingChannel | |
Instances
| FromJSON FundingChannel Source # | |
Defined in MathiasSM.Yaml.Website Methods parseJSON :: Value -> Parser FundingChannel # parseJSONList :: Value -> Parser [FundingChannel] # | |
| Show FundingChannel Source # | |
Defined in MathiasSM.Yaml.Website Methods showsPrec :: Int -> FundingChannel -> ShowS # show :: FundingChannel -> String # showList :: [FundingChannel] -> ShowS # | |
| Eq FundingChannel Source # | |
Defined in MathiasSM.Yaml.Website Methods (==) :: FundingChannel -> FundingChannel -> Bool # (/=) :: FundingChannel -> FundingChannel -> Bool # | |
data FundingPlan Source #
A funding plan in funding.json
Constructors
| FundingPlan | |
Instances
| FromJSON FundingPlan Source # | |
Defined in MathiasSM.Yaml.Website | |
| Show FundingPlan Source # | |
Defined in MathiasSM.Yaml.Website Methods showsPrec :: Int -> FundingPlan -> ShowS # show :: FundingPlan -> String # showList :: [FundingPlan] -> ShowS # | |
| Eq FundingPlan Source # | |
Defined in MathiasSM.Yaml.Website | |