{"id":21599183,"url":"https://github.com/gridonic/statamic-boilerplate-addon","last_synced_at":"2025-03-18T11:41:39.335Z","repository":{"id":66333741,"uuid":"560863135","full_name":"gridonic/statamic-boilerplate-addon","owner":"gridonic","description":"Statamic boilerplate addon.","archived":false,"fork":false,"pushed_at":"2024-07-24T11:43:49.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-24T17:47:21.083Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/gridonic.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-02T12:43:41.000Z","updated_at":"2024-07-24T11:40:29.000Z","dependencies_parsed_at":"2024-01-04T15:45:13.168Z","dependency_job_id":null,"html_url":"https://github.com/gridonic/statamic-boilerplate-addon","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridonic%2Fstatamic-boilerplate-addon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridonic%2Fstatamic-boilerplate-addon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridonic%2Fstatamic-boilerplate-addon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridonic%2Fstatamic-boilerplate-addon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gridonic","download_url":"https://codeload.github.com/gridonic/statamic-boilerplate-addon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244216700,"owners_count":20417650,"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-11-24T18:14:38.312Z","updated_at":"2025-03-18T11:41:39.311Z","avatar_url":"https://github.com/gridonic.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Statamic Boilerplate Addon\n\nA Statamic addon providing common functionality and fixes among all Boilerplate instances.\n\n## Features\n\n### Login with Magic Links\n\nThe addon provides a route `/portal-login/{token}` to log a user into the control panel with a JWT token.\n\n**Configuration**\n\n* `BOILERPLATE_MAGIC_LINKS_ENABLED` Set to `true` or `false` to toggle this feature\n* `BOILERPLATE_MAGIC_LINKS_SECRET` The secret used to encode the JWT token\n\n### Create thumbnails via Glide from asset presets \n\nStatamic's [REST content API](https://statamic.dev/rest-api) only returns full images and no thumbnails. We cannot\nuse the API of glide to create thumbnails because it requires a secure token which can only be created server-side. We *could* just disable\nthe requirement of such token in the config (see `/config/statamic/assets.php`), but this enables mass image resize attacks.\n\nAs a workaround, the addon provides a route `/thumbnail/{preset}/{imageAssetId}` to create a thumbnail using the\ngiven [asset preset](https://statamic.dev/image-manipulation#presets) and image id returned by the content API.\n\nAdd a `?urlOnly=1` query string to return the url to the resized image in the response instead of serving the thumbnail\ndirectly. Note that this only works if the [image manipulation cache](https://statamic.dev/image-manipulation#custom-path-static)\nis activated.\n\n**Usage**\n\n* Create a preset in `/config/statamic/assets.php`\n* Client: `base64` encode the image id returned by the content API and send the request.\n\n**Example**\n\nGiven the following response from the content API of an image\n\n```json\n{\n\"id\": \"images::paper-gd-01-1679495400.png\",\n\"url\": \"/assets/images/paper-gd-01-1679495400.png\",\n\"permalink\": \"https://my-url/assets/images/paper-gd-01-1679495400.png\",\n\"api_url\": \"https://my-url/api/assets/images/paper-gd-01-1679495400.png\"\n}\n```\n\nLoad a thumbnail in Vue or petite-vue:\n\n```vue\n\u003cimg :src=\"`/thumbnail/my-asset-preset/${btoa(asset.id)}`\"\u003e\n```\n\n### Multi site fixes\n\n* Always sets the entry of the default site as root of a newly created entry.\n* When creating a translation, all data is copied from the originated entry. Note: Only works when *Origin Behaviour* of\n  the collection is set to *Let the user select the origin*.\n* Temporarily solves [multisite bug](https://github.com/statamic/cms/issues/6714) where translations do not inherit\n  up-to-date data from origin entry.\n\n**Configuration**\n\nSet the following `env` variables to `true` to enable the fixes:\n\n* `BOILERPLATE_MULTISITE_SET_DATA_FROM_ORIGIN`\n* `BOILERPLATE_MULTISITE_UPDATE_CACHED_ORIGIN_OF_DESCENDANTS`\n\n### Tags\n\n* `{{ boilerplate:version }}` Outputs the version from the root `composer.json`\n\n\n## Installation\n\nExtend the `require` and `repositories` section of your `composer.json`:\n\n```\n\"require\": [\n    \"gridonic/statamic-boilerplate-addon\": \"^1.0\"\n],\n\"repositories\": [\n    {\n        \"type\": \"git\",\n        \"url\": \"https://github.com/gridonic/statamic-boilerplate-addon.git\"\n    }\n]\n```\n\nThen, run `composer update gridonic/statamic-boilerplate-addon` to actually install this addon.\n\n## Configuration\n\nThe addon publishes a config file located at `config/statamic/boilerplate.php`.\nMost configuration options can be set via environment variables.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgridonic%2Fstatamic-boilerplate-addon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgridonic%2Fstatamic-boilerplate-addon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgridonic%2Fstatamic-boilerplate-addon/lists"}