Skip to content

Commit 0bb8011

Browse files
committed
fix: dropped the suffix _taxonomy from the metadata
1 parent f93a4f8 commit 0bb8011

File tree

3 files changed

+41
-41
lines changed

3 files changed

+41
-41
lines changed

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -91,28 +91,28 @@ A skaffold frontmatter blog is created, and you can start writing in the index.m
9191
## frontmatter properties
9292
You can set the following properties in the frontmatter:
9393

94-
| Name | description |
95-
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
96-
| title | of the blog |
97-
| subtitle | of the blog, used in the og.image |
98-
| focus-keywords | the SEO focus keywords
99-
| excerpt | excerpt of the blog |
100-
| author | display name of the author in Wordpress |
101-
| email | email address of the author, used to lookup profile picture on gravatar.com |
102-
| author-id | Wordpress author slug: used to select the appropriate user if multiple users with the same name exists in WP and we cannot read the email address |
103-
| categories | list of wordpress categories for this blog |
104-
| slug | slug of the blog |
105-
| date | on which the blog should be published ISO timestamp format |
106-
| status | draft or publish. if publish, the blog will be published on the `date` |
107-
| canonical | url of the blog, to be used in cross posts |
108-
| image | the banner image of the blog |
109-
| og.image | the open graph image of the blog, used in links from social media |
110-
| og.description | the open graph description of the blog, used in links from social media |
111-
| guid | the physical URL of the blog. Written by wp-md on upload and download |
112-
| brand | xebia.com or xebia.com. defaults to xebia.com |
113-
| industry_taxonomy | zero or more of banking-and-financial-services, energy-utilities, healthcare-life-sciences, insurance, isv-tech, non-profit, private-equity, public-sector, retail-and-consumer-goods, telecom-media |
114-
| partners_taxonomy | zero or more of modernization-experience-based-acceleration-modax, genai-on-google-cloud, monday, cloud-workplace-solutions, cloud-workplace, google-workplace-tools, workplace-security, workplace-optimization, microsoft-library, developer-productivity-with-github-copilot |
115-
| capabilities | zero or more of agile-transformation, applied-and-genai, cloud, data-analytics, devops-sre, digital-product-management, intelligent-automation, it-strategy, platform-engineering, product-platform-development |
94+
| Name | description |
95+
|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
96+
| title | of the blog |
97+
| subtitle | of the blog, used in the og.image |
98+
| focus-keywords | the SEO focus keywords
99+
| excerpt | excerpt of the blog |
100+
| author | display name of the author in Wordpress |
101+
| email | email address of the author, used to lookup profile picture on gravatar.com |
102+
| author-id | Wordpress author slug: used to select the appropriate user if multiple users with the same name exists in WP and we cannot read the email address |
103+
| categories | list of wordpress categories for this blog |
104+
| slug | slug of the blog |
105+
| date | on which the blog should be published ISO timestamp format |
106+
| status | draft or publish. if publish, the blog will be published on the `date` |
107+
| canonical | url of the blog, to be used in cross posts |
108+
| image | the banner image of the blog |
109+
| og.image | the open graph image of the blog, used in links from social media |
110+
| og.description | the open graph description of the blog, used in links from social media |
111+
| guid | the physical URL of the blog. Written by wp-md on upload and download |
112+
| brand | xebia.com or xebia.com. defaults to xebia.com |
113+
| industries | zero or more of banking-and-financial-services, energy-utilities, healthcare-life-sciences, insurance, isv-tech, non-profit, private-equity, public-sector, retail-and-consumer-goods, telecom-media |
114+
| partners | zero or more of modernization-experience-based-acceleration-modax, genai-on-google-cloud, monday, cloud-workplace-solutions, cloud-workplace, google-workplace-tools, workplace-security, workplace-optimization, microsoft-library, developer-productivity-with-github-copilot |
115+
| capabilities | zero or more of agile-transformation, applied-and-genai, cloud, data-analytics, devops-sre, digital-product-management, intelligent-automation, it-strategy, platform-engineering, product-platform-development |
116116

117117
## adding images
118118
To add an image to your blog, add the images in the ./images subdirectory and add a relative reference in markdown. For instance:

src/wordpress_markdown_blog_loader/api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -616,22 +616,22 @@ def get_category_id_by_name(self, category: str) -> str:
616616
)
617617
)
618618

619-
def get_industry_taxonomy_by_name(self, slug: str) -> str:
619+
def get_industry_by_name(self, slug: str) -> str:
620620
if slug in self.industries_taxonomy:
621621
return self.industries_taxonomy[slug]
622622

623623
raise ValueError(
624-
"invalid industries_taxonomy '{}' try one of\n {}".format(
624+
"invalid industry '{}' try one of\n {}".format(
625625
slug, ",\n ".join(self.industries_taxonomy.keys())
626626
)
627627
)
628628

629-
def get_partners_taxonomy_by_name(self, slug: str) -> str:
629+
def get_partner_by_name(self, slug: str) -> str:
630630
if slug in self.partners_taxonomy:
631631
return self.partners_taxonomy[slug]
632632

633633
raise ValueError(
634-
"invalid partners_taxonomy '{}' try one of\n {}".format(
634+
"invalid partner '{}' try one of\n {}".format(
635635
slug, ",\n ".join(self.partners_taxonomy.keys())
636636
)
637637
)
@@ -641,7 +641,7 @@ def get_capabilities_by_name(self, slug: str) -> str:
641641
return self.capabilities[slug]
642642

643643
raise ValueError(
644-
"invalid capabilities '{}' try one of\n {}".format(
644+
"invalid capability '{}' try one of\n {}".format(
645645
slug, ",\n ".join(self.capabilities.keys())
646646
)
647647
)

src/wordpress_markdown_blog_loader/blog.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -198,20 +198,20 @@ def categories(self, categories: list[str]):
198198
self.blog.metadata["categories"] = categories
199199

200200
@property
201-
def industry_taxonomy(self):
202-
return self.blog.metadata.get("industry_taxonomy", [])
201+
def industries(self):
202+
return self.blog.metadata.get("industries", [])
203203

204-
@industry_taxonomy.setter
205-
def industry_taxonomy(self, slugs: list[str]):
206-
self.blog.metadata["industry_taxonomy"] = slugs
204+
@industries.setter
205+
def industries(self, slugs: list[str]):
206+
self.blog.metadata["industries"] = slugs
207207

208208
@property
209-
def partners_taxonomy(self):
210-
return self.blog.metadata.get("partners_taxonomy", [])
209+
def partners(self):
210+
return self.blog.metadata.get("partners", [])
211211

212-
@partners_taxonomy.setter
213-
def partners_taxonomy(self, slugs: list[str]):
214-
self.blog.metadata["partners_taxonomy"] = slugs
212+
@partners.setter
213+
def partners(self, slugs: list[str]):
214+
self.blog.metadata["partners"] = slugs
215215

216216
@property
217217
def capabilities(self) -> list[str]:
@@ -400,8 +400,8 @@ def to_wordpress(self, wp: Wordpress) -> dict:
400400
"categories": [wp.get_category_id_by_name(c) for c in self.categories],
401401
"tags": [wp.get_tag_id_by_name(c) for c in self.tags],
402402
"acf": {"show_header_image": bool(self.image)},
403-
"industry_taxonomy": [wp.get_industry_taxonomy_by_name(c) for c in self.industry_taxonomy],
404-
"partners_taxonomy": [wp.get_partners_taxonomy_by_name(c) for c in self.partners_taxonomy],
403+
"industries_taxonomy": [wp.get_industry_by_name(c) for c in self.industries],
404+
"partners_taxonomy": [wp.get_partner_by_name(c) for c in self.partners],
405405
"capabilities": [wp.get_capabilities_by_name(c) for c in self.capabilities],
406406
}
407407
if self.permalink_template:
@@ -448,8 +448,8 @@ def from_wordpress(
448448
blog.author = wordpress.get_user_by_id(post.author).name
449449
blog.guid = post.guid
450450
blog.categories = [wordpress.categories_by_id[c] for c in post.categories]
451-
blog.industry_taxonomy = [wordpress.industries_taxonomy_by_id for c in post.industry_taxonomy]
452-
blog.partners_taxonomy = [wordpress.partners_taxonomy_by_id for c in post.partners_taxonomy]
451+
blog.industries = [wordpress.industries_taxonomy_by_id for c in post.industries_taxonomy]
452+
blog.partners = [wordpress.partners_taxonomy_by_id for c in post.partners_taxonomy]
453453
blog.capabilities = [wordpress.capabilities_by_id for c in post.capabilities]
454454
if post.tags:
455455
blog.tags = [wordpress.tags_by_id[t] for t in post.tags]

0 commit comments

Comments
 (0)