@gouvfr/dsfr-roller
Version:
Le module `dsfr-roller` permet de publier le site de documentation du Système de Design de l’État - DSFR
42 lines (38 loc) • 1.35 kB
JavaScript
import { Title } from './title.js';
import { Canonical } from './canonical.js';
import { Stylesheets } from './stylesheets.js';
import { Renderable } from '../../core/renderable.js';
import { Favicon } from './favicon.js';
import { Scheme } from './scheme.js';
import { Resource } from './resource.js';
import { Share } from './share.js';
class Head extends Renderable {
constructor (data) {
super(data);
this._title = new Title(data);
this._canonical = new Canonical(data);
this._favicon = new Favicon(data);
this._share = new Share(data);
this._scheme = new Scheme(data);
this._stylesheets = new Stylesheets(data);
this._resource = new Resource(data);
}
async render () {
return `
<head>
${await this._title.render()}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="format-detection" content="telephone=no,date=no,address=no,email=no,url=no">
<meta name="generator" content="@gouvfr/dsfr-roller">
${await this._canonical.render()}
${await this._favicon.render()}
${await this._share.render()}
${await this._scheme.render()}
${await this._stylesheets.render()}
${await this._resource.render()}
</head>
`;
}
}
export { Head };