|
| 1 | +--- |
| 2 | +description: Guidelines for creating content for Vue.js A11y (posts, recipes and tips). |
| 3 | +--- |
| 4 | +# Posts guide |
| 5 | + |
| 6 | +## How to begin |
| 7 | + |
| 8 | +First of all, do a brief search to see if your post idea does not yet exist on the site. |
| 9 | + |
| 10 | +If you are looking for ideas, we have an [issue](https://github.com/vue-a11y/vue-a11y.com/issues/14) with several post ideas, feel free to reserve a subject. |
| 11 | + |
| 12 | +After checking, reserve your post by opening an issue using some of our templates: |
| 13 | + |
| 14 | +- [New Post/Article](https://github.com/vue-a11y/vue-a11y.com/issues/new?labels=Post&template=new-post.md&title=Post%2FArticle%3A+%5BYour+title%5D) |
| 15 | +- [New Widget (Recipe)](https://github.com/vue-a11y/vue-a11y.com/issues/new?labels=Recipe,Widget&template=new-widget.md&title=Recipe%28widget%29%3A+%5BYour+title%5D) |
| 16 | +- [New Tip (Recipe)](https://github.com/vue-a11y/vue-a11y.com/issues/new?labels=Recipe,Tip&template=new-tip.md&title=Recipe%28Tip%29%3A+%5BYour+title%5D) |
| 17 | + |
| 18 | +After booking a subject, fork the repository, follow the steps in our [README](https://github.com/vue-a11y/vue-a11y.com/blob/master/README.md) for installation. |
| 19 | + |
| 20 | +Create a markdown file in the specific post type directory and in the language in which the post will be written. |
| 21 | + |
| 22 | +For example in the English language: |
| 23 | + |
| 24 | +- `src/posts`: For blog posts; |
| 25 | +- `src/recipes/widgets`: For posting widgets; |
| 26 | +- `src/recipes/tips`: For quick tip posts; |
| 27 | + |
| 28 | +::: alert warning |
| 29 | +Follow the structure `2020-05-12-my-post.md` |
| 30 | +::: |
| 31 | + |
| 32 | +After completing, create a PR and request review from members for the latest adjustments and merge your post. |
| 33 | + |
| 34 | +## Frontmatter |
| 35 | + |
| 36 | +### Blog posts |
| 37 | + |
| 38 | +::: headerCode |
| 39 | +2020-05-12-my-post.md |
| 40 | +::: |
| 41 | +```yaml |
| 42 | +--- |
| 43 | +title: Post title # (Required) - between 50-65 characters |
| 44 | +description: Description of the post # (Required) - up to 155 characters |
| 45 | +summary: Summary of the post or tl;dr # (Optional) |
| 46 | +categories: Array of categories that match the post # (Required) |
| 47 | +tag: Array of tags that match the post # (Optional) |
| 48 | +author: author's nickname # (Optional) |
| 49 | +date: YYYY/MM/DD HH:ii:ss # (Required) |
| 50 | +--- |
| 51 | +``` |
| 52 | + |
| 53 | +::: alert warning |
| 54 | +Available categories: `[news, aria, wcag, tools, packages, spa, html]`. |
| 55 | +::: |
| 56 | + |
| 57 | +::: alert warning |
| 58 | +The tags have no limitations, you can create as many tags as you want `[screen-reader, form, ...]`. |
| 59 | +::: |
| 60 | + |
| 61 | +::: alert tip |
| 62 | +Add your author information `src/config/authors.json`, soon we will have a page dedicated to the authors of the site. |
| 63 | +::: |
| 64 | + |
| 65 | +## Best pratices |
| 66 | + |
| 67 | +- Use a correct hierarchy of headings; |
| 68 | +- Add the lang to the code blocks (highlight code); |
| 69 | +- Alternative text in images; |
| 70 | +- Write simply and understandably; |
| 71 | +- [Avoid wall of text](https://axesslab.com/accessibility-according-to-pwd/#wall-of-text); |
| 72 | +- Use lazy-load for iframes (IntersectObserver Component) |
| 73 | + |
| 74 | +## Using custom blocks |
| 75 | + |
| 76 | +### Figure + Blockquote + Figcaption |
| 77 | + |
| 78 | +::: headerCode |
| 79 | +::: |
| 80 | +``` |
| 81 | +:::: fig bq |
| 82 | +::: bq |
| 83 | +VuePress is composed of two parts: a minimalistic static site generator with a Vue-powered theming system and Plugin API, and a default theme optimized for writing technical documentation. |
| 84 | +::: |
| 85 | +::: figcap |
| 86 | +[Vuepress documentation](https://vuepress.vuejs.org/) |
| 87 | +::: |
| 88 | +:::: |
| 89 | +``` |
| 90 | + |
| 91 | +:::: fig bq |
| 92 | +::: bq |
| 93 | +VuePress is composed of two parts: a minimalistic static site generator with a Vue-powered theming system and Plugin API, and a default theme optimized for writing technical documentation. |
| 94 | +::: |
| 95 | +::: figcap |
| 96 | +[Vuepress documentation](https://vuepress.vuejs.org/) |
| 97 | +::: |
| 98 | +:::: |
| 99 | + |
| 100 | +### Tip, Note, Warning, Danger |
| 101 | + |
| 102 | +::: headerCode |
| 103 | +::: |
| 104 | +``` |
| 105 | +::: alert tip |
| 106 | +This is a tip |
| 107 | +::: |
| 108 | +
|
| 109 | +::: alert note |
| 110 | +This is a note |
| 111 | +::: |
| 112 | +
|
| 113 | +::: alert warning |
| 114 | +This is a warning |
| 115 | +::: |
| 116 | +
|
| 117 | +::: alert danger |
| 118 | +This is a danger |
| 119 | +::: |
| 120 | +``` |
| 121 | + |
| 122 | +::: alert tip |
| 123 | +This is a tip |
| 124 | +::: |
| 125 | + |
| 126 | +::: alert note |
| 127 | +This is a note |
| 128 | +::: |
| 129 | + |
| 130 | +::: alert warning |
| 131 | +This is a warning |
| 132 | +::: |
| 133 | + |
| 134 | +::: alert danger |
| 135 | +This is a danger |
| 136 | +::: |
| 137 | + |
| 138 | +### Figure + HeaderCode + Code block + Figcaption |
| 139 | + |
| 140 | +``` |
| 141 | +:::: fig code |
| 142 | +::: headerCode |
| 143 | +main.js |
| 144 | +::: |
| 145 | +``js |
| 146 | +import Vue from 'vue' |
| 147 | +import VueAnnouncer from '@vue-a11y/announcer' |
| 148 | + |
| 149 | +Vue.use(VueAnnouncer) |
| 150 | +`` |
| 151 | +::: figcap |
| 152 | +Basic usage of Vue announcer |
| 153 | +::: |
| 154 | +:::: |
| 155 | +``` |
| 156 | + |
| 157 | +:::: fig code |
| 158 | +::: headerCode |
| 159 | +main.js |
| 160 | +::: |
| 161 | +```js |
| 162 | +import Vue from 'vue' |
| 163 | +import VueAnnouncer from '@vue-a11y/announcer' |
| 164 | + |
| 165 | +Vue.use(VueAnnouncer) |
| 166 | +``` |
| 167 | +::: figcap |
| 168 | +Basic usage of Vue announcer |
| 169 | +::: |
| 170 | +:::: |
| 171 | + |
| 172 | +### headerCode + Code block |
| 173 | + |
| 174 | +``` |
| 175 | +::: headerCode |
| 176 | +main.js |
| 177 | +::: |
| 178 | +``js |
| 179 | +import Vue from 'vue' |
| 180 | +import VueAnnouncer from '@vue-a11y/announcer' |
| 181 | + |
| 182 | +Vue.use(VueAnnouncer) |
| 183 | +`` |
| 184 | +``` |
| 185 | + |
| 186 | +::: headerCode |
| 187 | +main.js |
| 188 | +::: |
| 189 | +```js |
| 190 | +import Vue from 'vue' |
| 191 | +import VueAnnouncer from '@vue-a11y/announcer' |
| 192 | + |
| 193 | +Vue.use(VueAnnouncer) |
| 194 | +``` |
| 195 | + |
| 196 | +## Vue in markdown |
| 197 | + |
| 198 | +### IntersectionObserver component |
| 199 | + |
| 200 | +Use this component for lazy-load of iframes, images, among other media. |
| 201 | + |
| 202 | +```vue |
| 203 | +<intersection-observer> |
| 204 | + <template v-slot="data"> |
| 205 | + <iframe |
| 206 | + v-if="data.show" |
| 207 | + src="https://caniuse.bitsofco.de/embed/index.html?feat=hidden&periods=future_1,current,past_1,past_2" |
| 208 | + height="420" |
| 209 | + allowfullscreen="true" |
| 210 | + style="width: 100%"> |
| 211 | + </iframe> |
| 212 | + </template> |
| 213 | +</intersection-observer> |
| 214 | +``` |
0 commit comments