RenderArchiveRss() public method

public RenderArchiveRss ( RssVersion version, string output, int end ) : void
version RssVersion
output string
end int
return void
コード例 #1
0
ファイル: lb.cs プロジェクト: mono/lb
    static void Main(string[] args)
    {
        var basicConfig = new Config ();
        if (!basicConfig.Parse (args))
            return;

        config = (Config) new XmlSerializer (typeof (Config)).Deserialize (new XmlTextReader (basicConfig.ConfigFile));

        if (args.Length > 1)
            config.Prefix = args [1];

        if (config.BlogImageBasedir == null || config.BlogImageBasedir == "")
            config.BlogImageBasedir = config.BlogWebDirectory;
        if (config.Prefix == null || config.Prefix == "")
            config.Prefix = Environment.CurrentDirectory;
        if (config.BlogTemplate == null || config.BlogTemplate == "")
            config.BlogTemplate = "template";
        if (config.EntryTemplate == null || config.EntryTemplate == "")
            config.EntryTemplate = "entry";

        if (!config.Parse (args))
            return;

        string template = File.OpenText (config.BlogTemplate).ReadToEnd ();

        Blog b = new Blog (config, template);

        //
        // Renders the main page (index.html) and the various pageNN.html
        //
        for (int start = 0; start < b.Entries; start += Config.EntriesPerPage){
            string output = GetOutputFileAtOffset (start);

            b.RenderHtml (Path.Combine (config.Prefix, output), start, start + Config.EntriesPerPage, "", true);
        }

        //
        // Renders the year/month dinguses
        //

        //
        // Legacy render: all.html
        //
        b.RenderHtml (Path.Combine (config.Prefix, "all.html"), 0, b.Entries, "", false);

        //
        // Renders each individual blog entry into the archive
        //
        b.RenderArchive ();

        //
        // The RSS feed
        //
        b.RenderRSS (Path.Combine (config.Prefix, config.RSSFileName), 0, 30);
        b.RenderArchiveRss (RssVersion.RSS20, config.RSSFileName + ".rss2", 30);

        if (File.Exists ("log-style.css")) {
            File.Copy ("log-style.css", "texts/log-style.css", true);
            File.Copy ("log-style.css", Path.Combine (config.Prefix, "log-style.css"), true);
        }
    }
コード例 #2
0
    static void Main(string[] args)
    {
        var basicConfig = new Config();

        if (!basicConfig.Parse(args))
        {
            return;
        }

        config = (Config) new XmlSerializer(typeof(Config)).Deserialize(new XmlTextReader(basicConfig.ConfigFile));

        if (args.Length > 1)
        {
            config.Prefix = args [1];
        }

        if (config.BlogImageBasedir == null || config.BlogImageBasedir == "")
        {
            config.BlogImageBasedir = config.BlogWebDirectory;
        }
        if (config.Prefix == null || config.Prefix == "")
        {
            config.Prefix = Environment.CurrentDirectory;
        }
        if (config.BlogTemplate == null || config.BlogTemplate == "")
        {
            config.BlogTemplate = "template";
        }
        if (config.EntryTemplate == null || config.EntryTemplate == "")
        {
            config.EntryTemplate = "entry";
        }

        if (!config.Parse(args))
        {
            return;
        }

        string template = File.OpenText(config.BlogTemplate).ReadToEnd();

        Blog b = new Blog(config, template);

        //
        // Renders the main page (index.html) and the various pageNN.html
        //
        for (int start = 0; start < b.Entries; start += Config.EntriesPerPage)
        {
            string output = GetOutputFileAtOffset(start);

            b.RenderHtml(Path.Combine(config.Prefix, output), start, start + Config.EntriesPerPage, "", true);
        }

        //
        // Renders the year/month dinguses
        //

        //
        // Legacy render: all.html
        //
        b.RenderHtml(Path.Combine(config.Prefix, "all.html"), 0, b.Entries, "", false);

        //
        // Renders each individual blog entry into the archive
        //
        b.RenderArchive();

        //
        // The RSS feed
        //
        b.RenderRSS(Path.Combine(config.Prefix, config.RSSFileName), 0, 30);
        b.RenderArchiveRss(RssVersion.RSS20, config.RSSFileName + ".rss2", 30);

        if (File.Exists("log-style.css"))
        {
            File.Copy("log-style.css", "texts/log-style.css", true);
            File.Copy("log-style.css", Path.Combine(config.Prefix, "log-style.css"), true);
        }
    }