Browse Source

Sticking to search

Categories, tags, metadata key-value pairs - none of them work on
wordpress.com
Swaroop C H 12 years ago
parent
commit
05e7f6239e
2 changed files with 3 additions and 7 deletions
  1. 1 0
      config.json
  2. 2 7
      fabfile.py

+ 1 - 0
config.json

@@ -1,6 +1,7 @@
 {
 {
   "SHORT_PROJECT_NAME": "python",
   "SHORT_PROJECT_NAME": "python",
   "FULL_PROJECT_NAME": "byte_of_python",
   "FULL_PROJECT_NAME": "byte_of_python",
+  "BOOK_PAGES_SEARCH": "python_en",
   "MARKDOWN_FILES": [
   "MARKDOWN_FILES": [
     {
     {
       "file": "01-frontpage.md",
       "file": "01-frontpage.md",

+ 2 - 7
fabfile.py

@@ -453,8 +453,7 @@ def _wordpress_get_pages():
                                         "type": "page",
                                         "type": "page",
                                         "status": "publish",
                                         "status": "publish",
                                         "number": number,
                                         "number": number,
-                                        # TODO Use a proper category instead
-                                        "search": "python_en",
+                                        "search": CONFIG["BOOK_PAGES_SEARCH"],
                                         "offset": offset},
                                         "offset": offset},
                                 headers=_wordpress_headers())
                                 headers=_wordpress_headers())
         response.raise_for_status()
         response.raise_for_status()
@@ -479,8 +478,6 @@ def wordpress_new_page(slug, title, content):
                                    "content": content,
                                    "content": content,
                                    "parent": WORDPRESS_PARENT_PAGE_ID,
                                    "parent": WORDPRESS_PARENT_PAGE_ID,
                                    "type": "page",
                                    "type": "page",
-                                   # TODO Use a proper category instead
-                                   "tags": [CONFIG["FULL_PROJECT_NAME"]],
                                    "comments_open": False,
                                    "comments_open": False,
                                    "pings_open": False,
                                    "pings_open": False,
                                    "publicize": False},
                                    "publicize": False},
@@ -497,9 +494,7 @@ def wordpress_edit_page(post_id, title, content):
 
 
     response = requests.post(url,
     response = requests.post(url,
                              data={"title": title,
                              data={"title": title,
-                                   "content": content,
-                                   # TODO Use a proper category instead
-                                   "tags": [CONFIG["FULL_PROJECT_NAME"]]},
+                                   "content": content},
                              headers=_wordpress_headers())
                              headers=_wordpress_headers())
     response.raise_for_status()
     response.raise_for_status()
     return response.json()
     return response.json()