Skip to content

Commit

Permalink
feat: Add SEO JS API (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
erictuvesson authored Oct 17, 2023
1 parent 00a98be commit d8ad97a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions javascript/reference/seo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
hide_title: true
hide_table_of_contents: true
title: Noodl.SEO
---

# Noodl.SEO

The **Noodl.SEO** API lets you change metatags and document titles without directly accessing the window object, this is required for server-side rendering where we don't have a window.

:::info

All of this is only available on the frontend.

:::

### Reference

#### **`Noodl.SEO.setTitle(value)`**
This function updates the window title.

#### **`Noodl.SEO.meta`**
Get all the metatags that is currently used.

#### **`Noodl.SEO.clearMeta()`**
Clear all the metatags that currently exist.

#### **`Noodl.SEO.getMeta(key)`**
Get a specific metatag by key.

#### **`Noodl.SEO.setMeta(key, value)`**
Set a metatag with key and value.
1 change: 1 addition & 0 deletions sidebarsJavascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const sidebars = {
{ type: 'doc', label: 'Files', id: 'reference/files/README' },
{ type: 'doc', label: 'Navigation', id: 'reference/navigation/README' },
{ type: 'doc', label: 'CloudFunctions', id: 'reference/cloudfunctions/README' },
{ type: 'doc', label: 'SEO', id: 'reference/seo/README' },
],
},
{
Expand Down

0 comments on commit d8ad97a

Please sign in to comment.