package yocaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=fddf61500e828ac88d86ba982084cc817299302082a6e797b36787ff18235ec2
sha512=8b71a8cecd3e101df55eef0bba7a24d4dde9d66b5ecedd9f6d55834fcdc8d33fd875092ca73a398e1715664caee06cdc1bdb1b4da85bff0a687faac5c0445023
doc/yocaml/Yocaml/Archetype/Articles/index.html
Module Archetype.ArticlesSource
Transforms a regular page into an article index. Useful for building an index (or archive page). The page is read as a regular page which must be injected with a list of string * Article.t pairs (where the first element is an identifier which will be used to reconstruct the URL of the article, the way in which the identifier is converted into a URL is left to the user, for example, in the template).
Type
A type describing a list of articles.
Unlike the previous archetypes, reading an index consists of reading a regular page, so this module does not implement the DATA_READABLE interface. However, it is possible to inject it. The classic workflow consists of reading the page's metadata. Constructing the list of articles to be displayed in the index, converting the page into an article and then applying the corresponding template cascade.
sort_by_date ?increasing articles sorts items by date, if the increasing flag is set to true, items will be ordered from oldest to newest. Otherwise, they will be sorted from newest to oldest. By default, the flag is set to false.
from_page articles page transforms a regular page into an article index.
val fetch :
(module Required.DATA_PROVIDER) ->
?increasing:bool ->
?filter:((Path.t * Article.t) list -> (Path.t * Article.t) list) ->
?on:Eff.filesystem ->
where:(Path.t -> bool) ->
compute_link:(Path.t -> Path.t) ->
Path.t ->
(unit, (Path.t * Article.t) list) Task.tA helper task that transforms a directory path into a list of items, useful for building indexes. You can refer to the examples to see how this is used in a classic pipeline.
val compute_index :
(module Required.DATA_PROVIDER) ->
?increasing:bool ->
?filter:((Path.t * Article.t) list -> (Path.t * Article.t) list) ->
?on:Eff.filesystem ->
where:(Path.t -> bool) ->
compute_link:(Path.t -> Path.t) ->
Path.t ->
(Page.t, t) Task.tPipe fetch into a computed page. You can refer to the examples to see how this is used in a classic pipeline.
Converts a value of type t into a value of type Yocaml.Data.t.