Socket
Socket
Sign inDemoInstall

remix-seo

Package Overview
Dependencies
16
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    remix-seo

A package for easily managing SEO meta and link tags in Remix.


Version published
Weekly downloads
53
decreased by-18.46%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

remix-seo

A package for easily managing SEO meta and link tags in Remix.

WIP!

Usage

// app/seo.ts
import { initSeo } from "../src/index";
export const { getSeo, getSeoMeta, getSeoLinks } = getSeo({
	// Pass any SEO defaults for your site here.
	// If individual routes do not provide their own meta and link tags,
	// the tags generated by the defaults will be used.
	title: "The Awesome Store",
	titleTemplate: "%s | The Awesome Store",
	description: "The most awesome store on planet Earth.",
});

// app/root.tsx
import { getSeo } from "~/seo";
let [seoMeta, seoLinks] = getSeo();

export let meta = () => ({ ...seoMeta, { whatever: "cool" } });
export let links = () => [ ...seoLinks, { rel: "stylesheet", href: "/sick-styles.css" } ];

// app/routes/some-route.tsx
import { getSeo, getSeoMeta, getSeoLinks } from "~/seo";

// No need for route data? Get meta and links in one call.
let [seoMeta, seoLinks] = getSeo({
	title: "About us",
	description: "We are great!",
});

// SEO depends on route data?
// call getSeoMeta and getSeoLinks individually in the relevant function.
export let meta = ({ context }) => {
	let seoMeta = getSeoMeta({
		title: `Welcome ${context.name}`
	});
	return {
		...seoMeta,
	};
};
export let links = ({ context }) => {
	let seoLinks = getSeoLinks({
		title: `Welcome ${context.name}`
	});
	return [...seoLinks];
};

Keywords

FAQs

Last updated on 20 Jan 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc