Struct gazetta_core::model::Source [] [src]

pub struct Source<SourceMeta = (), EntryMeta = ()> where
    SourceMeta: Meta,
    EntryMeta: Meta
{ pub title: String, pub root: PathBuf, pub origin: String, pub prefix: String, pub entries: Vec<Entry<EntryMeta>>, pub static_entries: Vec<StaticEntry>, pub stylesheets: Vec<PathBuf>, pub javascript: Vec<PathBuf>, pub icon: Option<PathBuf>, pub meta: SourceMeta, }

The Source object reads and interprets a source directory.

The fields are intentionally public. Feel free to manually generate or modify this structure.

Fields

The website's title.

By default, this field is read from gazetta.yaml.

The source root directory.

This is specified on construction.

The website origin (http://mydomain.com:1234)

By default, this field is derived from the value of base in gazetta.yaml.

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.

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:

  1. Files under directories named "static".

  2. Files under assets/.

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:

  1. Directories under directories named "static".

  2. Directories under assets/.

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.

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.

The path website's icon.

By default, this points to assets/icon.png (if it exists).

Additional metadata read from gazetta.yaml.

Methods

impl<SourceMeta, EntryMeta> Source<SourceMeta, EntryMeta> where
    SourceMeta: Meta,
    EntryMeta: Meta
[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.

Parse a source directory to create a new source.

Reload from the source directory.

Call this after changing source files.

Trait Implementations

impl<SourceMeta: Debug, EntryMeta: Debug> Debug for Source<SourceMeta, EntryMeta> where
    SourceMeta: Meta,
    EntryMeta: Meta
[src]

Formats the value using the given formatter.

impl<SourceMeta: Clone, EntryMeta: Clone> Clone for Source<SourceMeta, EntryMeta> where
    SourceMeta: Meta,
    EntryMeta: Meta
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more