Accesing Configuration

Accessing configuration

The following code snippet shows how to access the configuration object from the theme.config.js file.

import Config from '../../theme.config'
 
## Accessing project.link
 
{Config.project.link}
 
## Accessing logo
 
{Config.logo}
 
## Accessing chat
 
### Accessing chat.link
 
{Config.chat.link}
 
### Accessing chat.icon
 
{Config.chat.icon}

Accessing project.link

{Config.project.link}
https://github.com/ULL-ESIT-PL-2324

Accessing logo

{Config.logo}

Accessing chat

Accessing chat.link

{Config.chat.link}
https://meet.google.com/eha-yfij-zmo

Accessing chat.icon

{Config.chat.icon}

Modifying configuration

 
import { useConfig } from 'nextra-theme-docs'
 
export const chat = (value) => {
    let config = useConfig()
    config.chat.icon = value
}
 
Look at the chat icon on the top right corner! {chat("CHAT")}

Look at the chat icon on the top right corner!