{"bugs":{"url":"https://github.com/solidjs/solid-meta/issues"},"dist":{"shasum":"7c5765367b5167df970dd92d1889d4e262fae0bc","tarball":"https://registry.npmjs.org/solid-meta/-/solid-meta-0.27.0-rc.0.tgz","fileCount":4,"integrity":"sha512-9VCPUE3QwkUx4lgVmhU5BQQiydqB92V3eAtbh+zswgmeE2Y9po/4W2QNOE1ZRAR8zFaLcpj2zKh8GGOM6/XcJw==","signatures":[{"sig":"MEUCIGu6R67cei7AbALae7UPC4uJg+i4VaVnJXNtS9khTRxuAiEAjHU5EO9KR2uMaMf24UDfxyC0HvNZ9/kbvcdV24amrPk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1Y4KCRA9TVsSAnZWagAAFhwP/iZRCdaGIfQl/ce9cc9D\ny6Ks8QIMyLA2tRrL+MyyLSnA98RZ3BOoUgQd9DNPmwlfUTK0D6gAUPubVdMf\nM/wp4GsvWtwLbZ6b0pmltRBFKv6I5GpkDGWoCH3D3OAY6xPFvfK7xNTjAe6o\n6KVAm8iCu8b9D3H01GNka08tZaKwopQQIbg/R23tJ+9NSSzi4cTOJryUSnWa\nmDzgVT5ZgtNrG0clJof7yNIpYP7oXi3cJIjp932OCKOcHMJCvUjdZnCNix77\nia6GbJIIlTPtHSfTPTymKng5yLrpEle7Kt5zR/kMKmWPoXDVICL++vWesheQ\n9OwiqeZadBWsExrL+dq5C1CUTzGm8Ykv0EajEWqf0r55JJ2FFL+ajlZZ4Yu3\nHBJYagyR7R1KezOJhvP0C7kN+Mhgl94ituHxyDXY1v0Kcx7nA4uVNm/hPLHH\n8G2pWME6+ZL70gjgMelNTbKT4bBuR7ZHJD8G3OzYyDGTyJgjeXOMdTVsMYq4\n8zd/cUlvsGbp3txbATh8OhBVzCrAAWa3wC5MEwE+X5KCgMVcxvvPv420TCsT\ntim+811LiDiMKQiJlutiIOeACcZ2T1IPjooVEWeW0J4bsRNBEz2kGQBWwBPP\n9DXZeDDWx8QBF1p/4Ub1jJcQyoiq5oQtbGF51V4ezx9FLE1/tNmrGD+0uAhC\noOAC\r\n=4heG\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"preset":"solid-jest/preset/browser"},"main":"dist/index.js","name":"solid-meta","type":"module","types":"dist/index.d.ts","author":{"name":"Ryan Carniato"},"readme":"# solid-meta [![npm Version](https://img.shields.io/npm/v/solid-meta.svg?style=flat-square)](https://www.npmjs.org/package/solid-meta)\n\nAsynchronous SSR-ready Document Head management for Solid based on [React Head](https://github.com/tizmagik/react-head)\n\nFor Solid 1.0 use 0.27.x or greater.\nFor versions of Solid 0.x use 0.26.x.\n\n## Motivation\n\nThis module allows you to define `document.head` tags anywhere in your component hierarchy. The motivations are similar to [react-helmet](https://github.com/nfl/react-helmet) in that you may only have the information for certain tags contextually deep in your component hiearchy. There are no dependencies and it should work fine with asynchronous rendering.\n\n## Installation\n\n```sh\nnpm i solid-meta\n```\n\n## How it works\n\n1.  You wrap your App with `<MetaProvider />`\n1.  From the server, you pass `tags[]` array to `<MetaProvider />`\n1.  Then call `renderTags(tags)` and include in the `<head />` block of your server template\n1.  To insert head tags within your app, just render one of `<Title />`, `<Meta />`, `<Style />`, `<Link />`, and `<Base />` components as often as needed.\n\nOn the server, the tags are collected in the `tags[]` array, and then on the client the server-generated tags are removed in favor of the client-rendered tags so that SPAs still work as expected (e.g. in cases where subsequent page loads need to change the head tags).\n\n### Server setup\n\nWrap your app with `<MetaProvider />` on the server, using a `tags[]` array to pass down as part of your server-rendered payload. When rendered, the component mutates this array to contain the tags.\n\n```js\nimport { renderToString } from 'solid-js/web';\nimport { MetaProvider, renderTags } from 'solid-meta';\nimport App from './App';\n\n// ... within the context of a request ...\n\nconst tags = []; // mutated during render so you can include in server-rendered template later\nconst app = renderToString(\n  <MetaProvider tags={tags}>\n    <App />\n  </MetaProvider>\n);\n\nres.send(`\n  <!doctype html>\n    <head>\n      ${renderTags(tags)}\n    </head>\n    <body>\n      <div id=\"root\">${app}</div>\n    </body>\n  </html>\n`);\n```\n\n### Client setup\n\nThere is nothing special required on the client, just render one of head tag components whenever you want to inject a tag in the `<head />`.\n\n```js\nimport { MetaProvider, Title, Link, Meta } from 'solid-meta';\n\nconst App = () => (\n  <MetaProvider>\n    <div class=\"Home\">\n      <Title>Title of page</Title>\n      <Link rel=\"canonical\" href=\"http://solidjs.com/\" />\n      <Meta name=\"example\" content=\"whatever\" />\n      // ...\n    </div>\n  </MetaProvider>\n);\n```","exports":{".":{"solid":"./dist/index.jsx","default":"./dist/index.js"}},"gitHead":"95bcaf2bcb7fea9dcb82fd5c27b6efdedf17945e","license":"MIT","scripts":{"test":"jest && npm run test:types","build":"tsc && babel src/index.tsx --out-file dist/index.js","clean":"rimraf dist/","prebuild":"npm run clean","test:types":"tsc --project tsconfig.test.json"},"_npmUser":{"name":"ryansolid","email":"ryansolid@gmail.com"},"homepage":"https://github.com/solidjs/solid-meta#readme","repository":{"url":"git+https://github.com/solidjs/solid-meta.git","type":"git"},"_npmVersion":"7.6.0","description":"Write meta tags to the document head","directories":{},"maintainers":[{"name":"ryansolid","email":"ryansolid@gmail.com"}],"sideEffects":false,"_nodeVersion":"15.11.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","rimraf":"^3.0.2","solid-js":"^1.0.0-rc.9","@babel/cli":"^7.14.3","solid-jest":"0.0.3","typescript":"4.3.2","@babel/core":"7.14.3","@types/jest":"^26.0.23","@babel/preset-env":"7.14.4","babel-preset-solid":"^1.0.0-rc.9","@babel/preset-typescript":"7.13.0"},"peerDependencies":{"solid-js":">= 0.26.0"},"_npmOperationalInternal":{"tmp":"tmp/solid-meta_0.27.0-rc.0_1624608266107_0.8251991571130151","host":"s3://npm-registry-packages"},"_id":"solid-meta@0.27.0-rc.0","version":"0.27.0-rc.0"}