### Install and Use Google Docs Add-on Source: https://docs.content.pantheon.io/getting-started-with-wordpress Guide for installing the Content Publisher add-on in Google Docs and connecting a document to a content collection for previewing and publishing. ```Markdown 5. Prepare for publishing your first document by going to Google Docs and installing Coontent Publisher add-on: - Go to the [add-on page](https://workspace.google.com/marketplace/app/pantheon_content_cloud/432998952749) - [Install the add-on](https://workspace.google.com/marketplace/app/pantheon_content_cloud/432998952749) - [Create a new Google document for your first test](https://workspace.google.com/marketplace/app/pantheon_content_cloud/432998952749) - [Open the add-on](https://workspace.google.com/marketplace/app/pantheon_content_cloud/432998952749) - [Connect the document to your previously created collection (referred to by the website URL)](https://workspace.google.com/marketplace/app/pantheon_content_cloud/432998952749) - [Preview and publish the document](https://workspace.google.com/marketplace/app/pantheon_content_cloud/432998952749) - [Check the live page.](https://workspace.google.com/marketplace/app/pantheon_content_cloud/432998952749) ``` -------------------------------- ### Install Content Publisher CLI Source: https://docs.content.pantheon.io/getting-started-with-next-js Installs the Content Publisher Command Line Interface globally using npm. This tool is essential for managing content collections and initializing projects. ```bash npm add @pantheon-systems/pcc-cli --global ``` -------------------------------- ### Install Content Publisher WordPress Plugin Source: https://docs.content.pantheon.io/getting-started-with-wordpress Steps to download and install the Content Publisher plugin for WordPress. This plugin acts as the bridge to publish content from Google Docs to your WordPress site. ```Markdown 1. Create a new WordPress site on Pantheon (see [instructions](https://docs.pantheon.io/guides/getstarted/addsite#create-a-new-cms-site)) or get ready to use an existing one 2. Download the latest release of the [Content Publisher WordPress plugin](https://github.com/pantheon-systems/pantheon-content-publisher-for-wordpress/releases) 3. In the WordPress admin dashboard, install the plugin and then enable it ``` -------------------------------- ### Pantheon Content Publisher CLI Setup and Usage Source: https://context7_llms Guides users through installing and using the Pantheon Content Publisher CLI (PCC CLI). It covers essential commands for creating sites, managing tokens, initializing NextJS projects, and updating site URLs. ```cli Install the Content Publisher CLI: # Example command (actual command not provided in text) pcc install Create sites and tokens: # Example commands (actual commands not provided in text) pcc site create --name "MySite" pcc token create --site-id Initialize NextJS projects: # Example command (actual command not provided in text) pcc nextjs init --site-id --token Update site URLs: # Example command (actual command not provided in text) pcc site update --url ``` -------------------------------- ### Run Local Development Server Source: https://docs.content.pantheon.io/getting-started-with-next-js Starts the Next.js development server to test your website locally. This command is run from the project's root directory after initialization. ```bash cd npm run dev ``` -------------------------------- ### Pantheon Content Publisher: Connect Existing Site SDK/Starter Kit Source: https://context7_llms Guides developers on integrating Pantheon Content Cloud with an existing website. This involves installing the Content Cloud SDK and starter kit via command line to enable content publishing. ```javascript Install Content Cloud SDK and Starter Kit: # Example commands (actual commands not provided in text) npm install @pantheon/content-cloud-sdk # Or using yarn yarn add @pantheon/content-cloud-sdk # Starter kit integration would typically involve copying files or running a setup script. ``` -------------------------------- ### Initialize Next.js Project with PCC Source: https://docs.content.pantheon.io/getting-started-with-next-js Initializes a new Next.js project using a starter kit, integrating Content Publisher. It supports TypeScript and ESLint variants. The command prompts for site selection and access token creation. ```bash pcc init --ts --eslint ``` -------------------------------- ### Install Pantheon Content Publisher CLI Source: https://docs.content.pantheon.io/pcc-cli-setup Installs the Pantheon Content Publisher CLI globally using npm. This command requires Node.js v18x or later. ```bash npm add @pantheon-systems/pcc-cli --global ``` -------------------------------- ### Create a Content Collection Source: https://docs.content.pantheon.io/getting-started-with-next-js Creates a new content collection within Content Publisher. You must provide the URL of the website where content will be published. A placeholder URL can be used initially. ```bash pcc site create --url ``` -------------------------------- ### Login to Content Publisher CLI Source: https://docs.content.pantheon.io/getting-started-with-next-js Authenticates the Content Publisher CLI with your account. This command is required before performing other CLI operations like creating or configuring content collections. ```bash pcc login ``` -------------------------------- ### Install Drupal Content Publisher Modules Source: https://docs.content.pantheon.io/pantheon-content-publisher-for-drupal Installs the Drupal Content Publisher and Search API Pantheon modules using Composer. These modules are essential for integrating Google Docs content into your Drupal site. ```bash composer require drupal/pantheon_content_publisher:"^1.0" composer require drupal/search_api_pantheon:"^8" ``` -------------------------------- ### Configure Content Publisher in WordPress Source: https://docs.content.pantheon.io/getting-started-with-wordpress Instructions for configuring the Content Publisher plugin in the WordPress admin dashboard, including obtaining and pasting an authentication token to initiate a content collection. ```Markdown 4. Go to the plugin setting page, here the interface will ask you for an authentication token to initiate a content collection for your WordPress website. Open a new tab to go create a **management token** on Content Publisher: - Go to [https://content.pantheon.io](https://content.pantheon.io) - [Authenticate with your user email from the Google Workspace you want to use Content Publisher with. (Personal Gmail/GDoc accounts are not supported)](https://content.pantheon.io) - [Go to the](https://content.pantheon.io) [Management token](https://content.pantheon.io/dashboard/settings/tokens?tab=1) settings, create and copy a management token - Paste it in the WordPress plugin configuration page - This will automatically create a content collection for that website - Choose if you want content from Content Publisher to be posted as Post or Page in WordPress ``` -------------------------------- ### Starter Kits: Next.js SSG Example Source: https://docs.content.pantheon.io/release-notes Includes a Static Site Generation (SSG) example within the Next.js starter kits. This demonstrates how to leverage SSG with Content Pantheon for optimized frontend performance. ```javascript // Example of getStaticProps in Next.js for SSG // import { PantheonClient } from '@pantheon/sdk'; // // export async function getStaticProps() { // const client = new PantheonClient(); // const articles = await client.getArticles(); // return { // props: { articles }, // revalidate: 60, // Revalidate every 60 seconds // }; // } ``` -------------------------------- ### Pantheon Content Publisher: Ingest API Guide Source: https://context7_llms Details how to integrate content sources with Pantheon Content Publisher using RESTful APIs. It covers setup, API endpoint specifications, and provides examples for ingesting HTML and Markdown content. ```rest Ingest Content via REST API: # Example POST request for HTML ingestion (endpoint and payload structure are illustrative) POST /api/v1/ingest/html Host: api.content.pantheon.io Content-Type: application/json Authorization: Bearer { "siteId": "", "content": "

Hello World

", "contentType": "html" } # Similar endpoints exist for Markdown and other formats. ``` -------------------------------- ### Install Content Publisher CLI Source: https://docs.content.pantheon.io/setup-content-cloud-invalidation-on-static-sites Installs the Pantheon Content Publisher CLI tool globally using npm. This command requires Node.js to be installed on your system. ```bash npm install @pantheon-systems/pcc --global ``` -------------------------------- ### Example: Configure Webhook URL Source: https://docs.content.pantheon.io/setup-content-cloud-invalidation-on-static-sites An example demonstrating how to configure the webhook URL for a specific site ID ('abcde1122') to a listener at 'https://example.com/webhook'. ```bash pcc site configure abcde1122 --webhook-url https://example.com/webhook ``` -------------------------------- ### Update Site URL Configuration Source: https://docs.content.pantheon.io/getting-started-with-next-js Configures or updates the URL associated with a Content Publisher content collection. This is useful if a placeholder URL was used during creation or if the production URL changes. ```bash pcc site configure --url "" ``` -------------------------------- ### GQL API for Content Publisher Source: https://docs.content.pantheon.io/getting-started The GQL (GraphQL) API enables pulling content from Content Publisher into other web or digital applications. It provides a flexible way to query and retrieve published content. ```APIDOC GQL API (Delivery API): Purpose: Pull content from Content Publisher into other applications. Usage: Query and retrieve published content for web or digital apps. Reference: https://pcc.pantheon.io/docs/delivery-api-gql ``` -------------------------------- ### Run Development Server Source: https://docs.content.pantheon.io/pantheon-content-cloud-connect-an-existing-site-sdk-starterkit Starts the local development server for your NextJS application. This command is used to view your site locally after configuring the Content Publisher connection. ```shell yarn dev ``` -------------------------------- ### Login to Pantheon Content Publisher CLI Source: https://docs.content.pantheon.io/pcc-cli-setup Logs the user into the Pantheon Content Publisher CLI. This action opens a web browser for authentication via a Google account. ```bash pcc login ``` -------------------------------- ### Complete HTML Example for Browser SDK Integration Source: https://docs.content.pantheon.io/browser-sdk A full HTML file demonstrating how to integrate the Pantheon Browser SDK, including the script tag for initialization and the pcc-article element for content rendering. ```html Loading... ``` -------------------------------- ### Environment Variables for PCC Source: https://docs.content.pantheon.io/getting-started-with-next-js Sets up essential environment variables in a .env.local file for Content Publisher integration. These variables store the collection ID and access token, crucial for connecting the Next.js app to the content collection. ```env PCC_SITE_ID=xXXXXXXXXXXX PCC_TOKEN=xxxxx-xxxxx-xxxx-xxxx-xxxxxx ``` -------------------------------- ### Example: Configure Webhook Secret Source: https://docs.content.pantheon.io/setup-content-cloud-invalidation-on-static-sites An example demonstrating how to configure the webhook secret for a specific site ID ('abcde1122') to 'very-secret-key'. ```bash pcc site configure abcde1122 --webhook-secret very-secret-key ``` -------------------------------- ### Ingest API for Content Publisher Source: https://docs.content.pantheon.io/getting-started The Ingest API allows programmatic addition of new content sources to Pantheon Content Publisher. It is used to integrate external content into your publishing workflow. ```APIDOC Ingest API: Purpose: Add new Content Sources to Content Publisher. Usage: Integrate external content into your publishing workflow. Reference: https://pcc.pantheon.io/docs/ingest-api ``` -------------------------------- ### Install Content Publisher CLI Source: https://docs.content.pantheon.io/new-next-js-site Installs the Content Publisher CLI globally using npm. This command is essential for interacting with the Content Publisher service via the command line. ```shell npm add @pantheon-systems/pcc-cli --global ``` -------------------------------- ### Configure Webhook for Content Publisher Source: https://docs.content.pantheon.io/pantheon-content-publisher-for-drupal Sets up a webhook for the content collection using the PCC CLI. This webhook notifies Drupal whenever a published document is updated, ensuring content synchronization. ```bash pcc site configure --webhook-url ``` -------------------------------- ### Create Content Collection with PCC CLI Source: https://docs.content.pantheon.io/pantheon-content-publisher-for-drupal Creates a new content collection in Content Publisher using the PCC CLI. This collection acts as a virtual location for managing Google Docs content for publishing. ```bash pcc site create --url ``` -------------------------------- ### WordPress Plugin Installation Source: https://docs.content.pantheon.io/pantheon-content-publisher-for-wordpress Steps to install the Pantheon Content Publisher plugin for WordPress. This involves downloading the plugin zip file and uploading it via the WordPress admin dashboard. ```bash 1. Download the Content Publisher WordPress plugin zip file. 2. In your WordPress admin dashboard, go to Plugins > Add New. 3. Click on "Upload Plugin" and select the downloaded zip file. 4. Click "Install Now" and activate the plugin. ``` -------------------------------- ### Login to Content Publisher CLI Source: https://docs.content.pantheon.io/setup-content-cloud-invalidation-on-static-sites Logs the user into the Content Publisher CLI. This action will typically open a browser window for authentication with your Pantheon account. ```bash pcc login ``` -------------------------------- ### Basic Code Snippet Example Source: https://docs.content.pantheon.io/google-doc-formatting-and-styling-support A simple example demonstrating how block code is rendered. This snippet shows a basic code block as it would appear in a published document. ```plaintext this is code ``` -------------------------------- ### Configure Environment Variables Source: https://docs.content.pantheon.io/pantheon-content-cloud-connect-an-existing-site-sdk-starterkit Sets up the necessary environment variables in the .env.local file to connect your site to Content Publisher. PCC_SITE_ID identifies your site, and PCC_TOKEN provides authentication. ```shell PCC_SITE_ID="your site id" PCC_TOKEN="your token" ``` -------------------------------- ### Manage PCC Token via CLI Source: https://docs.content.pantheon.io/pantheon-content-cloud-connect-an-existing-site-sdk-starterkit Commands to list and create authentication tokens for the Content Publisher CLI. These tokens are essential for authenticating with the Content Publisher service. ```shell pcc token list ``` ```shell pcc token create ``` -------------------------------- ### Initialize and Push Git Repository Source: https://docs.content.pantheon.io/deploying-pcc-to-fes Commands to initialize a new Git repository locally, add all files, commit them, set the main branch to 'main', link it to a remote GitHub repository, and push the initial commit. ```shell git init git add --all git commit -m "first commit" git branch -M main git remote add origin [your repo URI] git push -u origin main ``` -------------------------------- ### Next.js Starter Kit Site Structure Source: https://docs.content.pantheon.io/release-notes The Next.js starter kit now aligns its site structure with the content collection structure in Content Publisher. This simplifies site navigation by leveraging the content organization directly. ```APIDOC Next.js Starter Kit Integration: Feature: Site structure mirrors Content Publisher content structure. Benefit: Enables seamless site navigation based on content organization without custom development. Usage: Content collection structure directly informs Next.js website navigation. ``` -------------------------------- ### Pantheon Content Publisher CLI: Create Collection Source: https://context7_llms Details the process of setting up Pantheon Content Publisher Collections (Sites) using the CLI. It involves initializing PCC_SITE_ID with your site URL and PCC_TOKEN for API verification, and copying returned IDs for development. ```cli Initialize a Collection (Site): # Example command structure (actual command not provided in text) PCC_SITE_ID="" PCC_TOKEN="" pcc collection init --site-id $PCC_SITE_ID --token $PCC_TOKEN # The command returns IDs that should be copied for development. ``` -------------------------------- ### Example: Ingest HTML Content using CURL Source: https://docs.content.pantheon.io/ingest-api Shows an example CURL request to ingest HTML content into an article. The HTML content is stringified and passed within the JSON data payload, along with the authorization token. ```curl curl --location 'https://api.content.pantheon.io/article/b9Rd78IJj4iy3EIcYcbh/ingest' \ --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30' \ --header 'Content-Type: application/json' \ --data '{ "content": "\n\n\n \n \n Styled Complex HTML Page\n \n\n\n

Hello World

\n

This is a sample paragraph.

\n\n" }' ``` -------------------------------- ### CLI/SDK: Next.js App Router Support and Starter Kit Source: https://docs.content.pantheon.io/release-notes Provides support for the Next.js app router, including a starter kit to facilitate integration. This update enhances compatibility with modern Next.js development patterns. ```bash npx create-next-app --example pantheon-starter-kit my-app ``` ```javascript // Example usage within Next.js app router (conceptual) // import { PantheonClient } from '@pantheon/sdk'; // const client = new PantheonClient(); // const articles = await client.getArticles(); ``` -------------------------------- ### Pantheon Content Publisher: Delivery API (GQL) Source: https://context7_llms Provides access to the Content Publisher's GraphQL API for retrieving content. This section guides users on how to query content and explore the API interface. ```graphql Query Content via GraphQL: # Example GraphQL query to fetch an article by ID query GetArticle($articleId: ID!) { article(id: $articleId) { id title body publishedAt } } # Variables for the query: # { # "articleId": "your-article-id" # } ``` -------------------------------- ### Initialize Pantheon Browser SDK with Script Tag Source: https://docs.content.pantheon.io/browser-sdk Include this script tag in your HTML's or before the closing tag to load the SDK. Replace placeholders with your actual Site ID and Access Token. ```html ``` -------------------------------- ### CLI/SDK: Get Article Title Export Source: https://docs.content.pantheon.io/release-notes Adds the `getArticleTitle` function to the `/component` exports. This utility is useful for decoupled title rendering scenarios where the title needs to be accessed separately from the main article content. ```javascript import { getArticleTitle } from '@pantheon/sdk/component'; async function displayArticleTitle(articleId) { const title = await getArticleTitle(articleId); console.log('Article Title:', title); } ``` -------------------------------- ### HTML Content Structure Source: https://docs.content.pantheon.io/ingest-api An example of HTML content that can be ingested. This snippet includes image elements within a figure-caption structure, demonstrating how visual content might be represented. ```html
\n            

Section 4: Images

\n            
\n                
\n                    \"Random\n                    
Figure 1: A random image from Picsum.
\n                
\n                
\n                    \"Random\n                    
Figure 2: Another random image from Picsum.
\n                
\n            
\n        
``` -------------------------------- ### PCC CLI/SDK: Deprecations Source: https://docs.content.pantheon.io/release-notes Notes the deprecation of specific starter kits and SDKs within the CLI/SDK context, indicating a shift in supported technologies. ```CLI/SDK Deprecations: - Deprecate vue, gatsby starter kits, and vue SDK. ``` -------------------------------- ### Backend: LLM Preamble Support Source: https://docs.content.pantheon.io/release-notes Introduces support for LLM (Large Language Model) preambles, allowing for enhanced control over LLM behavior and output. Includes a link to usage documentation. ```Backend # Backend Feature Update # Feature: # - Support for LLM preamble. # This allows users to provide initial context or instructions to Large Language Models, # influencing their responses and behavior for specific tasks. # Usage Documentation: # https://docs.google.com/document/d/1osHGaDQP7I295O-ioCh5VBS8z4MvH5vQXfXAtA5ZdSw/edit?tab=t.0 ``` -------------------------------- ### Configure Webhook URL and Secret Simultaneously Source: https://docs.content.pantheon.io/setup-content-cloud-invalidation-on-static-sites Configures both the webhook URL and webhook secret for a specific Content Publisher site in a single command. This is a convenient way to set up both parameters at once. ```bash pcc site configure --webhook-url --webhook-secret ``` -------------------------------- ### List Content Publisher Sites Source: https://docs.content.pantheon.io/setup-content-cloud-invalidation-on-static-sites Lists all available Pantheon Content Publisher sites associated with your account. This command helps you retrieve the specific site ID needed for further configuration. ```bash pcc site list ``` -------------------------------- ### Login to Content Publisher CLI Source: https://docs.content.pantheon.io/new-next-js-site Logs the user into the Content Publisher CLI. This process typically involves authentication via a Google account and opens a browser tab for authorization. ```shell pcc login ``` -------------------------------- ### Ingest Markdown Content Example Source: https://docs.content.pantheon.io/ingest-api Demonstrates how to ingest Markdown content using a curl command. It includes the necessary headers, authorization token, and the JSON payload containing the Markdown content and metadata. ```curl curl --location 'https://api.content.pantheon.io/article/b9Rd78IJj4iy3EIcYcbh/ingest' \ --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30' \ --header 'Content-Type: application/json' \ --data '{ "content": "# Ultimate Markdown Showcase\r\n\r\nWelcome to the **Ultimate Markdown Showcase**. This document contains a comprehensive example of Markdown elements, including headings, lists, code blocks, tables, blockquotes, HTML, math, footnotes, and more.\r\n\r---\r\n\r## 1. Headings and Text Formatting\r\n\r### 1.1. Basic Text\rThis is a paragraph with **bold text**, *italic text*, and ***bold italic text***. You can also use `inline code` to emphasize snippets.\r\n\r### 1.2. Escaped Characters\rUse backslashes to escape Markdown characters: \r\n\*literal asterisks\*, \# not a heading.\r\n\r---\r\n\r## 2. Blockquotes and Nesting\r\r> **Blockquote Level 1:** \r> This is a blockquote containing several nested elements.\r> \r> ### Nested Heading in Blockquote\r> Even headings can be nested within blockquotes.\r> \r> - **Nested List in Blockquote:**\r> - First nested bullet\r> - Second nested bullet with `inline code`\r> - Deeper nested list:\r> 1. Ordered item one\r> 2. Ordered item two\r> \r> > **Blockquote Level 2:** \r> > > **Blockquote Level 3:** \r> > > A deeply nested blockquote with a Logo"{width=\"500\"}" height=\"300\"} 9. Conclusion\r\n\rMarkdown is a **powerful** tool for creating rich documents with simple syntax. Whether you're including code, tables, math, or nested structures, Markdown offers a flexible way to format your content.\r\n\r---\r\n\r*End of the Markdown Showcase.*", "publishLevel" : "prod", "contentType": "markdown", "docName": "testDoc", "docRevisionDate" : 1738742071112 }' ``` -------------------------------- ### Initialize New Next.js Project with Content Publisher Source: https://docs.content.pantheon.io/new-next-js-site Initializes a new Next.js project structure for use with Content Publisher. The project name can be customized. The command supports various flags for configuration. ```shell pcc init ``` ```shell pcc init --ts --eslint ``` ```shell pcc init --use-pnpm ``` ```shell pcc init --noInstall ``` -------------------------------- ### Configure Webhook Secret for Site Source: https://docs.content.pantheon.io/setup-content-cloud-invalidation-on-static-sites Configures a webhook secret for a specific Content Publisher site. This secret is used to verify the authenticity of incoming webhook requests. Replace `` and `` accordingly. ```bash pcc site configure --webhook-secret ``` -------------------------------- ### Configure Webhook URL for Site Source: https://docs.content.pantheon.io/setup-content-cloud-invalidation-on-static-sites Configures the webhook URL for a specific Content Publisher site. Replace `` with your site's unique identifier and `` with the URL that will receive webhook notifications. ```bash pcc site configure --webhook-url ``` -------------------------------- ### Example: Create Article using CURL Source: https://docs.content.pantheon.io/ingest-api Demonstrates how to create an article using the Content Publisher API via a CURL command. It includes setting the authorization token, content type, and the JSON payload for the article. ```curl curl --location 'https://api.content.pantheon.io/articles/create' \ --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30' \ --header 'Content-Type: application/json' \ --data '{ "title": "Test Article 2", "siteId": "testSiteID_1", "metadataFields": { "slug": "test_article_slug_11", "Maturity": "Low", "Birthday": 1737763200000, "image": "https://storage.googleapis.com/pcc-staging-user-uploads/8a3f8f73-9fed-4005-b7e8-8908490e7d24", "author": "kiran", "Text area": "lorem ipsum lorem", "description": "lorem ipsum lorem" }, "tags": ["tag1", "tag2"], "contentType": "blog" }' ```