{"id":48536627,"url":"https://github.com/ucsc/ucsc-content-blocks","last_synced_at":"2026-04-08T02:03:56.798Z","repository":{"id":182172244,"uuid":"667974892","full_name":"ucsc/ucsc-content-blocks","owner":"ucsc","description":"A collection of WordPress blocks for UC Santa Cruz.","archived":false,"fork":false,"pushed_at":"2024-01-16T17:01:23.000Z","size":583,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-26T17:52:28.779Z","etag":null,"topics":["gutenberg","gutenberg-blocks","gutenberg-plugin","wordpress","wordpress-plugin","wp-blocks"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ucsc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-18T18:14:28.000Z","updated_at":"2024-03-30T15:06:41.000Z","dependencies_parsed_at":"2023-07-19T02:00:40.932Z","dependency_job_id":null,"html_url":"https://github.com/ucsc/ucsc-content-blocks","commit_stats":null,"previous_names":["ucsc/ucsc-content-blocks"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/ucsc/ucsc-content-blocks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucsc%2Fucsc-content-blocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucsc%2Fucsc-content-blocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucsc%2Fucsc-content-blocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucsc%2Fucsc-content-blocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ucsc","download_url":"https://codeload.github.com/ucsc/ucsc-content-blocks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucsc%2Fucsc-content-blocks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31536473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"online","status_checked_at":"2026-04-08T02:00:06.127Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["gutenberg","gutenberg-blocks","gutenberg-plugin","wordpress","wordpress-plugin","wp-blocks"],"created_at":"2026-04-08T02:03:37.458Z","updated_at":"2026-04-08T02:03:56.774Z","avatar_url":"https://github.com/ucsc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UC Santa Cruz Content Blocks\n\nA collection of WordPress blocks for [UC Santa Cruz](https://www.ucsc.edu/). Built with [@wordpress/scripts](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/). Additional blocks will be added as use cases arise.\n\n![GitHub Release](https://img.shields.io/github/v/release/ucsc/ucsc-content-blocks?logo=github\u0026logoColor=%23fdc700\u0026labelColor=%23003c6c\u0026color=%23fdc700)\n ![GitHub issues](https://img.shields.io/github/issues/ucsc/ucsc-content-blocks?logo=github\u0026logoColor=%23fdc700\u0026labelColor=%23003c6c\u0026color=%23fdc700) ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/ucsc/ucsc-content-blocks/release.yml?logo=github\u0026logoColor=%23fdc700\u0026labelColor=%23003c6c\u0026color=%23fdc700)\n\n## Current Blocks\n\n- **Details** -- a block that utilizes the `\u003cdetails\u003e` element that can be used as an accordion\n- **Details Wrapper** -- a block that wraps multiple Details blocks, enabling them to be opened and closed simultaneously\n\n## Requirements\n\nCloning and installing this plugin requires:\n\n- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)\n- [GitHub Cli](https://cli.github.com/manual/installation) (optional but helpful)\n- [Node.js/npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)\n- [Composer](https://getcomposer.org/)\n\nBlock development will require a local WordPress development environment such as [@wordpress/env](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/).\n\n## Clone and install\n\n- Clone repo: `gh repo clone ucsc/ucsc-content-blocks`\n- `cd ucsc-content-blocks/`\n- `npm install`\n- `composer install`\n\n## Directory structure and scripts\n\nThis plugin was developed using [@wordpress/scripts](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/) (see the `\"devDependencies\"` object in `package.json`).\n\nBoth `src/` and `build/` directories are located within the `blocks/` directory at the project root.\n\n```text\nblocks/\n -build/\n  --block-one/\n  --block-two/\n -src/\n  --block-one/\n  --block-two/\n```\n\n### Build and Start\n\nThe following npm scripts will build (or start) the entire plugin.\n\n`npm run build`\n\n`npm run start` (start will initiate a perpetual build after every file save)\n\n### Additional scripts\n\nThere are `build` and `start` scripts for individual blocks and for various additional tasks such as linting and packaging. Please review the `\"scripts\"` object in `package.json`. All additional scripts are provided by the `@wordpress/scripts` package.\n\n## Creating a new block\n\nIf you'd like to contribute to this project and create a new block, please review our [contributing guidelines](CONTRIBUTING.md).\n\n### Scaffold files\n\nThe `@wordpress/scripts` package includes a script called `create-block` that allows you to initiate a new block for development.\n\nFrom within the `blocks/src/` directory, issue the command\n\n`npx @wordpress/create-block --no-plugin`\n\nand follow the prompts to name and namespace your new block.\n\nYou will see a new directory in `blocks/src/` that contains your new block's files.\n\nThe script will create a functioning \"Hello World\" block that you can enqueue via this plugin and review in your development environment prior to digging into the code.\n\nThe `--no-plugin` flag will restrict creation to block scaffolding only, which is helpful when developing a plugin that has multiple blocks.\n\nFor more information, see the [@wordpress/create-block](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-create-block/) documentation in the WordPress [Block Editor Handbook](https://developer.wordpress.org/block-editor/).\n\n### Enqueue block\n\nOnce the new block is created, it must be enqueued via the `ucsc_register_content_blocks()` function in the `ucsc-content-blocks.php` file.\n\n```php\n/**\n * Register blocks\n */\nfunction ucsc_register_content_blocks() {\n\n // Register blocks in the format $dir =\u003e $render_callback.\n $blocks = array(\n  'details'  =\u003e '',\n  'details-wrapper'  =\u003e '',\n );\n...\n}\n\n```\n\nEnqueue the newly created block by adding a line to the `$blocks` array with the name of the directory that was created with the `block-creation` script:\n\n```php\n\n $blocks = array(\n  'details'  =\u003e '',\n  'details-wrapper'  =\u003e '',\n  'new-block'  =\u003e '',\n );\n\n```\n\nActivate this plugin in your development environment. If the new block was enqueued propperly, you'll be able to chose the newly created \"Hello World\" block in the block editor of a WordPress Page or Post.\n\nOnce you've verified it was built and enqueued properly, configure the `build` and `start` scripts for your new block.\n\n### Add build and start scripts for new block\n\nAs described above, the `npm build` and `npm start` commands will build and start the entire plugin. When developing a new block, it's convenient to _build_ and _start_ just the block you're working on.\n\nYou can add `build` and `start` scripts for your new block by editing the `\"scripts\"` object in the `package.json` file.\n\n```JSON\n\"scripts\": {\n  \"start\": \"wp-scripts start --webpack-src-dir=blocks/src/ --output-path=blocks/build/\",\n  \"build\": \"wp-scripts build --webpack-src-dir=blocks/src/ --output-path=blocks/build/\",\n ...\n  \"start:details\": \"wp-scripts start --webpack-src-dir=blocks/src/details --output-path=blocks/build/details\",\n  \"build:details\": \"wp-scripts build --webpack-src-dir=blocks/src/details --output-path=blocks/build/details\",\n  \"start:details-wrapper\": \"wp-scripts start --webpack-src-dir=blocks/src/details-wrapper --output-path=blocks/build/details-wrapper\",\n  \"build:details-wrapper\": \"wp-scripts build --webpack-src-dir=blocks/src/details-wrapper --output-path=blocks/build/details-wrapper\",\n ...\n }\n```\n\nUse the entries for the existing blocks as a template and add entries to `build` and `start` your new block.\n\n```JSON\n\"scripts\": {\n  \"start\": \"wp-scripts start --webpack-src-dir=blocks/src/ --output-path=blocks/build/\",\n  \"build\": \"wp-scripts build --webpack-src-dir=blocks/src/ --output-path=blocks/build/\",\n ...\n  \"start:details\": \"wp-scripts start --webpack-src-dir=blocks/src/details --output-path=blocks/build/details\",\n  \"build:details\": \"wp-scripts build --webpack-src-dir=blocks/src/details --output-path=blocks/build/details\",\n  \"start:details-wrapper\": \"wp-scripts start --webpack-src-dir=blocks/src/details-wrapper --output-path=blocks/build/details-wrapper\",\n  \"build:details-wrapper\": \"wp-scripts build --webpack-src-dir=blocks/src/details-wrapper --output-path=blocks/build/details-wrapper\",\n  \"start:new-block\": \"wp-scripts start --webpack-src-dir=blocks/src/new-block --output-path=blocks/build/new-block\",\n  \"build:new-block\": \"wp-scripts build --webpack-src-dir=blocks/src/new-block --output-path=blocks/build/new-block\",\n ...\n }\n```\n\nSave your changes to `package.json` and test that they work:\n\n- `npm run start:new-block`\n- `npm run build:new-block`\n\nBingo!\n\nGo develop your new block.\n\n## Resources\n\n- [WordPress Block Editor Handbook](https://developer.wordpress.org/block-editor/)\n- [Create a Block Tutorial](https://developer.wordpress.org/block-editor/getting-started/create-block/)\n- [@wordpress/scripts](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/)\n- [@wordpress/create-block](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-create-block/)\n- [@wordpress/env](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/)\n\n## Contributors\n\n- [Jason Chafin](https://github.com/Herm71)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucsc%2Fucsc-content-blocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fucsc%2Fucsc-content-blocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucsc%2Fucsc-content-blocks/lists"}