Permalink
Browse files

Fix last commit, due to merge conflicts

svn path=/trunk/lb/; revision=102470
  • Loading branch information...
1 parent 4044ba9 commit 995d8415793742a8bede7df9ec1beacb7aa5bb84 @migueldeicaza migueldeicaza committed May 4, 2008
Showing with 21 additions and 8 deletions.
  1. +16 −7 lb.cs
  2. +4 −0 log-style.css
  3. +1 −1 template
View
23 lb.cs
@@ -322,9 +322,10 @@ class Blog {
string entry_template;
string analytics = "";
string comments = "";
+ string archive;
Hashtable category_entries = new Hashtable ();
- ArrayList entries = new ArrayList ();
+ List<DayEntry> entries = new List<DayEntry> ();
public int Entries {
get {
@@ -350,8 +351,15 @@ public Blog (Config config)
if (config.CommentsStub != null && config.CommentsStub.Length > 0){
comments = File.OpenText (config.CommentsStub).ReadToEnd ();
}
+
}
+ void GenerateArchiveGadget ()
+ {
+ //var x = from be in entries
+ //group be by be.
+ }
+
void LoadDirectory (DirectoryInfo dir)
{
if (dir.Name.EndsWith ("drafts"))
@@ -394,7 +402,7 @@ void AddCategory (Hashtable hash, DayEntry day)
static DateTime LastDate = new DateTime (2004, 5, 19, 0, 0, 0);
- void Render (TextWriter o, IList entries, int idx, string blog_base, bool include_daily_anchor, bool include_navigation)
+ void Render (TextWriter o, IList entries, int idx, string blog_base, bool include_daily_anchor, bool single_entry)
{
DayEntry d = (DayEntry) entries [idx];
@@ -405,7 +413,8 @@ void Render (TextWriter o, IList entries, int idx, string blog_base, bool includ
string entry_specific = "";
string navigation = "";
- if (include_navigation){
+
+ if (single_entry){
navigation = GetEntryNavigation (entries, idx, blog_base);
if (config.EntrySpecific != null && config.EntrySpecific != String.Empty)
entry_specific = File.OpenText (config.EntrySpecific).ReadToEnd ();
@@ -416,7 +425,7 @@ void Render (TextWriter o, IList entries, int idx, string blog_base, bool includ
substitutions.Add ("@ENTRY_NAVIGATION@", navigation);
substitutions.Add ("@ENTRY_SPECIFIC@", entry_specific);
- FillEntrySubstitutions (substitutions, d, blog_base);
+ FillEntrySubstitutions (substitutions, d, blog_base, single_entry);
StringWriter body = new StringWriter (new StringBuilder (d.Body.Length));
Translate (d.Body, body, substitutions);
@@ -425,7 +434,7 @@ void Render (TextWriter o, IList entries, int idx, string blog_base, bool includ
Translate (entry_template, o, substitutions);
}
- void FillEntrySubstitutions (Hashtable substitutions, DayEntry d, string blog_base)
+ void FillEntrySubstitutions (Hashtable substitutions, DayEntry d, string blog_base, bool single_entry)
{
string category_paths = GetCategoryPaths (d, blog_base);
string entry_path = LB.GetEntryPath (blog_base, d);
@@ -444,7 +453,7 @@ void FillEntrySubstitutions (Hashtable substitutions, DayEntry d, string blog_ba
substitutions.Add ("@BLOGWEBDIR@", config.BlogWebDirectory);
substitutions.Add ("@ENTRY_URL_PERMALINK@", Path.Combine (config.BlogWebDirectory, d.PermaLink));
- if (d.Comments && include_navigation){
+ if (d.Comments && single_entry){
StringWriter rendered_comment = new StringWriter (new StringBuilder (comments.Length));
Translate (comments, rendered_comment, substitutions);
substitutions.Add ("@COMMENTS@", rendered_comment.ToString ());
@@ -757,7 +766,7 @@ public void RenderRSS (RssVersion version, string output, IList entries, int sta
DayEntry d = (DayEntry) entries [idx];
Hashtable substitutions = new Hashtable ();
- FillEntrySubstitutions (substitutions, d, config.BlogWebDirectory);
+ FillEntrySubstitutions (substitutions, d, config.BlogWebDirectory, false);
StringWriter description = new StringWriter (new StringBuilder (d.Body.Length));
Translate (d.Body, description, substitutions);
View
@@ -8,6 +8,10 @@ h1 {
background: #666666;
}
+h1 a:visited {
+ color: #efefef
+}
+
h1, h2, h3, h4, h5, h6 {
font-family: Verdana,sans-serif;
font-weight: bold;
View
@@ -16,7 +16,7 @@ function startup()
<body onload='startup ();'>
-<h1>@DESCRIPTION@</h1>
+<h1><a href="@BLOGWEBDIR@">@DESCRIPTION@</a></h1>
<div id='sidebar'>
<h2>RSS</h2>

0 comments on commit 995d841

Please sign in to comment.