0.0.1-alpha.5
This commit is contained in:
53
crates/knowledge-web-lib/src/site.rs
Normal file
53
crates/knowledge-web-lib/src/site.rs
Normal file
@@ -0,0 +1,53 @@
|
||||
// file: crates/knowledge-web-lib/src/site.rs
|
||||
// version: 1
|
||||
|
||||
//! Public facade identities used by the shared Web runtime.
|
||||
|
||||
/// Public Knowledge facade served by one launcher.
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub enum ServerSite {
|
||||
/// Normative PGR facade.
|
||||
Pgr,
|
||||
/// Procedural HOWTOs facade.
|
||||
Howtos,
|
||||
/// Contextual snippets facade.
|
||||
Snippets,
|
||||
}
|
||||
|
||||
impl crate::ServerSite {
|
||||
/// Return the domain content family associated with this facade.
|
||||
pub fn content_family(self) -> knowledge_domain_lib::ContentFamily {
|
||||
match self {
|
||||
crate::ServerSite::Pgr => return knowledge_domain_lib::ContentFamily::Pgr,
|
||||
crate::ServerSite::Howtos => return knowledge_domain_lib::ContentFamily::Howto,
|
||||
crate::ServerSite::Snippets => return knowledge_domain_lib::ContentFamily::Snippet,
|
||||
}
|
||||
}
|
||||
|
||||
/// Return the page title used by the foundation renderer.
|
||||
pub fn page_title(self) -> &'static str {
|
||||
match self {
|
||||
crate::ServerSite::Pgr => return "SaseDev Knowledge — PGR",
|
||||
crate::ServerSite::Howtos => return "SaseDev Knowledge — HOWTOs",
|
||||
crate::ServerSite::Snippets => return "SaseDev Knowledge — Snippets",
|
||||
}
|
||||
}
|
||||
|
||||
/// Return the main heading used by the foundation renderer.
|
||||
pub fn heading(self) -> &'static str {
|
||||
match self {
|
||||
crate::ServerSite::Pgr => return "Project Governance Rules",
|
||||
crate::ServerSite::Howtos => return "HOWTOs",
|
||||
crate::ServerSite::Snippets => return "Snippets",
|
||||
}
|
||||
}
|
||||
|
||||
/// Return the short explanatory lead used by the foundation renderer.
|
||||
pub fn lead(self) -> &'static str {
|
||||
match self {
|
||||
crate::ServerSite::Pgr => return "Connaissance normative de gouvernance.",
|
||||
crate::ServerSite::Howtos => return "Guides procéduraux et explicatifs.",
|
||||
crate::ServerSite::Snippets => return "Fragments courts et contextualisés.",
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user