docs/For Developers documentation - #802
Conversation
cbutcosk
left a comment
There was a problem hiding this comment.
Hi @andy-jdl thanks for getting the ball rolling on this! I have some factual corrections for you here in addition to an overall suggestion that you more clearly distinguish between Configuration YAML and Configuration API by making each their own level 2 heading.
|
Happy Friday @cbutcosk, could I bother you for a review please and thank you. |
cbutcosk
left a comment
There was a problem hiding this comment.
@andy-jdl Thanks for your continued diligence on this -- just a few small fixes here! Mostly I do not recommend using the factory methods for shortcodes in particular and 11ty's solution (functional this for non-anonymous shortcodes) is my preferred integration method personally. That, along with pointing to the env var solutions directly are the only other hitches I noted.
| ├── _includes/ # Language agnostic templates consumed inline by other templates (including layouts) | ||
| ├── _layouts/ # Chainable language agnostic templates that wrap content via the layout front matter key | ||
| ├── _lib/ # Shared JS utility modules | ||
| ├── _patches/ # Patch files applied to node_modules automatically via the npm |
There was a problem hiding this comment.
Could you remove _patches here? It's an artifact that will be removed sometime soon (thegetty/quire#1283).
| | `input` | `eleventyConfig.setInputDirectory()` | string | Directory Eleventy scans to resolve templates. Defaults to `content`, or override with the `ELEVENTY_INPUT` environment variable. | | ||
| | `output` | `eleventyConfig.setOutputDirectory()` | string | Directory the built site is written to. Defaults to `_site`, or override with `ELEVENTY_OUTPUT`. | | ||
| | `data` | `eleventyConfig.setDataDirectory()` | string | Directory (relative to `input`) Eleventy resolves for data files. Defaults to `_computed`, or override with `ELEVENTY_DATA`. | | ||
| | `includes` | `eleventyConfig.setIncludesDirectory()` | string | Directory (relative to `input`) for templates consumed inline by other templates. Defaults to `../_includes`, or override with `ELEVENTY_INCLUDES`. | | ||
| | `layouts` | `eleventyConfig.setLayoutsDirectory()` | string | Directory (relative to `input`) Eleventy resolves for layout templates. Defaults to `../_layouts`, or override with `ELEVENTY_LAYOUTS`. | |
There was a problem hiding this comment.
| | `input` | `eleventyConfig.setInputDirectory()` | string | Directory Eleventy scans to resolve templates. Defaults to `content`, or override with the `ELEVENTY_INPUT` environment variable. | | |
| | `output` | `eleventyConfig.setOutputDirectory()` | string | Directory the built site is written to. Defaults to `_site`, or override with `ELEVENTY_OUTPUT`. | | |
| | `data` | `eleventyConfig.setDataDirectory()` | string | Directory (relative to `input`) Eleventy resolves for data files. Defaults to `_computed`, or override with `ELEVENTY_DATA`. | | |
| | `includes` | `eleventyConfig.setIncludesDirectory()` | string | Directory (relative to `input`) for templates consumed inline by other templates. Defaults to `../_includes`, or override with `ELEVENTY_INCLUDES`. | | |
| | `layouts` | `eleventyConfig.setLayoutsDirectory()` | string | Directory (relative to `input`) Eleventy resolves for layout templates. Defaults to `../_layouts`, or override with `ELEVENTY_LAYOUTS`. | | |
| | `input` | `ELEVENTY_INPUT` environment variable | string | Directory Eleventy scans to resolve templates. Defaults to `content`. | | |
| | `output` | `ELEVENTY_OUTPUT` environment variable | string | Directory the built site is written to. Defaults to `_site`. | | |
| | `data` | `ELEVENTY_DATA` environment variable | string | Directory (relative to `input`) Eleventy resolves for data files. Defaults to `_computed`. | | |
| | `includes` | `ELEVENTY_INCLUDES` environment variable | string | Directory (relative to `input`) for templates consumed inline by other templates. Defaults to `../_includes`. | | |
| | `layouts` | `ELEVENTY_LAYOUTS` environment variable | string | Directory (relative to `input`) Eleventy resolves for layout templates. Defaults to `../_layouts`. | |
| - `njk` | ||
|
|
||
| ### Eleventy Config | ||
| Shortcodes may be added via `eleventyConfig.addShortcode` and `eleventyConfig.addPairedShortcode` under the `.eleventy.js` config file. It is highly recommended to add shortcodes via Quire's Shortcode Plugin. |
There was a problem hiding this comment.
| Shortcodes may be added via `eleventyConfig.addShortcode` and `eleventyConfig.addPairedShortcode` under the `.eleventy.js` config file. It is highly recommended to add shortcodes via Quire's Shortcode Plugin. | |
| Shortcodes may be added via `eleventyConfig.addShortcode` and `eleventyConfig.addPairedShortcode` under the `.eleventy.js` config file. |
| Javascript | ||
| eleventyConfig.addShortcode("year", () => ${new Date().getFullYear()}) | ||
|
|
||
| njk |
| *Why use Quire's Shortcode Plugin*: | ||
| - Allows shortcodes to be registered identically across all supported template languages. | ||
| - Decouples shortcode logic from Eleventy's internal structure. |
There was a problem hiding this comment.
| *Why use Quire's Shortcode Plugin*: | |
| - Allows shortcodes to be registered identically across all supported template languages. | |
| - Decouples shortcode logic from Eleventy's internal structure. |
| ### Creating a shortcode | ||
| You should create your shortcodes under the `_plugins/shortcodes` directory. | ||
|
|
||
| After creating your component, register it by calling `addShortcode` or `addPairedShortcode` inside `_plugins/shortcodes/index.js`. |
There was a problem hiding this comment.
| ### Creating a shortcode | |
| You should create your shortcodes under the `_plugins/shortcodes` directory. | |
| After creating your component, register it by calling `addShortcode` or `addPairedShortcode` inside `_plugins/shortcodes/index.js`. |
Thank you for contributing to the Quire Documentation & Website! Please complete the form below to submit your pull request for review.
For the Title of this pull request, please use the format "Type/Issue-#: Brief description." For Type, the options are Edit, Add, Translate. Issue-# is only needed if this pull request addresses an existing issue.
Checklist
Please put an X within the brackets that apply
[X].I have read the CONTRIBUTING.md file.
I have made my changes in a new branch and not directly in the main branch
I am requesting feedback on a draft pull request
Is this pull request related to an open issue? If so, what is the issue number?
#531
Please describe the goal of this pull request and the changes that were made.
Documentation for developers
Additional Comments