-
Notifications
You must be signed in to change notification settings - Fork 132
fix(seo): Google indexing, sitemap, robots.txt, meta tags, performance #1106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…sive SEO improvements
|
@DYHARDx is attempting to deploy a commit to the recode Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. The estimated time for response is 5–8 hrs. In the meantime, please provide all necessary screenshots and make sure you run - npm build run , command and provide a screenshot, a video recording, or an image of the update you made below, which helps speed up the review and assignment. If you have questions, reach out to LinkedIn. Your contributions are highly appreciated!😊 Note: I maintain the repo issue every day twice at 8:00 AM IST and 9:00 PM IST. If your PR goes stale for more than one day, you can tag and comment on this same issue by tagging @sanjay-kv. We are here to help you on this journey of open source. Consistent 20 contributions are eligible for sponsorship 💰 🎁 check our list of amazing people we sponsored so far: GitHub Sponsorship. ✨ 📚Your perks for contribution to this community 👇🏻
If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊 |
|
✅ Synchronized metadata from Issue #1085:
|
Added a video tutorial link and community resources to README.
|
✅ Synchronized metadata from Issue #1085:
|
| headTags: [ | ||
| // Structured data for rich search results | ||
| { | ||
| tagName: "script", | ||
| attributes: { | ||
| type: "application/ld+json", | ||
| }, | ||
| innerHTML: JSON.stringify({ | ||
| "@context": "https://schema.org", | ||
| "@type": "Organization", | ||
| name: "Recode Hive", | ||
| url: "https://www.recodehive.com", | ||
| logo: "https://www.recodehive.com/img/logo.png", | ||
| sameAs: [ | ||
| "https://github.com/recodehive", | ||
| "https://www.youtube.com/@recodehive", | ||
| "https://twitter.com/recodehive", | ||
| ], | ||
| description: | ||
| "A community-driven platform for learning programming, coding tutorials, and developer resources.", | ||
| }), | ||
| }, | ||
| // Preconnect to Google Analytics for performance | ||
| { | ||
| tagName: "link", | ||
| attributes: { | ||
| rel: "preconnect", | ||
| href: "https://www.google-analytics.com", | ||
| }, | ||
| }, | ||
| // Preconnect to Google Fonts if used | ||
| { | ||
| tagName: "link", | ||
| attributes: { | ||
| rel: "preconnect", | ||
| href: "https://fonts.googleapis.com", | ||
| }, | ||
| }, | ||
| ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The headTags and metadata arrays are incorrectly placed inside customFields where they won't be processed by Docusaurus. These configuration objects should be moved to the root level of the config or removed if their functionality is already covered by page-level Head components.
View Details
📝 Patch Details
diff --git a/docusaurus.config.ts b/docusaurus.config.ts
index df38619..1bdce19 100644
--- a/docusaurus.config.ts
+++ b/docusaurus.config.ts
@@ -273,71 +273,98 @@ const config: Config = {
],
],
- // Global SEO metadata
- customFields: {
- metadata: [
- {
+ // Global SEO head tags for all pages
+ headTags: [
+ // Global metadata
+ {
+ tagName: "meta",
+ attributes: {
name: "keywords",
- content:
- "programming, coding, tutorials, open source, developer community, learning, education, tech",
+ content: "programming, coding, tutorials, open source, developer community, learning, education, tech",
},
- {
+ },
+ {
+ tagName: "meta",
+ attributes: {
name: "description",
- content:
- "Recode Hive - A community-driven platform for learning programming, coding tutorials, and developer resources.",
+ content: "Recode Hive - A community-driven platform for learning programming, coding tutorials, and developer resources.",
},
- { name: "twitter:card", content: "summary_large_image" },
- {
+ },
+ {
+ tagName: "meta",
+ attributes: {
+ name: "twitter:card",
+ content: "summary_large_image",
+ },
+ },
+ {
+ tagName: "meta",
+ attributes: {
name: "twitter:title",
content: "Recode Hive - Learn Programming and Coding",
},
- {
+ },
+ {
+ tagName: "meta",
+ attributes: {
name: "twitter:description",
- content:
- "Join our community to learn programming, access coding tutorials, and connect with developers worldwide.",
+ content: "Join our community to learn programming, access coding tutorials, and connect with developers worldwide.",
},
- { property: "og:type", content: "website" },
- { property: "og:site_name", content: "Recode Hive" },
- ],
- headTags: [
- // Structured data for rich search results
- {
- tagName: "script",
- attributes: {
- type: "application/ld+json",
- },
- innerHTML: JSON.stringify({
- "@context": "https://schema.org",
- "@type": "Organization",
- name: "Recode Hive",
- url: "https://www.recodehive.com",
- logo: "https://www.recodehive.com/img/logo.png",
- sameAs: [
- "https://github.com/recodehive",
- "https://www.youtube.com/@recodehive",
- "https://twitter.com/recodehive",
- ],
- description:
- "A community-driven platform for learning programming, coding tutorials, and developer resources.",
- }),
+ },
+ {
+ tagName: "meta",
+ attributes: {
+ property: "og:type",
+ content: "website",
},
- // Preconnect to Google Analytics for performance
- {
- tagName: "link",
- attributes: {
- rel: "preconnect",
- href: "https://www.google-analytics.com",
- },
+ },
+ {
+ tagName: "meta",
+ attributes: {
+ property: "og:site_name",
+ content: "Recode Hive",
},
- // Preconnect to Google Fonts if used
- {
- tagName: "link",
- attributes: {
- rel: "preconnect",
- href: "https://fonts.googleapis.com",
- },
+ },
+ // Structured data for rich search results
+ {
+ tagName: "script",
+ attributes: {
+ type: "application/ld+json",
},
- ],
+ innerHTML: JSON.stringify({
+ "@context": "https://schema.org",
+ "@type": "Organization",
+ name: "Recode Hive",
+ url: "https://www.recodehive.com",
+ logo: "https://www.recodehive.com/img/logo.png",
+ sameAs: [
+ "https://github.com/recodehive",
+ "https://www.youtube.com/@recodehive",
+ "https://twitter.com/recodehive",
+ ],
+ description:
+ "A community-driven platform for learning programming, coding tutorials, and developer resources.",
+ }),
+ },
+ // Preconnect to Google Analytics for performance
+ {
+ tagName: "link",
+ attributes: {
+ rel: "preconnect",
+ href: "https://www.google-analytics.com",
+ },
+ },
+ // Preconnect to Google Fonts if used
+ {
+ tagName: "link",
+ attributes: {
+ rel: "preconnect",
+ href: "https://fonts.googleapis.com",
+ },
+ },
+ ],
+
+ customFields: {
gitToken: process.env.DOCUSAURUS_GIT_TOKEN,
// Shopify credentials for merch store
SHOPIFY_STORE_DOMAIN:
Analysis
headTags and metadata incorrectly placed in customFields instead of root config
What fails: Global SEO tags (Organization JSON-LD schema, preconnect directives, and meta tags) in customFields.headTags and customFields.metadata are not processed by Docusaurus, preventing injection into HTML <head> sections across all pages.
How to reproduce:
npm run build
grep "application/ld+json" build/index.html # No results foundResult: Organization schema and global meta tags missing from built HTML files. Only individual page-level SEO tags appear.
Expected: According to Docusaurus headTags documentation, headTags should be at root config level for proper HTML injection. After moving to root level, all tags appear correctly in built HTML.
|
Added /sitemap.xml and linked it in robots.txt there is so many files not related especially blog post , lets stick to the real issue and remove unecessary doc files. |
|
@sanjay-kv i added blog files because website in have no data for ranking google patch website data then ranking , if you want to remove then ok i will remove this |
Related issue: #1085
Summary
This pull request adds a complete SEO setup to help the website appear and rank properly on Google.
It includes sitemap creation, robots.txt configuration, meta tags, internal linking improvements, and initial Core Web Vitals optimization.
A few Markdown files were also refined using AI to make the documentation clearer and easier to read.
What’s Included
/sitemap.xmland linked it inrobots.txtrobots.txtwith proper crawl rulesalttext and URLsChecklist
robots.txtHow to Test
/sitemap.xmland/robots.txtto confirm setup..mdfiles for clarity and structure.Notes for Maintainers