{"id":13506687,"url":"https://github.com/gitana/cloudcms-nuxt","last_synced_at":"2025-05-14T11:14:10.210Z","repository":{"id":57200712,"uuid":"169797677","full_name":"gitana/cloudcms-nuxt","owner":"gitana","description":"Cloud CMS Nuxt Plugin","archived":false,"fork":false,"pushed_at":"2021-11-04T14:35:12.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-22T14:57:27.457Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://gitana.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gitana.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-08T20:54:43.000Z","updated_at":"2025-01-23T02:48:37.000Z","dependencies_parsed_at":"2022-09-16T15:11:58.036Z","dependency_job_id":null,"html_url":"https://github.com/gitana/cloudcms-nuxt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitana%2Fcloudcms-nuxt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitana%2Fcloudcms-nuxt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitana%2Fcloudcms-nuxt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitana%2Fcloudcms-nuxt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitana","download_url":"https://codeload.github.com/gitana/cloudcms-nuxt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254129537,"owners_count":22019629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T01:00:55.445Z","updated_at":"2025-05-14T11:14:10.181Z","avatar_url":"https://github.com/gitana.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# Cloud CMS Nuxt Module\n\nThis module makes it easy to use Cloud CMS from within your Nuxt JS pages and components.\n\nIt provides the following:\n\n1. An initialized connect to Cloud CMS for use in query, search and retrieval of content.\n2. Optional support for Preview Mode (providing your editors with instant preview of editorial changes from within Cloud CMS).\n3. Optional support for Page Renditions (allowing your editors to see and preview precisely where a piece of content appears on the site).\n\nYou can find an example of a static site generated using Nuxt JS and Cloud CMS here: https://github.com/gitana/sdk/tree/master/nuxtjs/sample\n\nThis site uses the Cloud CMS Nuxt Module to deliver a working example of the aforementioned capabilities.\n\n## Installation\n\n`npm install -S cloudcms-nuxt`\n\n## Nuxt\n\nAdd the module to your Nuxt configuration.  You must include the contents of your `gitana.json` file, like this:\n\n```\nvar config = require(\"./gitana.json\");\nmodule.exports = {\n    ...,\n    \"modules\": [\n        [\"cloudcms-nuxt\", config]\n    ]\n}\n```\n\nYou can also add the following optional configuration settings:\n\n```\n{\n    ...,\n    \"preview\": false,\n    \"renditions\": false,\n    \"basePageUrl\": \"http://localhost:3000\"\n}\n```\n\nIn more detail, these are:\n\n- *preview* - set to `true` to enable instant preview and branch switching capabilities\n- *renditions* - set to `true` to track generated page renditions (per content item) and make that information available to editors for preview selection\n- *basePageUrl* - set to the base URL of the server for instant preview\n- \n\n## Example Usage\n\nThe `$cloudcms` context variable is available on the `context`, providing access to all functions in the [Cloudcms driver](https://github.com/gitana/cloudcms-javascript-driver). The `$branch` provides functions to your current project branch, which is by default `master`.   Here is how you can read a node.\n\n```javascript\nasync asyncData(context) {\n    let node = await context.$branch.readNode(\"myNodeId\");\n    // more awesome content functions\n}\n```\n\nIf you've enabled preview mode (i.e. `preview` set to `true` via config), then your web pages support the following \nadditional request parameters:\n\n    ?preview\u0026branch={branchId}\n\nWhich allows you to request server-side rendering of the given page on top of the given Cloud CMS branch.  This provides\nyour editors (working in different branches) with the ability to preview their content without any server redeployments\nor restarts.\n\nIf you've enabled rendition tracking (i.e. `trackRenditions` set to `true` via config), then the `nuxt generate` build\nfor the static site will automatically discover any content node IDs for every page generated.  That information will\nbe shipped back to the Cloud CMS API so that your editorial users can take advantage of it while editing and previewing\ntheir changes.\n\nTo tag pages as having generated using a specific node, just append the `data-cms-id` attribute into your DOM.  For example,\n\n    \u003cdiv class=\"item item-author-block author\" :data-cms-id=\"author._doc\"\u003e\n        \u003ca :href=\"authorLink\"\u003e\n            \u003cdiv class=\"author-dp\"\u003e\n                \u003cimg v-bind:src=\"author.defaultAttachmentUrl\" v-bind:alt=\"author.title\"\u003e\n            \u003c/div\u003e\n        \u003c/a\u003e\n    \u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitana%2Fcloudcms-nuxt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitana%2Fcloudcms-nuxt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitana%2Fcloudcms-nuxt/lists"}