1. Marcin Kasperski
  2. serendipity2blogofile

Commits

Marcin Kasperski  committed add4412

Adding URL to permalink, looks like blogofile wants it

  • Participants
  • Parent commits cdf4c90
  • Branches default

Comments (0)

Files changed (1)

File serendipity2blogofile.py

View file
                 "I'm not going to overwrite it." % created_file
             sys.exit(1)
 
+    baseURL = get_config_item("baseURL")
+
     for entry in get_blog_posts():
         yaml_data = {
             # Standard blogofile fields
             "updated": entry.last_modification_time().strftime("%Y/%m/%d %H:%M:%S"),
             "categories": entry.category(),
             "tags": ", ".join(entry.tags()),
-            "permalink": entry.permalink(),
+            "permalink": "%s/%s" % (baseURL, entry.permalink()),
             "guid": entry.id,
             "author": entry.author.realname,
             "draft": entry.isdraft and True or False,
             # source, yaml, content, filename - reserved
 
             # Custom fields
-            "author_email": entry.author.email,
+            #"author_email": entry.author.email,
             "meta_description": entry.meta_description(),
             "meta_keywords": entry.meta_keywords(),
             }
         if not yaml_data["draft"]:
             del yaml_data["draft"]
 
+        # Removing unnecessary newlines
+        for trial_key in ["meta_description", "meta_keywords"]:
+            if trial_key in yaml_data:
+                yaml_data[trial_key] = yaml_data[trial_key].replace("\n", " ")
+
         lead_text = entry.body
         remaining_text = entry.extended
 
 
 blog.description = "%s"
 
-""" % (get_config_item("baseURL"),
+""" % (baseURL,
        get_config_item("blogTitle"),      
        get_config_item("blogDescription")))