Skip to main content

ephemeris_forge_github/api/model/
pages.rs

1use facet::Facet;
2
3use crate::{BuildType, SourcePath};
4
5/// The branch and folder a legacy site publishes.
6#[derive(Clone, Debug, Eq, Facet, PartialEq)]
7pub struct Source {
8    /// The published branch.
9    pub branch: String,
10    /// The published folder.
11    pub path: SourcePath,
12}
13
14/// A Pages site as GitHub reports it.
15#[derive(Clone, Debug, Eq, Facet, PartialEq)]
16pub struct Pages {
17    /// How the site is built. GitHub omits it for old legacy sites.
18    #[facet(default = BuildType::Legacy)]
19    pub build_type: BuildType,
20    /// The published branch and folder, when GitHub reports them.
21    #[facet(default)]
22    pub source: Option<Source>,
23    /// The custom domain.
24    #[facet(default)]
25    pub cname: Option<String>,
26    /// Whether HTTPS is required.
27    #[facet(default)]
28    pub https_enforced: bool,
29}