{"_id":"@by-association-only/slate-sections-plugin","_rev":"3-f87cc213bf4f3e6084d3c2f34b86d004","name":"@by-association-only/slate-sections-plugin","dist-tags":{"latest":"1.0.0-beta.17.3"},"versions":{"1.0.0-beta.17":{"name":"@by-association-only/slate-sections-plugin","version":"1.0.0-beta.17","license":"MIT","_id":"@by-association-only/slate-sections-plugin@1.0.0-beta.17","maintainers":[{"name":"dangamble","email":"dangamble89@gmail.com"}],"dist":{"shasum":"6ecdb19ad32ae2f7e47ab8a97ac4476d2e61a338","tarball":"https://registry.npmjs.org/@by-association-only/slate-sections-plugin/-/slate-sections-plugin-1.0.0-beta.17.tgz","fileCount":22,"integrity":"sha512-gKI+CGQKcL/OgZndU6qcmwSwXa69mjWYK/A45GfQVx+yik5wIzuNf3M8aSuW7epWMWmYowWaYTu/MJ7bqSShCA==","signatures":[{"sig":"MEUCIHsBJ7OAdPbS9ZNeiuwqRjVfkE79DM0mSv7zU7/czSk6AiEA9avcZnUd3Tdi6dmKe4g9DIX/dTMfIPJqiJJxY4J2/pY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgSoqCRA9TVsSAnZWagAAgjQP/06iui9A9/u7FAjunZKP\ngRM2zQiaoQ1gWm5SGYedPh7YBiLKfycc+VcK5zZlDZoxLdrKzI6zzdQ9HsU7\n/tijNWXDwuC/qPC4O7dKShuYJAaiSFxZ8I+HfXXWyuVerhi14jXMYObCgaLx\nEFMa8ZooA11/U3g9p9jhPIIcmQ4OG5hanFpFoGX5Q47KrqYWSqo72gyyq6oc\nI+x0WrKn3XMEN4IR0bnEY9cn6zoEzN99Wpm+S36eyijqQDTpt9Ww5uNFnY1/\nSrN0RIHaKVTM0n9lsnL06eZd8Q5WzegVdror4RlZ1QVnp6+KzE0TcqFeoYvU\nzuPs+VBPFOI99CzLA7DFeS9D8zk4I2vHHEX86VrBHFrbU2o6sOU7rgx8GjGs\n7LSEfpEdu3uVsPdX4Ah4aIP+zedTW8SUW0Z0PqCGVTb8SMpXMUXXFLZ2akTD\naRV4+4MJ26chP/V+ko7sj8LYYXWZ1Serrvt08exV4nz1RI+JslyJXOFDBG0N\nhEdJ00GxvvqbalOtRc+lq7z5RPem5HrOLGU3IViQ9DgC9CCm6MmFQlbn550p\nRgpSMUcgzu5HGonWmMCyyMoiCJxVRORxvMr5C3p6hf22SrnR34oX3qMW8G0A\n2LujHIXhPMbJVgOTALpUQpS9dDiaBGKcsUo8ZY5Fku7r2vkiIagaGhFdXX1c\nla1A\r\n=9mZ2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"3b7b6bb1c8a6ea6631d45c268ae27f0e5b626871","scripts":{"test":"jest"},"_npmUser":{"name":"dangamble","email":"dangamble89@gmail.com"},"_npmVersion":"lerna/3.11.0/node@v11.10.1+x64 (darwin)","description":"The plugin allows developers to create Shopify theme sections from a variety of files contained in a folder, and combines these files into a single Liquid section file for use on Shopify servers.","directories":{},"_nodeVersion":"11.10.1","dependencies":{"path":"^0.12.7","lodash":"^4.17.11","fs-extra":"^7.0.1","webpack-sources":"^1.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^24.1.0","webpack":"^4.29.3","memory-fs":"^0.4.1","babel-jest":"^24.1.0","babel-preset-env":"^1.7.0"},"_npmOperationalInternal":{"tmp":"tmp/slate-sections-plugin_1.0.0-beta.17_1551968809484_0.99103360887886","host":"s3://npm-registry-packages"}},"1.0.0-beta.17.3":{"name":"@by-association-only/slate-sections-plugin","version":"1.0.0-beta.17.3","license":"MIT","_id":"@by-association-only/slate-sections-plugin@1.0.0-beta.17.3","maintainers":[{"name":"dangamble","email":"dangamble89@gmail.com"}],"dist":{"shasum":"daa8ffa84c301bd2aefa0a96be10665f036d0c2a","tarball":"https://registry.npmjs.org/@by-association-only/slate-sections-plugin/-/slate-sections-plugin-1.0.0-beta.17.3.tgz","fileCount":22,"integrity":"sha512-m1TXcgich24/Kb3HKXWEo5rzKCDS9dmQjmAyXBypFAyMnhjlEd8wU77RR1TsEBPJtzaWiY2LTaErR4CghIWtvQ==","signatures":[{"sig":"MEUCIQDDeIHHhTOxI4boPHe0UkamHMpi5i5LI+Lp718J/tCGVgIgcxCU9uZ1RdNfnzsF4xQFDVLmaw2pZX9Z3gBB1geRf6U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25073,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgStwCRA9TVsSAnZWagAAGKkP/0Jv5nUPjneVg4aOhkh1\nf3cZaPor4eMrmoDlgUFq9UX7HbKVzswaRDolA/6wqD48Ao1OCgjRFe68hJTI\nZyrtVs0/jMSLT1iPfqsDyLkXS+UnoBGvGCo8hUkf/zySOoOqXYPGn2mTfRXl\navy/UH3NB5+AD69HUQQQhBwVqgFW4DR9vNA5hMERaCvX5/WMd7cGz/T3wTIS\nci1QhQy4s8V3HvO4S0Flw7kE2CrKjiTwrf8pmKqvOFZjoHyrTjF4/bX9O1Sg\nFqp4T1FKDjzd9ziX8zT7gkllPzcwinq2w9U1k+m0FZv66RiNPVodx5Lzp5DG\nDUGSkBGZwnWeqSqDbP/mAXiphhMInWqi+b1LxI6sMzVQc8AsXmXQOs4iiqkm\n+eQ8u/eR2XuTcye20iLjwPwfxkxeLnT7n3D9x1nnHzBUsyoumMLTLtjwF3vv\nlyctdY7WSorkAndeevXaEU04KGrn3utPd3NS9sOvSY1o0RrdFpp63wPeMNBP\npbJCZ1wUG81ZpiFxB1w3T0yMzyjvt3gVdUgkuFrX6UlGKWjrRTZntuH+p/Yf\nx/l2K18NhKb24rj99oR7UP+B2OcdNA8OcFPNfyPl81gPVNz7O23QZ5EjkM54\nix+R/0Ez228rrBIJO/27IUPP2ZPqTkwI6XqygFnueSLDGUXfGs7xEklfC0Qj\nxuJ/\r\n=A+eA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"748f5149cd58abe2ad2b1f902e6d02cd04b83ce7","scripts":{"test":"jest"},"_npmUser":{"name":"dangamble","email":"dangamble89@gmail.com"},"_npmVersion":"lerna/3.11.0/node@v11.10.1+x64 (darwin)","description":"The plugin allows developers to create Shopify theme sections from a variety of files contained in a folder, and combines these files into a single Liquid section file for use on Shopify servers.","directories":{},"_nodeVersion":"11.10.1","dependencies":{"path":"^0.12.7","lodash":"^4.17.11","fs-extra":"^7.0.1","webpack-sources":"^1.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^24.1.0","webpack":"^4.29.3","memory-fs":"^0.4.1","babel-jest":"^24.1.0","babel-preset-env":"^1.7.0"},"_npmOperationalInternal":{"tmp":"tmp/slate-sections-plugin_1.0.0-beta.17.3_1551969135807_0.4037634043365239","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-03-07T14:26:49.279Z","modified":"2025-02-19T09:06:08.724Z","1.0.0-beta.17":"2019-03-07T14:26:49.688Z","1.0.0-beta.17.3":"2019-03-07T14:32:15.923Z"},"license":"MIT","description":"The plugin allows developers to create Shopify theme sections from a variety of files contained in a folder, and combines these files into a single Liquid section file for use on Shopify servers.","maintainers":[{"email":"dan@bao.agency","name":"dangamble"},{"email":"m.p.england@gmail.com","name":"eng9911"}],"readme":"# @by-association-only/slate-sections-plugin\n\nThe plugin allows developers to create Shopify theme sections from a variety of files contained in a folder, and combines these files into a single Liquid section file for use on Shopify servers.\n\n## Getting Started\n\nFirst install the plugin\n\n```\nnpm install @by-association-only/slate-sections-plugin --save-dev\n```\n\nor\n\n```\nyarn add @by-association-only/slate-sections-plugin --dev\n```\n\nThen add it to your webpack config, an example below.\n\n```js\nconst SlateSectionsPlugin = require('@by-association-only/slate-sections-plugin');\n\nconst slateSectionsOptions = {\n  from: '/absolute/path/to/sections/source',\n  to: '/absolute/path/to/sections/output',\n};\n\nmodule.exports = {\n  plugins: [new SlateSectionsPlugin({slateSectionsOptions})],\n};\n```\n\n## Options\n\n| Option              | Required? | Type   | Default           | Description                                                                                                                                                       |\n| ------------------- | --------- | ------ | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| from                | Yes       | String | undefined         | The absolute path to the folder containing your sections, typically ./src/sections                                                                                |\n| to                  | Yes       | String | undefined         | The absolute path to the folder where your sections will be outputted to, typically ./dist/sections                                                               |\n| genericTemplateName | No        | String | 'template.liquid' | If you're using the 'Sections as Folders' structure, your template names by default need to be 'template.liquid'. You may change this value if you would like to. |\n\n## Sections as Liquid Files\n\nYou may structure your sections folder by creating separate Liquid files for each section:\n\n```bash\n./sections\n├── blog-posts.liquid\n├── collection-list.liquid\n├── featured-collection.liquid\n├── featured-product.liquid\n├── footer.liquid\n├── header.liquid\n├── image-with-text.liquid\n├── newsletter.liquid\n├── product.liquid\n└── rich-text.liquid\n```\n\nThis structure simply tells the plugin to copy the Liquid files into the `./dist` sections folder\n\n## Sections as Folders\n\nYou can separate a schema from your Liquid template by creating a folder for each section. This increases maintainability and provides syntax highlighting for your JSON schema objects.\n\nIn order to have separate schema files, you must create a folder for the section and within that folder create a `template.liquid` file which will take the same name as the directory it will live in. You may optionally create a `schema.json` file containing the section's settings, which will be appended to the Liquid template inside of `{% schema %}` tags.\n\n### Example\n\n```bash\n./sections/article-template\n├── schema.json\n└── template.liquid\n```\n\nThis will create an `article-template.liquid` with the contents of the `template.liquid` file and with JSON wrapped in `{% schema %}` tags, which will be copied over to the `./dist` sections folder.\n\n## Translations\n\nIf you need settings in your schema that require multiple translations, you can specify this by doing the following:\n\n```json\n{\n  \"name\": {\n    \"de\": \"Posts\",\n    \"en\": \"Posts\",\n    \"es\": \"Publicaciones\",\n    \"fr\": \"Articles\",\n    \"it\": \"Articoli\",\n    \"ja\": \"投稿\",\n    \"pt-BR\": \"posts\"\n  },\n  \"settings\": [\n    {\n      \"type\": \"checkbox\",\n      \"id\": \"image_parallax\",\n      \"label\": {\n        \"de\": \"Parallax-Animation für Bild anzeigen\",\n        \"en\": \"Show image parallax animation\",\n        \"es\": \"Mostrar animación de paralaje de imagen\",\n        \"fr\": \"Afficher l'animation en parallaxe\",\n        \"it\": \"Mostra animazione parallasse immagine\",\n        \"ja\": \"画像のパララックスアニメーションを表示する\",\n        \"pt-BR\": \"Exibir animação de paralaxe da imagem\"\n      }\n    }\n  ]\n}\n```\n\nHowever, as the number of theme languages add up over time, and when you have many settings that require translations, this can result in a very large JSON file which becomes difficult to maintain. This plugin allows you to separate the translations into separate locale files allowing for easier maintainability for your theme's translations.\n\nFirst you specify the schema's structure in `schema.json`:\n\n```json\n{\n  \"name\": {\n    \"t\": \"name\"\n  },\n  \"settings\": [\n    {\n      \"type\": \"checkbox\",\n      \"id\": \"image_parallax\",\n      \"label\": {\n        \"t\": \"settings.image_parallax.label\"\n      }\n    }\n  ]\n}\n```\n\nFor every key with multiple translations you specify an object with a `t` key and its value is the key to retrieve the translation from a different JSON object as the one shown below. You would have a translation object such as the one below for every language you would like to support:\n\n```json\n{\n  \"name\": \"Posts\",\n  \"settings\": {\n    \"image_parallax\": {\n      \"label\": \"Show image parallax animation\",\n      \"info\": \"Only shows on desktop\"\n    }\n  }\n}\n```\n\nThe plugin will take care of combining all the translations into an object such as the one displayed initially. To specify the locale code of your JSON file, you must name it [`localecode`].json\n\nBelow is an example of what your section's folder may look like:\n\n```json\n./sections/article-template\n├── locales\n│   ├── de.json\n│   ├── en.json\n│   ├── es.json\n│   ├── fr.json\n│   ├── it.json\n│   ├── ja.json\n│   └── pt-BR.json\n├── schema.json\n└── template.liquid\n```\n\nThis will all get combined and outputted into a single `article-template.liquid`.\n","readmeFilename":"README.md"}