diff --git a/src/components/LeftSidebar/LeftSidebar.astro b/src/components/LeftSidebar/LeftSidebar.astro index a31ec54..ecc531b 100644 --- a/src/components/LeftSidebar/LeftSidebar.astro +++ b/src/components/LeftSidebar/LeftSidebar.astro @@ -1,11 +1,13 @@ --- import { getLanguageFromURL } from '../../languages'; -import { SIDEBAR } from '../../config'; -const { currentPage } = Astro.props; +import { SIDEBARS } from '../../config'; +const { currentPage, frontmatter } = Astro.props; const currentPageMatch = currentPage.slice(1); const langCode = getLanguageFromURL(currentPage); +const sidebarType = frontmatter.sidebarType ?? 'default'; + // SIDEBAR is a flat array. Group it by sections to properly render. -const sidebarSections = SIDEBAR[langCode].reduce((col, item, i) => { +const sidebarSections = SIDEBARS[sidebarType][langCode].reduce((col, item, i) => { // If the first item is not a section header, create a new container section. if (i === 0) { if (!item.header) { diff --git a/src/config.ts b/src/config.ts index 5c96c29..d4325cb 100644 --- a/src/config.ts +++ b/src/config.ts @@ -31,26 +31,40 @@ export const GITHUB_EDIT_URL = `https://github.com/${GITHUB_REPO}/blob/main/`; // apiKey: 'XXXXXXXXXX', // } -export const SIDEBAR = { - en: [ - { text: '', header: true }, - { text: 'Mission', link: 'en/docs/mission' }, - { text: 'Projects', link: 'en/projects' }, - { text: 'Roles', link: 'https://github.com/email-markup-consortium/email-markup-consortium/blob/main/roles-and-responsibilities.md' }, - { text: 'Code of Conduct', link: 'https://github.com/email-markup-consortium/email-markup-consortium/blob/main/code-of-conduct.md' }, - - { text: 'Help', header: true }, - { text: 'Contribute', link: 'en/how-to-help' }, - { text: 'Sponsor', link: 'en/sponsors' }, - - { text: 'Docs', header: true }, - { text: 'Glossary', link: 'en/docs/glossary' }, - { text: 'Vision', link: 'en/docs/vision' }, - { text: 'Benefits', link: 'en/docs/benefits' }, - { text: 'Compliant Standards', link: 'en/docs/compliant-standards' }, - - { text: 'Reports', header: true }, - { text: 'Accessibility', link: 'en/reports/accessibility' }, - { text: 'Email Clients', link: 'en/reports/email-clients' }, - ], +export const SIDEBARS = { + default: { + en: [ + { text: '', header: true }, + { text: 'Mission', link: 'en/docs/mission' }, + { text: 'Projects', link: 'en/projects' }, + { text: 'Roles', link: 'https://github.com/email-markup-consortium/email-markup-consortium/blob/main/roles-and-responsibilities.md' }, + { text: 'Code of Conduct', link: 'https://github.com/email-markup-consortium/email-markup-consortium/blob/main/code-of-conduct.md' }, + + { text: 'Help', header: true }, + { text: 'Contribute', link: 'en/how-to-help' }, + { text: 'Sponsor', link: 'en/sponsors' }, + + { text: 'Docs', header: true }, + { text: 'Glossary', link: 'en/docs/glossary' }, + { text: 'Vision', link: 'en/docs/vision' }, + { text: 'Benefits', link: 'en/docs/benefits' }, + { text: 'Compliant Standards', link: 'en/docs/compliant-standards' }, + + { text: 'Reports', header: true }, + { text: 'Accessibility', link: 'en/reports/accessibility' }, + { text: 'Email Clients', link: 'en/reports/email-clients' } + ], + }, + + sanitizer: { + en: [ + { text: '', header: true }, + { text: 'Back', link: 'en/docs/' }, + + { text: 'Sanitizer', header: true }, + { text: 'Intro', link: 'en/docs/sanitizer' }, + { text: 'Handling', link: 'en/docs/sanitizer/handling' }, + { text: 'Features', link: 'en/docs/sanitizer/features' }, + ], + } }; diff --git a/src/content/sanitizer/features/css/at-rules/counter-style.md b/src/content/sanitizer/features/css/at-rules/counter-style.md new file mode 100644 index 0000000..faaf30f --- /dev/null +++ b/src/content/sanitizer/features/css/at-rules/counter-style.md @@ -0,0 +1,7 @@ +--- +title: "@counter-style" +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/css/at-rules/font-face.md b/src/content/sanitizer/features/css/at-rules/font-face.md new file mode 100644 index 0000000..15eb01f --- /dev/null +++ b/src/content/sanitizer/features/css/at-rules/font-face.md @@ -0,0 +1,7 @@ +--- +title: "@font-face" +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/css/at-rules/keyframes.md b/src/content/sanitizer/features/css/at-rules/keyframes.md new file mode 100644 index 0000000..4cc3e93 --- /dev/null +++ b/src/content/sanitizer/features/css/at-rules/keyframes.md @@ -0,0 +1,7 @@ +--- +title: "@keyframes" +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/css/at-rules/layer.md b/src/content/sanitizer/features/css/at-rules/layer.md new file mode 100644 index 0000000..f63a273 --- /dev/null +++ b/src/content/sanitizer/features/css/at-rules/layer.md @@ -0,0 +1,7 @@ +--- +title: "@layer" +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/css/at-rules/media.md b/src/content/sanitizer/features/css/at-rules/media.md new file mode 100644 index 0000000..e40ce3e --- /dev/null +++ b/src/content/sanitizer/features/css/at-rules/media.md @@ -0,0 +1,7 @@ +--- +title: "@media" +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/css/at-rules/property.md b/src/content/sanitizer/features/css/at-rules/property.md new file mode 100644 index 0000000..f27e171 --- /dev/null +++ b/src/content/sanitizer/features/css/at-rules/property.md @@ -0,0 +1,7 @@ +--- +title: "@property" +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/css/at-rules/supports.md b/src/content/sanitizer/features/css/at-rules/supports.md new file mode 100644 index 0000000..c0176c3 --- /dev/null +++ b/src/content/sanitizer/features/css/at-rules/supports.md @@ -0,0 +1,7 @@ +--- +title: "@supports" +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/css/properties/color.md b/src/content/sanitizer/features/css/properties/color.md new file mode 100644 index 0000000..dea7b0f --- /dev/null +++ b/src/content/sanitizer/features/css/properties/color.md @@ -0,0 +1,7 @@ +--- +title: color +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/css/values/calc.md b/src/content/sanitizer/features/css/values/calc.md new file mode 100644 index 0000000..fa1bb9f --- /dev/null +++ b/src/content/sanitizer/features/css/values/calc.md @@ -0,0 +1,7 @@ +--- +title: calc() +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/css/values/clamp.md b/src/content/sanitizer/features/css/values/clamp.md new file mode 100644 index 0000000..d4f6d3d --- /dev/null +++ b/src/content/sanitizer/features/css/values/clamp.md @@ -0,0 +1,7 @@ +--- +title: clamp() +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/css/values/counters.md b/src/content/sanitizer/features/css/values/counters.md new file mode 100644 index 0000000..9653608 --- /dev/null +++ b/src/content/sanitizer/features/css/values/counters.md @@ -0,0 +1,7 @@ +--- +title: counters(), counter() +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/css/values/linear-gradient.md b/src/content/sanitizer/features/css/values/linear-gradient.md new file mode 100644 index 0000000..40b0501 --- /dev/null +++ b/src/content/sanitizer/features/css/values/linear-gradient.md @@ -0,0 +1,7 @@ +--- +title: linear-gradient() +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/css/values/max.md b/src/content/sanitizer/features/css/values/max.md new file mode 100644 index 0000000..85c2f7f --- /dev/null +++ b/src/content/sanitizer/features/css/values/max.md @@ -0,0 +1,7 @@ +--- +title: max() +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/css/values/min.md b/src/content/sanitizer/features/css/values/min.md new file mode 100644 index 0000000..2aebefe --- /dev/null +++ b/src/content/sanitizer/features/css/values/min.md @@ -0,0 +1,7 @@ +--- +title: min() +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/css/values/radialgradient.md b/src/content/sanitizer/features/css/values/radialgradient.md new file mode 100644 index 0000000..141d74b --- /dev/null +++ b/src/content/sanitizer/features/css/values/radialgradient.md @@ -0,0 +1,7 @@ +--- +title: radial-gradient() +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/css/values/rgb.md b/src/content/sanitizer/features/css/values/rgb.md new file mode 100644 index 0000000..08c5349 --- /dev/null +++ b/src/content/sanitizer/features/css/values/rgb.md @@ -0,0 +1,7 @@ +--- +title: rgb(), rgba() +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/css/values/var.md b/src/content/sanitizer/features/css/values/var.md new file mode 100644 index 0000000..3a03902 --- /dev/null +++ b/src/content/sanitizer/features/css/values/var.md @@ -0,0 +1,7 @@ +--- +title: var() +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/html/elements/a.md b/src/content/sanitizer/features/html/elements/a.md new file mode 100644 index 0000000..b53762d --- /dev/null +++ b/src/content/sanitizer/features/html/elements/a.md @@ -0,0 +1,88 @@ +--- +title: ": The Anchor element" +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + +The `` element creates a hyperlink to anything a URL can address including web pages. + + +## Attributes + +- `download` +- `href` +- `hreflang` +- `ping` +- `referrerpolicy` +- `rel` +- `target` + + +## Recommendation + +It is highly recommended for an email client to support the `` element. However, special care needs to be taken with the element's attributes and their values as it has direct impact on the users' security and privacy. + +### download + +The Email Markup Consortium does not have an official recommendation at this stage. + + +### href + +The value of the `href` attribute represent a URL. This could be a HTTP-based URL, or a URI scheme supported by browsers such as `mailto:` and `tel:`. + +Some URI schemes are [officially registered with Internet Assigned Numbers Authority (IANA)](https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml). There are other unofficial, but common URI schemes such as `app:`. + +The fact that a URI scheme is registered with IANA is not enough to determine the scheme is safe to be fully supported by an email client. The `mailto:` URI scheme is a good example of [how fully supporting a registered URI scheme](https://www.zdnet.com/article/some-email-clients-are-vulnerable-to-attacks-via-mailto-links/) is not a wise approach as it can be abused by malicious attackers. + +While the `href` is needed to make the `` useful, the Email Markup Consortium does not currently have an official stance on what URI schemes should be considered safe. It is out of this project's scope at this stage. + + +### hreflang + +The `hreflang` attribute and its allowed values can be safely supported. + + +### ping + +The use of the `ping` attribute, while safe, is a privacy concern as it can be used for tracking the user. In fact, this feature is disabled by default on Firefox for this reason. + +However, marketing emails heavily use "click tracker" links; a URL with the sole purpose of tracking clicks and redirecting to the actual desired URL. + +If click trackers are deemed safe, the `ping` attribute should be too. If used in place of click trackers, it may even elevate the user experience as the user would not need to wait for the click tracker to redirect them to the page they intend to visit. + + +### target + +It is not recommended to support the `target` attribute with all its values. The email client can determine how and where links are opened instead. + + +### referrerpolicy + +The Email Markup Consortium does not have an official recommendation at this stage. + + +### rel + +If `target="_blank"` is used, it is advised to have `rel="noreferrer"` and `rel="noopener"` to protect the user from `window.opener` API exploitation attacks. This applies regardless whether the sender or the email client is the one that sets the `target` attribute. + +Newer browser versions implicitly sets `rel="noopener"`. + + +## Resources + +- [MDN: ``: The Anchor element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a) +- [HTML Standard: The `a` element](https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element) +- [Some email clients are vulnerable to attacks via 'mailto' links](https://www.zdnet.com/article/some-email-clients-are-vulnerable-to-attacks-via-mailto-links/) + + +## Email client compatibility + +### Linking to an element on the same page + + + +### mailto URI scheme + + \ No newline at end of file diff --git a/src/content/sanitizer/features/html/elements/address.md b/src/content/sanitizer/features/html/elements/address.md new file mode 100644 index 0000000..3dc3a21 --- /dev/null +++ b/src/content/sanitizer/features/html/elements/address.md @@ -0,0 +1,7 @@ +--- +title: "
" +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/html/elements/article.md b/src/content/sanitizer/features/html/elements/article.md new file mode 100644 index 0000000..9a956d3 --- /dev/null +++ b/src/content/sanitizer/features/html/elements/article.md @@ -0,0 +1,7 @@ +--- +title: "
" +description: +layout: "@layouts/MainLayout" +sidebarType: sanitizer +--- + diff --git a/src/content/sanitizer/features/html/elements/aside.md b/src/content/sanitizer/features/html/elements/aside.md new file mode 100644 index 0000000..2651e33 --- /dev/null +++ b/src/content/sanitizer/features/html/elements/aside.md @@ -0,0 +1,7 @@ +--- +title: "