mirror of
https://github.com/lubuntu-team/blog.git
synced 2025-04-16 01:41:07 +00:00
Add a function for tags.
This commit is contained in:
parent
b3b30bb0b4
commit
7000fad4d9
@ -1,4 +1,4 @@
|
|||||||
---
|
---
|
||||||
title: This Week in Lubuntu Development POUND1
|
title: This Week in Lubuntu Development POUND1
|
||||||
slug: this-week-in-lubuntu-development-1
|
slug: this-week-in-lubuntu-development-1
|
||||||
type: newsletter
|
type: ["newsletter"]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
---
|
---
|
||||||
title: This Week in Lubuntu Development POUND2
|
title: This Week in Lubuntu Development POUND2
|
||||||
slug: this-week-in-lubuntu-development-2
|
slug: this-week-in-lubuntu-development-2
|
||||||
type: newsletter
|
type: ["newsletter"]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
---
|
---
|
||||||
title: This Week in Lubuntu Development POUND3
|
title: This Week in Lubuntu Development POUND3
|
||||||
slug: this-week-in-lubuntu-development-3
|
slug: this-week-in-lubuntu-development-3
|
||||||
type: newsletter
|
type: ["newsletter"]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
---
|
---
|
||||||
title: This Week in Lubuntu Development POUND4
|
title: This Week in Lubuntu Development POUND4
|
||||||
slug: this-week-in-lubuntu-development-4
|
slug: this-week-in-lubuntu-development-4
|
||||||
type: newsletter
|
type: ["newsletter"]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
---
|
---
|
||||||
title: This Week in Lubuntu Development POUND5
|
title: This Week in Lubuntu Development POUND5
|
||||||
slug: this-week-in-lubuntu-development-5
|
slug: this-week-in-lubuntu-development-5
|
||||||
type: newsletter
|
type: ["newsletter"]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
---
|
---
|
||||||
title: This Week in Lubuntu Development POUND6
|
title: This Week in Lubuntu Development POUND6
|
||||||
slug: this-week-in-lubuntu-development-6
|
slug: this-week-in-lubuntu-development-6
|
||||||
type: newsletter
|
type: ["newsletter"]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
---
|
---
|
||||||
title: This Week in Lubuntu Development POUND7
|
title: This Week in Lubuntu Development POUND7
|
||||||
slug: this-week-in-lubuntu-development-7
|
slug: this-week-in-lubuntu-development-7
|
||||||
type: newsletter
|
type: ["newsletter"]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: This Week in Lubuntu Development POUND8
|
title: This Week in Lubuntu Development POUND8
|
||||||
slug: this-week-in-lubuntu-development-8
|
slug: this-week-in-lubuntu-development-8
|
||||||
type: newsletter
|
type: ["newsletter"]
|
||||||
l10n: ["es"]
|
l10n: ["es"]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
---
|
---
|
||||||
title: Lubuntu 16.04.5 has been released!
|
title: Lubuntu 16.04.5 has been released!
|
||||||
slug: xenial-5-released
|
slug: xenial-5-released
|
||||||
type: release
|
type: ["release", "final"]
|
||||||
|
10
update-post
10
update-post
@ -22,6 +22,7 @@ from os import path
|
|||||||
from markdown import markdown
|
from markdown import markdown
|
||||||
from wordpress_xmlrpc import Client
|
from wordpress_xmlrpc import Client
|
||||||
from wordpress_xmlrpc.methods import posts
|
from wordpress_xmlrpc.methods import posts
|
||||||
|
from wordpress_xmlrpc.methods import taxonomies
|
||||||
|
|
||||||
def getdirectories(args):
|
def getdirectories(args):
|
||||||
directories = []
|
directories = []
|
||||||
@ -70,6 +71,15 @@ def updatepost(infoyaml, md, post=None, title=None, slug=None):
|
|||||||
post.title = title
|
post.title = title
|
||||||
post.content = md
|
post.content = md
|
||||||
post.post_status = "publish"
|
post.post_status = "publish"
|
||||||
|
|
||||||
|
tags = []
|
||||||
|
for category in wp.call(taxonomies.GetTerms('category')):
|
||||||
|
for posttype in infoyaml["type"]:
|
||||||
|
if category.name == posttype:
|
||||||
|
tags.append(category)
|
||||||
|
|
||||||
|
post.terms = tags
|
||||||
|
|
||||||
wp.call(posts.EditPost(post.id, post))
|
wp.call(posts.EditPost(post.id, post))
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user