{"id":21319533,"url":"https://github.com/simplajs/simpla-link","last_synced_at":"2025-12-12T04:24:42.739Z","repository":{"id":58242886,"uuid":"88343097","full_name":"simplajs/simpla-link","owner":"simplajs","description":"Turn anything into an editable link","archived":false,"fork":false,"pushed_at":"2017-12-15T05:48:02.000Z","size":128,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-11T19:29:59.270Z","etag":null,"topics":["content-management","custom-element","editable","link","simpla","web-component"],"latest_commit_sha":null,"homepage":"https://www.simplajs.org","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simplajs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-15T11:36:43.000Z","updated_at":"2023-09-08T17:23:42.000Z","dependencies_parsed_at":"2022-08-31T00:41:13.861Z","dependency_job_id":null,"html_url":"https://github.com/simplajs/simpla-link","commit_stats":null,"previous_names":["simplaelements/simpla-link"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplajs%2Fsimpla-link","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplajs%2Fsimpla-link/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplajs%2Fsimpla-link/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplajs%2Fsimpla-link/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplajs","download_url":"https://codeload.github.com/simplajs/simpla-link/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225795416,"owners_count":17525316,"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":["content-management","custom-element","editable","link","simpla","web-component"],"created_at":"2024-11-21T19:42:41.781Z","updated_at":"2025-12-12T04:24:42.698Z","avatar_url":"https://github.com/simplajs.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simpla Link\n[![Build status][travis-badge]][travis-url] ![Size][size-badge] ![Version][bower-badge] [![Published][webcomponents-badge]][webcomponents-url]\n\nSimpla-link is an editable anchor that you can update inline on your page. You can wrap any other HTML element with it just as you would a regular `\u003ca\u003e`. It's built on the [Simpla][simpla] content system. \n\n\u003c!---\n```\n\u003ccustom-element-demo\u003e\n  \u003ctemplate\u003e\n    \u003cscript src=\"../webcomponentsjs/webcomponents-lite.js\"\u003e\u003c/script\u003e\n    \u003clink rel=\"import\" href=\"simpla-link.html\"\u003e\n\n    \u003cscript src=\"https://unpkg.com/simpla@^2.0.0\"\u003e\u003c/script\u003e\n    \u003cscript\u003e\n      Simpla.init('local');\n      Simpla.editable(true);\n    \u003c/script\u003e\n\n    \u003cstyle\u003e\n      body {\n        height: 5rem;\n      }\n      simpla-link {\n        margin: 2rem 0 0 2rem;\n      }\n    \u003c/style\u003e\n    \u003cnext-code-block\u003e\u003c/next-code-block\u003e\n  \u003c/template\u003e\n\u003c/custom-element-demo\u003e\n```\n--\u003e\n```html\n\u003csimpla-link path=\"/link\"\u003e\n  Next page \u003e\n\u003c/simpla-link\u003e\n```\n\n### Contents\n\n- [Installation and setup](#installation-and-setup)\n- [Editing content](#editing-content)\n- [Saving content](#saving-content)\n- [Initializing with static content](#initializing-with-static-content)\n- [Custom placeholders](#custom-placeholders)\n- [Readonly](#readonly)\n- [Contributing](#contributing)\n\n### Resources\n\n- [API reference][api]\n- [Demo][demo]\n- [License][license]\n\n## Installation and setup\n\nInstall simpla-link with Bower (Yarn support coming soon)\n\n```sh\n$ bower i simpla-link --save\n```\n\n[Setup Simpla][simpla-setup] on your page, then import simpla-link into your `\u003chead\u003e`\n\n```html\n\u003clink rel=\"import\" href=\"/bower_components/simpla-link/simpla-link.html\"\u003e\n```\n\nWrap the content you want to link with `\u003csimpla-link\u003e`. Give each link a unique `path`, where it will store its data in your project\n\n```html\n\u003csimpla-link path=\"/link\"\u003e\n  Next page \u003e\n\u003c/simpla-link\u003e\n```\n\nSimpla link plays nicely with other Simpla elements, so you can linkify editable content\n\n```html\n\u003csimpla-link path=\"/button\"\u003e\n  \u003csimpla-text path=\"/button/label\" plaintext\u003e\u003c/simpla-text\u003e \n\u003c/simpla-link\u003e\n```\n\n## Editing content\n\nEdit a simpla-link by entering edit mode with Simpla (which makes all Simpla elements on a page editable) or setting the `editable` property directly on an element.\n\n```js\n// Enter edit mode\nSimpla.editable(true);\n```\n\n```html\n\u003c!-- Make only this image editable --\u003e\n\u003csimpla-link path=\"/link\" editable\u003e\u003c/simpla-link\u003e\n```\n\nEntering edit mode with Simpla is the recommended way to edit links. It ensures all elements on a page remain in sync and updates Simpla's public `editable` state, which other elements may rely on.\n\n## Saving content\n\nSave a simpla-link by calling Simpla's `save()` method, which saves all modified content on the page. It returns a promise.\n\n```js\n// Save all modified Simpla content\nSimpla.save();\n```\n\n\u003e You must be authenticated with Simpla before saving content\n\n## Initializing with static content\n\nYou can set the `href` of simpla-link just like you would with a regular `\u003ca\u003e`. If content for the link's path exists on Simpla's API, the locally set `href` will be overwritten\n\n```html\n\u003csimpla-link href=\"https://google.com\" path=\"/link\"\u003e\n  Visit google\n\u003c/simpla-link\u003e\n```\n\nInitializing with static content is useful for converting existing links and buttons to Simpla links, or bootstrapping a project with predefined content. By setting `href` and then calling `Simpla.save()` you can easily set content directly to Simpla.\n\n\u003e Since static content is overwritten by remote data, you should not have a href set in production\n\n## Custom placeholders\n\nYou can set a custom placeholder for the link input prompt with a `placeholder` attribute\n\n```html\n\u003csimpla-link path=\"/link\" placeholder=\"URL for next page\"\u003e\n  Next page \u003e\n\u003c/simpla-link\u003e\n```\n\n## Readonly\n\nSimpla-link has a `readonly` property that stops it from becoming editable, even if Simpla is in edit mode or you try to set `editable` on the element directly. This is useful for using simpla-link to purely consume and display content from Simpla's API.\n\n```html\n\u003csimpla-link path=\"/link\" readonly\u003e\n  Next page \u003e\n\u003c/simpla-link\u003e\n```\n\n\n## Contributing\n\nIf you find any issues with simpla-link please report them! If you'd like to see a new feature in supported file an issue. We also happily accept PRs. \n\n***\n\nMIT © [Simpla][simpla]\n\n[simpla]: https://www.simpla.io\n[simpla-setup]: https://www.simpla.io/docs/guides/get-started\n\n[api]: https://www.webcomponents.org/element/simplaio/simpla-link/page/API.md\n[demo]: https://www.webcomponents.org/element/simplaio/simpla-link/demo/demo/index.html\n[license]: https://github.com/simplaio/simpla-link/blob/master/LICENSE\n\n[bower-badge]: https://img.shields.io/bower/v/simpla-link.svg\n[bowerlicense-badge]: https://img.shields.io/bower/l/simpla-link.svg\n[travis-badge]: https://img.shields.io/travis/simplaio/simpla-link.svg\n[travis-url]: https://travis-ci.org/simplaio/simpla-link\n[size-badge]: https://badges.herokuapp.com/size/github/simplaio/simpla-link/master/simpla-link.html?gzip=true\n[webcomponents-badge]: https://img.shields.io/badge/webcomponents.org-published-blue.svg\n[webcomponents-url]: https://www.webcomponents.org/element/simplaio/simpla-link\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplajs%2Fsimpla-link","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplajs%2Fsimpla-link","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplajs%2Fsimpla-link/lists"}