contemble 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99fe1246d4eccb72cd14d795ff92c7fa39280a8f03f3c818c9365bf5813079b9
4
- data.tar.gz: 16c7878a6a9e7539d92b8416183d8533cea6cace9d63e5e9822e8703e8e077ec
3
+ metadata.gz: d24648e5804b56f09d868bc242a5111a94e1d933105c358f3ed97663e1c1a954
4
+ data.tar.gz: 82a446c690a080657b2fb3c82e9bac37bb84aa1313c437eebb912bf7e82e3d61
5
5
  SHA512:
6
- metadata.gz: e8d15a8ec3cd72266ac8b5e0092e404f865d4f91b0b4ec9d245f66bb51c94c7271448d7dd90ba2c7e7cc40f38d74a70ebd504cd369269c1ebdd76e00f3823ec9
7
- data.tar.gz: 5f37a5a2585b0f7ef02fa6e0e593d18d58f36fd19f87952d36f278362e8958db0879eb33c94392896e462b2dc507024ec1ad25cfcc6cee561f3771ca68f1fa88
6
+ metadata.gz: 1c4332db2ccc94acda3db69fcf3819db356639fa5e49217e396a952045ece72f00a40483c084c2b0bba022bedf2a88b4b32676c51c015c68b4dacea2bc8f5388
7
+ data.tar.gz: 325fdc43ec857e1f5778d4e3868e0f07a20d5f231b8c1d3e5bd2e2de9f38ab9828a1a8a2529c0acb54d79617dd46d47354f86fc5dadd1976c21e32d675c39c2c
data/README.md CHANGED
@@ -42,6 +42,9 @@ post = client.posts.show(slug: "post-slug")
42
42
 
43
43
  # Get sitemap XML
44
44
  sitemap_xml = client.sitemap.xml
45
+
46
+ # Get article schema
47
+ article_schema = client.schema.article(slug: "post-slug")
45
48
  ```
46
49
 
47
50
  ### Available Data
@@ -87,6 +90,24 @@ end
87
90
 
88
91
  The sitemap URLs will use your configured base URL from your Contemble team settings. For large teams with many posts, this will automatically return a sitemap index that references multiple sitemap files.
89
92
 
93
+ ### Schema Usage
94
+
95
+ ```ruby
96
+ client = Contemble::Client.new(api_key: "your_api_key")
97
+
98
+ # Get JSON-LD schema for a specific article
99
+ schema = client.schema.article(slug: "my-post")
100
+
101
+ # Use in your Rails template
102
+ content_for :head do
103
+ content_tag :script, type: "application/ld+json" do
104
+ raw schema.to_json
105
+ end
106
+ end
107
+ ```
108
+
109
+ **Article Schema** returns JSON-LD structured data including headline, description, dates, images, and publisher information for SEO rich snippets.
110
+
90
111
  ## License
91
112
 
92
113
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -25,6 +25,10 @@ module Contemble
25
25
  @sitemap ||= Resources::Sitemap.new(self)
26
26
  end
27
27
 
28
+ def schema
29
+ @schema ||= Resources::Schema.new(self)
30
+ end
31
+
28
32
  def get(path, params = {})
29
33
  uri = URI("#{@base_url}#{path}")
30
34
  uri.query = URI.encode_www_form(params) unless params.empty?
@@ -53,5 +53,15 @@ module Contemble
53
53
  @client.get_xml("/sitemap.xml")
54
54
  end
55
55
  end
56
+
57
+ class Schema
58
+ def initialize(client)
59
+ @client = client
60
+ end
61
+
62
+ def article(slug:)
63
+ @client.get("/posts/#{slug}/schema")
64
+ end
65
+ end
56
66
  end
57
67
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Contemble
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contemble
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - contemble