Skip to content

Commit b0a0a57

Browse files
committed
Improve README and TECH_NOTES documentation
Rewrite README with structured installation, configuration steps, publishing levels, API endpoints, and links to external docs. Rewrite TECH_NOTES with architecture overview, entity types, services, sync flow, rendering pipeline, smart components, caching strategy, and permissions reference.
1 parent f3148aa commit b0a0a57

File tree

2 files changed

+413
-51
lines changed

2 files changed

+413
-51
lines changed

README.md

Lines changed: 126 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,147 @@
11
# Pantheon Content Publisher for Drupal
22

3-
The Pantheon Content Publisher module allows you to integrate content created in Google Docs to your Drupal website.
3+
A Drupal module that integrates [Pantheon Content Publisher](https://content.pantheon.io) with your Drupal site, enabling content teams to publish directly from Google Docs to Drupal.
4+
5+
## How It Works
6+
7+
1. Content authors write in Google Docs using the Content Publisher add-on
8+
2. On publish, Content Publisher sends the content to its API
9+
3. A webhook notifies your Drupal site of the update
10+
4. The module fetches the content via GraphQL, creates Drupal entities, and indexes them via Search API
11+
5. Content is viewable at configurable Drupal paths with full Views integration
12+
13+
The module also supports **Smart Components** -- reusable content blocks with custom fields that site builders define in Drupal and content authors insert from the Content Publisher editor. See [TECH_NOTES.md](TECH_NOTES.md#smart-components) for details.
414

5-
Refer the [documentation](https://pcc.pantheon.io/pantheon-content-publisher-for-drupal) for more information about installation and configuration of module.
615
## Requirements
716

8-
- A Google Workspace Account
9-
- Drupal 10+ site with PHP 8.2+
10-
- For sites hosted on Pantheon, enable [Pantheon Search](https://docs.pantheon.io/solr) and configure the search version in your `pantheon.yml`. Follow the instructions [here](https://docs.pantheon.io/guides/solr-drupal/solr-drupal#enable-at-the-site-level)
17+
- **Drupal**: 10.x or 11.x
18+
- **PHP**: 8.2+
19+
- **Google Workspace**: Paid account (personal Gmail is limited to the [playground](https://content.pantheon.io))
20+
- **Content Publisher access**: [Create your account](https://content.pantheon.io) and install the [Google Docs add-on](https://docs.content.pantheon.io/quickstart)
21+
- **Search backend**: Any [Search API](https://www.drupal.org/project/search_api) backend (e.g., [Database Search](https://www.drupal.org/project/search_api_db), [Solr](https://www.drupal.org/project/search_api_solr)). For Pantheon-hosted sites, use [Search API Pantheon](https://www.drupal.org/project/search_api_pantheon)
1122

1223
## Installation
1324

14-
To install this module via Composer, run the following command
15-
```
16-
composer require drupal/pantheon_content_publisher:"^1.0"
25+
Install the module via Composer:
1726

27+
```bash
28+
composer require drupal/pantheon_content_publisher:"^1.0"
1829
```
19-
The module requires a backend Search API plugin. For sites hosted on Pantheon, it is recommended to use the Search API Pantheon module.
2030

21-
To install Search API Pantheon Module, run the following command
22-
```
31+
Then enable the module at **Extend** (`/admin/modules`).
32+
33+
### Pantheon-Hosted Sites
34+
35+
If your site is hosted on Pantheon, also install the Search API Pantheon module and enable Solr:
36+
37+
```bash
2338
composer require drupal/search_api_pantheon:^8
39+
```
2440

41+
Add the following to your `pantheon.yml`:
42+
43+
```yaml
44+
search:
45+
version: 8
2546
```
26-
After installing the Content Publisher and Search API Pantheon modules locally with Composer, push the `composer.json` and `composer.lock` files to your Pantheon environment.
2747
48+
Push `composer.json`, `composer.lock`, and `pantheon.yml` to your Pantheon environment before enabling the modules.
2849

29-
## Feedback and Collaboration
50+
## Configuration
51+
52+
### 1. Create an Access Token
53+
54+
In the [Content Publisher Dashboard](https://content.pantheon.io), go to **Settings > Tokens** and generate a read-only access token. Save it for the next step.
55+
56+
> For production environments, use [Pantheon's Secrets Manager](https://docs.pantheon.io/guides/secrets) instead of storing tokens directly.
57+
58+
### 2. Create a Collection
59+
60+
In the Content Publisher Dashboard:
61+
62+
- Create a new Collection and associate it with your Drupal site's URL
63+
- Set the webhook URL to: `https://your-site.com/api/pantheoncloud/webhook`
64+
- Copy the **Collection Identifier** (you'll need it below)
65+
66+
### 3. Configure the Drupal Module
67+
68+
Navigate to **Structure > Pantheon Content Publisher collections** (`/admin/structure/pantheon-content-publisher-collection`):
69+
70+
1. Click **Add collection**
71+
2. Enter the access token from step 1
72+
3. Paste the **Collection Identifier** from the Content Publisher Dashboard
73+
4. Select a Search API server (auto-populated on Pantheon)
74+
5. Click **Save**
3075

31-
Bug reports and feature requests should be posted in the Github repository. For code changes, please submit pull requests against the GitHub repository rather than posting pull requests or patches to drupal.org.
76+
Saving the collection automatically creates Drupal fields from the Pantheon metadata schema and sets up a Search API index.
77+
78+
### 4. Publish Content
79+
80+
1. Open a Google Doc
81+
2. Click the Content Publisher add-on icon
82+
3. Connect to your Collection
83+
4. Click **Publish**
84+
85+
The content appears on your Drupal site at `/pantheon-content-publisher/{id}`. Use Views to build custom listing pages from the Search API index.
86+
87+
If content does not appear, verify the webhook URL in the Content Publisher Dashboard and check **Reports > Recent log messages** (`/admin/reports/dblog`) for errors.
88+
89+
## Publishing Levels
90+
91+
The module supports three publishing levels, selectable via the `publishingLevel` query parameter:
92+
93+
| Level | Description |
94+
|---|---|
95+
| **PRODUCTION** | Published, frozen snapshot of the content |
96+
| **REALTIME** | Live state, updates as the document changes in Content Publisher |
97+
| **DRAFT** | Arbitrary snapshot for approval workflow review |
98+
99+
Example: `https://your-site.com/api/pantheoncloud/document/{id}?publishingLevel=DRAFT&versionId=xyz`
100+
101+
The `versionId` parameter identifies a specific DRAFT snapshot. Find version IDs in the Content Publisher Dashboard under the document's approval workflow history.
102+
103+
## Module Dependencies
104+
105+
| Package | Purpose |
106+
|---|---|
107+
| `drupal/search_api` | Full-text search and Views integration |
108+
| `drupal/imagecache_external` | Caching of external images from documents |
109+
| `drupal/key` | Secure API token storage |
110+
| `dpauli/graphql-request-builder` | GraphQL query construction |
111+
| `drupal:media` | Media entity support for images |
112+
113+
## API Endpoints
114+
115+
| Endpoint | Purpose |
116+
|---|---|
117+
| `/api/pantheoncloud/webhook` | Receives publish/unpublish events from Content Publisher |
118+
| `/api/pantheoncloud/status` | Health check |
119+
| `/api/pantheoncloud/document/{id}` | View a document (supports `publishingLevel` and `versionId` params) |
120+
| `/api/pantheoncloud/component_schema` | List smart component schemas (JSON) |
121+
| `/api/pantheoncloud/component/{id}` | Render a smart component |
122+
123+
## Development
124+
125+
### Code Quality
126+
127+
```bash
128+
# Lint PHP syntax
129+
composer code:lint
130+
131+
# Run PHPCS with Drupal coding standards
132+
composer codesniff
133+
134+
# Auto-fix coding standard issues
135+
composer code:fix
136+
```
32137

33138
## Documentation
34139

35-
Documentation is available at [pcc.pantheon.io/pantheon-content-publisher-for-drupal](https://pcc.pantheon.io/pantheon-content-publisher-for-drupal)
140+
- [Drupal Getting Started Tutorial](https://docs.content.pantheon.io/drupal-tutorial)
141+
- [Content Publisher Quickstart](https://docs.content.pantheon.io/quickstart)
142+
- [Architecture & Internals](TECH_NOTES.md)
143+
- [Content Publisher Dashboard](https://content.pantheon.io)
144+
145+
## Feedback and Collaboration
36146

147+
Report bugs and request features in the [GitHub repository](https://github.com/pantheon-systems/pantheon-content-publisher-drupal). For code changes, submit pull requests against GitHub rather than drupal.org.

0 commit comments

Comments
 (0)