Skip to content

Commit

Permalink
Date modified: Adding date modified site functionality documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Garneauma committed Nov 15, 2023
1 parent e2b1f93 commit 7a47a41
Show file tree
Hide file tree
Showing 10 changed files with 405 additions and 48 deletions.
1 change: 1 addition & 0 deletions _data/design-patterns.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
223 changes: 192 additions & 31 deletions _data/sites.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _data/wet-boew.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@
]
}
}
]
]
16 changes: 16 additions & 0 deletions sites/date-modified/_base.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
WET date modified overwrites
*/

// Needed for backwards compatibility with GCWeb 4.0.26 and below's HTML markup. Remove in GCWeb 4.1+.
// ExpireOn: 2024-12-01
.datemod {
padding: {
bottom: 7px;
top: 7px;
}

#wb-dtmd {
margin-top: 0;
}
}
14 changes: 14 additions & 0 deletions sites/date-modified/date-modified-en.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
{
"layout": "documentation",
"altLangPage": "date-modified-fr.html",
"breadcrumbs": [
{ "title": "GCWeb home", "link": "https://wet-boew.github.io/GCWeb/index-en.html" }
],
"dateModified": "2023-11-02",
"index_json": "index.json-ld",
"description": "Documentation on how to use the date modified.",
"language": "en",
"title": "Date modified"
}
---
14 changes: 14 additions & 0 deletions sites/date-modified/date-modified-fr.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
{
"layout": "documentation",
"altLangPage": "date-modified-en.html",
"breadcrumbs": [
{ "title": "GCWeb accueil", "link": "https://wet-boew.github.io/GCWeb/index-fr.html" }
],
"dateModified": "2023-11-02",
"index_json": "index.json-ld",
"description": "Documentation sur l'utilisation de la date de modification.",
"language": "fr",
"title": "Date de modification"
}
---
4 changes: 4 additions & 0 deletions sites/date-modified/includes/date-modified.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<dl id="wb-dtmd">
<dt>{{ i18nText-dateModified }}</dt>
<dd><time property="dateModified">{{ page.dateModified }}</time></dd>
</dl>
161 changes: 161 additions & 0 deletions sites/date-modified/index.json-ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"@context": {
"@version": 2.0,
"dct": "http://purl.org/dc/terms/",
"title": { "@id": "dct:title", "@container": "@language" },
"description": { "@id": "dct:description", "@container": "@language" },
"modified": "dct:modified"
},
"title": {
"en": "Date modified",
"fr": "Date de modification"
},
"description": {
"en": "Indicates the date on which the current page was last modified.",
"fr": "Indique la date à laquelle la page courante a été modifiée pour la dernière fois."
},
"modified": "2023-11-02",
"componentName": "date-modified",
"status": "stable",
"version": "1.0",
"pages": {
"docs": [
{
"title": "Date modified",
"language": "en",
"path": "date-modified-en.html"
},
{
"title": "Date de modification",
"language": "fr",
"path": "date-modified-fr.html"
}
]
},
"dependencies": [
"Page details"
],
"a11yGuidance": "no accessibility guidance",
"variations": [
{
"name": {
"en": "Date modified - default",
"fr": "Date de modification - par défaut"
},
"status": "stable",
"description": {
"en": "The date modified component indicates how recently the content of a web page has been updated.",
"fr": "La composante de date de modification indique la date de la dernière mise à jour d'une page Web."
},
"guidance": {
"en": "https://design.canada.ca/common-design-patterns/date-modified.html",
"fr": "https://conception.canada.ca/configurations-conception-communes/date-modification.html"
},
"iteration": "_:iteration_dtmd_1",
"example": [
{
"en": { "href": "../../content-page/content-en.html", "text": "Content page (date modified at bottom of page)" },
"fr": { "href": "../../content-page/content-fr.html", "text": "Page de contenu (date de modification au bas de la page)" }
}
],
"implementation": [
"_:implement_dtmd"
],
"history": [
{
"en": "June 2014 - Initial implementation of the variation.",
"fr": "Juin 2014 - Implémentation initiale de la variante."
}
]
}
],
"implementation": [
{
"@id": "_:implement_dtmd",
"iteration": "_:iteration_dtmd_1",
"name": {
"en": "Standard",
"fr": "Standard"
},
"introduction": {
"en": "This implementation is meant for developers/publishers adding the component manually.",
"fr": "Cette implémentation est destinée aux développeurs/éditeurs qui ajoutent le composant manuellement."
},
"instructions": {
"en": [
"Create a <code>&lt;dl id=\"wb-dtmd\"></code>.",
"Inside the above <code>&lt;dl></code>,<ol><li>create a <code>&lt;dt>Date modified:&lt;/dt></code>.</li><li>create a <code>&lt;dd>&lt;time property=\"dateModified\">[YYYY-MM-DD]&lt;time>&lt;/dd></code>, where [YYYY-MM-DD] is the date the current page was last updated. For example: 2023-11-03.</li></ol>"
],
"fr": [
"Créez un <code>&lt;dl id=\"wb-dtmd\"></code>.",
"À l'intérieur de ce <code>&lt;dl></code>,<ol><li>créez un <code>&lt;dt>Date de modification&nbsp;:&lt;/dt></code>.</li><li>créez un <code>&lt;dd>&lt;time property=\"dateModified\">[AAAA-MM-JJ]&lt;time>&lt;/dd></code>, où [AAAA-MM-JJ] est la date à laquelle la page courante a été modifiée pour la dernière fois. Par exemple: 2023-11-03.</li></ol>"
]
},
"sample": {
"en": [
{
"@type": "source-code",
"description": "Code sample:",
"code": "<dl id=\"wb-dtmd\">\n\t<dt>Date modified:</dt>\n\t<dd><time property=\"dateModified\">YYYY-MM-DD</time></dd>\n</dl>"
}
],
"fr": [
{
"@type": "source-code",
"description": "Exemple de code&nbsp;:",
"code": "<dl id=\"wb-dtmd\">\n\t<dt>Date de modification&nbsp;:</dt>\n\t<dd><time property=\"dateModified\">YYYY-MM-DD</time></dd>\n</dl>"
}
]
}
}
],
"iteration": [
{
"@id": "_:iteration_dtmd_1",
"name": "Date modified - Iteration 1",
"date": "2014-06",
"detectableBy": "#wb-dtmd",
"assets": [
{
"@type": "source-code",
"@language": "en",
"description": "Code sample",
"code": "&lt;dl id=\"wb-dtmd\">\n\t&lt;dt>Date modified:&lt;/dt>\n\t&lt;dd>&lt;time property=\"dateModified\">YYYY-MM-DD&lt;/time>&lt;/dd>\n&lt;/dl>"
},
{
"@type": "source-code",
"@language": "en",
"description": "Code sample with contact link",
"code": "&lt;dl id=\"wb-dtmd\">\n\t&lt;dt>Date de modification&nbsp;:&lt;/dt>\n\t&lt;dd>&lt;time property=\"dateModified\">YYYY-MM-DD&lt;/time>&lt;/dd>\n&lt;/dl>"
}
]
}
],
"changesets": [
{
"@id": "_:cs_dtmd",
"name": "Date modified",
"status": "stable",
"baseOnIteration": "_:iteration_dtmd_1",
"detectableBy": "#wb-dtmd",
"layout": "The <dd> is on the right of the <dt>.",
"semantic": "dl > dt + dd",
"static": [
"Date modified:",
"Date de modification :"
],
"schema": [
"Last modified date"
],
"include": {
"@type": "source-code",
"collapsed": true,
"description": "Include with logic in Liquid.",
"code": {
"@type": [ "@id", "rdf:HTML" ],
"@value": "includes/date-modified.html"
}
}
}
]
}
13 changes: 1 addition & 12 deletions sites/page-details/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ main {
padding-top: 2em;

// Needed for backwards compatibility with GCWeb 4.0.26 and below's HTML markup. Remove in GCWeb 4.1+.
// ExpireOn: 2024-12-01
&.row {
details {
margin: {
Expand All @@ -64,18 +65,6 @@ main {
}
}

// Needed for backwards compatibility with GCWeb 4.0.26 and below's HTML markup. Remove in GCWeb 4.1+.
.datemod {
padding: {
bottom: 7px;
top: 7px;
}

#wb-dtmd {
margin-top: 0;
}
}

details {
margin-bottom: 0;

Expand Down
5 changes: 1 addition & 4 deletions sites/page-details/includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ <h2 class="wb-inv">{{ i18nText-pageDetails }}</h2>
{%- endif -%}

<div class="{{ col-modified }}">
<dl id="wb-dtmd">
<dt>{{ i18nText-dateModified }}</dt>
<dd><time property="dateModified">{{ page.dateModified }}</time></dd>
</dl>
{%- include date-modified/date-modified.html -%}
</div>
</div>
</section>

0 comments on commit 7a47a41

Please sign in to comment.