[−][src]Struct gazetta::model::Source
The Source object reads and interprets a source directory.
The fields are intentionally public. Feel free to manually generate or modify this structure.
Fields
title: String
The website's title.
By default, this field is read from gazetta.yaml
.
root: PathBuf
The source root directory.
This is specified on construction.
origin: String
The website origin (http://mydomain.com:1234)
By default, this field is derived from the value of base
in gazetta.yaml
.
prefix: String
The directory under the origin at which this site will be hosted (e.g. "/").
By default, this field is derived from the value of base
in gazetta.yaml
.
entries: Vec<Entry<EntryMeta>>
The website content to be rendered.
By default, this list is populated with Entries generated from files with the basename index under the root directory excluding:
-
Files under directories named "static".
-
Files under
assets/
.
static_entries: Vec<StaticEntry>
The website content to be deployed as-is (no rendering).
By default, this list is populated with directories under the root directory named "static" excluding:
-
Directories under directories named "static".
-
Directories under
assets/
.
stylesheets: Vec<PathBuf>
The website stylesheets. When rendered, these will be concatinated into a single stylesheet.
By default, this list is populated by the files in is assets/stylesheets/
in
lexicographical order.
javascript: Vec<PathBuf>
The website javascript. When rendered, these will be concatenated into a single javascript file.
By default, this list is populated by the files in is assets/javascript/
in
lexicographical order.
icon: Option<PathBuf>
The path to the website's icon.
By default, this points to assets/icon.png
(if it exists).
well_known: Option<PathBuf>
The path to the .well-known
directory.
By default, this points to .well-known
.
meta: SourceMeta
Additional metadata read from gazetta.yaml
.
Methods
impl<SourceMeta, EntryMeta> Source<SourceMeta, EntryMeta> where
EntryMeta: Meta,
SourceMeta: Meta,
[src]
EntryMeta: Meta,
SourceMeta: Meta,
pub fn build_index(&self, entry: &Entry<EntryMeta>) -> Vec<&Entry<EntryMeta>>
[src]
Build an index for an entry.
This index includes all entries that "cc" this entry and all entries specified in this entry's index pattern.
pub fn new<P>(
root: P
) -> Result<Source<SourceMeta, EntryMeta>, AnnotatedError<SourceError>> where
P: AsRef<Path>,
[src]
root: P
) -> Result<Source<SourceMeta, EntryMeta>, AnnotatedError<SourceError>> where
P: AsRef<Path>,
Parse a source directory to create a new source.
pub fn reload(&mut self) -> Result<(), AnnotatedError<SourceError>>
[src]
Reload from the source directory.
Call this after changing source files.
Trait Implementations
impl<SourceMeta, EntryMeta> Clone for Source<SourceMeta, EntryMeta> where
EntryMeta: Clone + Meta,
SourceMeta: Clone + Meta,
[src]
EntryMeta: Clone + Meta,
SourceMeta: Clone + Meta,
fn clone(&self) -> Source<SourceMeta, EntryMeta>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<SourceMeta, EntryMeta> Debug for Source<SourceMeta, EntryMeta> where
EntryMeta: Debug + Meta,
SourceMeta: Debug + Meta,
[src]
EntryMeta: Debug + Meta,
SourceMeta: Debug + Meta,
Auto Trait Implementations
impl<SourceMeta, EntryMeta> Send for Source<SourceMeta, EntryMeta> where
EntryMeta: Send,
SourceMeta: Send,
EntryMeta: Send,
SourceMeta: Send,
impl<SourceMeta, EntryMeta> Unpin for Source<SourceMeta, EntryMeta> where
EntryMeta: Unpin,
SourceMeta: Unpin,
EntryMeta: Unpin,
SourceMeta: Unpin,
impl<SourceMeta, EntryMeta> Sync for Source<SourceMeta, EntryMeta> where
EntryMeta: Sync,
SourceMeta: Sync,
EntryMeta: Sync,
SourceMeta: Sync,
impl<SourceMeta, EntryMeta> RefUnwindSafe for Source<SourceMeta, EntryMeta> where
EntryMeta: RefUnwindSafe,
SourceMeta: RefUnwindSafe,
EntryMeta: RefUnwindSafe,
SourceMeta: RefUnwindSafe,
impl<SourceMeta, EntryMeta> UnwindSafe for Source<SourceMeta, EntryMeta> where
EntryMeta: UnwindSafe,
SourceMeta: UnwindSafe,
EntryMeta: UnwindSafe,
SourceMeta: UnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,