pub fn render_feed(
        &self,
        all_pages: Vec<&Page>,
        base_path: Option<&PathBuf>,
        lang: &str,
        additional_context_fn: impl Fn(Context) -> Context,
    ) -> Result<()> {
        ensure_directory_exists(&self.output_path)?;

        let feed = match feed::render_feed(self, all_pages, lang, base_path, additional_context_fn)?
        {
            Some(v) => v,
            None => return Ok(()),
        };
        let feed_filename = &self.config.feed_filename;

        if let Some(ref base) = base_path {
            let mut components = Vec::new();
            for component in base.components() {
                // TODO: avoid cloning the paths
                components.push(component.as_os_str().to_string_lossy().as_ref().to_string());
            }
            self.write_content(
                &components.iter().map(|x| x.as_ref()).collect::<Vec<_>>(),
                &feed_filename,
                feed,
                false,
            )?;
        } else {
            self.write_content(&[], &feed_filename, feed, false)?;
        }
        Ok(())
    }
/// Renders a feed for the given path and at the given path
/// If both arguments are `None`, it will render only the feed for the whole
/// site at the root folder.
Renders a feed for the given path and at the given path
If both arguments are `None`, it will render only the feed for the whole
site at the root folder.
Renders a feed for the given path and at the given path If both arguments are ` None ` it will render only the feed for the whole site at the root folder .
pub fn render_feed(
        &self,
        all_pages: Vec<&Page>,
        base_path: Option<&PathBuf>,
        lang: &str,
        additional_context_fn: impl Fn(Context) -> Context,
    ) -> Result<()> {
        ensure_directory_exists(&self.output_path)?;
        let feed = match feed::render_feed(self, all_pages, lang, base_path, additional_context_fn)?
        {
            Some(v) => v,
            None => return Ok(()),
        };
        let feed_filename = &self.config.feed_filename;
        if let Some(ref base) = base_path {
            let mut components = Vec::new();
            for component in base.components() {
                // TODO: avoid cloning the paths
                components.push(component.as_os_str().to_string_lossy().as_ref().to_string());
            }
            self.write_content(
                &components.iter().map(|x| x.as_ref()).collect::<Vec<_>>(),
                &feed_filename,
                feed,
                false,
            )?;
        } else {
            self.write_content(&[], &feed_filename, feed, false)?;
        }
        Ok(())
    }
pub fn render_feed ( & self , all_pages : Vec < & Page > , base_path : Option < & PathBuf > , lang : & str , additional_context_fn : impl Fn ( Context ) -> Context , ) -> Result < ( ) > { ensure_directory_exists ( & self . output_path ) ? ; let feed = match feed :: render_feed ( self , all_pages , lang , base_path , additional_context_fn ) ? { Some ( v ) => v , None => return Ok ( ( ) ) , } ; let feed_filename = & self . config . feed_filename ; if let Some ( ref base ) = base_path { let mut components = Vec :: new ( ) ; for component in base . components ( ) { // TODO: avoid cloning the paths components . push ( component . as_os_str ( ) . to_string_lossy ( ) . as_ref ( ) . to_string ( ) ) ; } self . write_content ( & components . iter ( ) . map ( | x | x . as_ref ( ) ) . collect :: < Vec < _ > > ( ) , & feed_filename , feed , false , ) ? ; } else { self . write_content ( & [ ] , & feed_filename , feed , false ) ? ; } Ok ( ( ) ) }
Renders a feed for the given path and at the given path
If both arguments are `None`, it will render only the feed for the whole
site at the root folder.
Renders a feed for the given path and at the given path If both arguments are ` None ` it will render only the feed for the whole site at the root folder .
&self
all_pages
Vec<&Page>
base_path
Option<&PathBuf>
lang
&str
additional_context_fn
impl Fn(Context) -> Context
&self
all_pages
Vec<&Page>
base_path
Option<&PathBuf>
lang
&str
additional_context_fn
impl Fn(Context) -> Context