package yocaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=cfc7c139116d6881b1d0bc7af706b8f8ceb6cd1f5be67d621944388731ab9d6c
sha512=9d1a075a6a9d3c8bae9ae4e389ada0a5b7818b3993ef9dd45af65070434b86bb56c349db5d0149134d449495415c28e2bfca993a20d5e4b7d16263f7231334c3
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.