Skip to content

Commit

Permalink
🐛 Add g: prefix in title and link of item
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasgusson committed Oct 16, 2023
1 parent 16c4560 commit 8eae06e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ XML generated by the code above:
<description>An example item from the feed</description>
<item>
<g:id>DB_1</g:id>
<title>Dog Bowl In Blue</title>
<g:title>Dog Bowl In Blue</g:title>
<g:description>Solid plastic Dog Bowl in marine blue color</g:description>
<link>http://www.example.com/bowls/db-1.html</link>
<g:link>http://www.example.com/bowls/db-1.html</g:link>
<g:image_link>http://images.example.com/DB_1.png</g:image_link>
<g:availability>in_stock</g:availability>
<g:price>9.99 GBP</g:price>
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "google-merchant-feed",
"version": "0.0.2",
"version": "0.0.3",
"description": "A simple library to generate Google Merchant XML Feed",
"author": "Douglas Gusson",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions src/xml-properties-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export type XmlPropertiesMapNodeItems = XmlPropertiesMapNode["items"];

export const xmlPropertiesMap: Record<keyof Product, XmlPropertiesMapNode> = {
id: { xmlName: "g:id" },
title: { xmlName: "title" },
title: { xmlName: "g:title" },
description: { xmlName: "g:description" },
link: { xmlName: "link" },
link: { xmlName: "g:link" },
imageLink: { xmlName: "g:image_link" },
mobileLink: { xmlName: "g:mobile_link" },
additionalImageLinks: {
Expand Down
2 changes: 1 addition & 1 deletion test/feed-builder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe("FeedBuilder", () => {
expect(xml).toContain("<link>https://example.com/feed</link>");
expect(xml).toContain("<description>My Feed Description</description>");
expect(xml).toContain("<g:id>123</g:id>");
expect(xml).toContain("<title>My Product</title>");
expect(xml).toContain("<g:title>My Product</g:title>");
});
});
});

0 comments on commit 8eae06e

Please sign in to comment.