Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Translate api-files-gatsby-ssr.md to Hindi #75

Open
wants to merge 1 commit into
base: translation
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions docs/docs/api-files-gatsby-ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
title: The gatsby-ssr.js API file
---

The file `gatsby-ssr.js` lets you alter the content of static HTML files as they are being Server-Side Rendered (SSR) by Gatsby and Node.js. To use the [Gatsby SSR APIs](/docs/ssr-apis/), create a file called `gatsby-ssr.js` in the root of your site. Export any of the APIs you wish to use in this file.
फ़ाइल `gatsby-ssr.js` आपको स्थिर HTML फ़ाइलों की सामग्री को बदलने देती है क्योंकि वे Gatsby और Node.js. द्वारा सर्वर-साइड रेंडर (SSR) की जा रही हैं। [Gatsby SSR APIs](/docs/ssr-apis/) का उपयोग करने के लिए, अपनी साइट की जड़ में gatsby-ssr.js नामक एक फ़ाइल बनाएँ। इस फ़ाइल में आपके द्वारा उपयोग किए जाने वाले किसी भी API को निर्यात करें।

The APIs `wrapPageElement` and `wrapRootElement` exist in both the SSR and [browser APIs](/docs/browser-apis). If you use one of them, consider if you should implement it in both `gatsby-ssr.js` and `gatsby-browser.js` so that pages generated through SSR with Node.js are the same after being [hydrated](/docs/glossary#hydration) with browser JavaScript.

APIs `wrapPageElement` और `wrapRootElement` दोनों SSR और [browser APIs](/docs/browser-apis) में मौजूद हैं।
यदि आप उनमें से एक का उपयोग करते हैं, तो विचार करें कि क्या आपको इसे `gatsby-ssr.js` और `gatsby-browser.js` दोनों में लागू करना चाहिए ताकि Node.js के साथ SSR के माध्यम से उत्पन्न पेजेज़ जावास्क्रिप्ट से [hydrated](/docs/glossary#hydration) होने के बाद समान हों।

```jsx:title=gatsby-ssr.js
const React = require("react")
const Layout = require("./src/components/layout")

// Adds a class name to the body element
// body element के लिए एक class name जोड़ता है
exports.onRenderBody = ({ setBodyAttributes }, pluginOptions) => {
setBodyAttributes({
className: "my-body-class",
})
}

// Wraps every page in a component
// प्रत्येक पृष्ठ को एक कौम्पोनॅन्टस में लपेटता है
exports.wrapPageElement = ({ element, props }) => {
return <Layout {...props}>{element}</Layout>
}
Expand Down