@thg-altitude/schemaorg 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
package/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # Schema.org
2
+ Reusable Schema.org for Astro
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from 'astro/config';
2
+
3
+ // https://astro.build/config
4
+ export default defineConfig({
5
+ output: 'server'
6
+ });
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import Product from './src/components/Product.astro'
2
+
3
+ export {
4
+ Product
5
+ }
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@thg-altitude/schemaorg",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "dev": "astro dev",
8
+ "build": "astro build",
9
+ "test": "echo \"Error: no test specified\" && exit 1"
10
+ },
11
+ "author": "Phillip Gourley",
12
+ "license": "ISC",
13
+ "dependencies": {
14
+ "astro": "^3.0.12"
15
+ }
16
+ }
@@ -0,0 +1,28 @@
1
+ ---
2
+ let schema = {
3
+ "@type": "Product",
4
+ "@context": "https://schema.org",
5
+ "@id": Astro.props.sku,
6
+ "sku": Astro.props.sku,
7
+ "name": Astro.props.name,
8
+ "description": Astro.props.description,
9
+ "image": Astro.props.image,
10
+ "brand": {
11
+ "@type": "Brand",
12
+ "name": Astro.props.brand,
13
+ "description": null
14
+ },
15
+ "offers": {
16
+ "@type": "Offer",
17
+ "price": Astro.props.price,
18
+ "priceCurrency": Astro.props.currency,
19
+ "url": Astro.props.url,
20
+ "itemCondition": "http://schema.org/NewCondition",
21
+ "sku": Astro.props.sku,
22
+ "availability": Astro.props.inStock ? "https://schema.org/InStock" : "https://schema.org/OutOfStock"
23
+ }
24
+ };
25
+ ---
26
+
27
+
28
+ <script type="application/ld+json" set:html={JSON.stringify(schema)}></script>
package/src/env.d.ts ADDED
@@ -0,0 +1 @@
1
+ /// <reference types="astro/client" />