Skip to content

Commit

Permalink
Include the global meta tags in the rendering stage
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadnasriya committed Jul 16, 2024
1 parent 0f2c9aa commit 5a1eca6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nasriya/hypercloud",
"version": "1.0.2",
"version": "1.0.3",
"description": "Nasriya HyperCloud is a lightweight Node.js HTTP2 framework.",
"main": "./dist/cjs/hypercloud.js",
"module": "./dist/esm/hypercloud.js",
Expand Down
4 changes: 2 additions & 2 deletions src/services/renderer/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class Renderer {
const headEndIndex = this.#_rendered.indexOf('</head>');
const existingHeadElements = this.#_helpers.html.head.content();

const metaTags = this.#_page.metaTags.get().map(meta => {
const metaTags = [...this.#_rendering.assets.metaTags.get(), ...this.#_page.metaTags.get()].map(meta => {
const attrs = [];
for (const prop in meta.attributes) {
const value = meta.attributes[prop];
Expand All @@ -235,7 +235,7 @@ class Renderer {
this.#_data.favicon ? `<link rel="icon" href="${this.#_data.favicon}">` : '',
this.#_data.thumbnail ? `<meta property="og:image" content="${this.#_data.thumbnail}">` : '',
this.#_data.keywords.length ? `<meta name="keywords" content="${this.#_data.keywords.join(', ')}">` : '',
...metaTags,
...metaTags,
...this.#_data.stylesheets,
...this.#_data.scripts
];
Expand Down

0 comments on commit 5a1eca6

Please sign in to comment.