Skip to content

Commit

Permalink
Extract LD product metadata, and apply it just to product landing pages
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed Dec 6, 2023
1 parent 83ffe1b commit 008a390
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 35 deletions.
35 changes: 0 additions & 35 deletions src/components/layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,41 +240,6 @@ export class Layout extends React.Component {

<link rel="privacy-policy" href="/privacy-policy/" />
<link rel="terms-of-service" href="/terms-of-service/" />

<script type="application/ld+json">
{JSON.stringify({
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"image": "https://httptoolkit.com/logo-square.png",
"screenshot": "https://httptoolkit.com/screenshot.png",
"dateModified": siteMetadata.latestSiteUpdate, // Bit hacky - we should really pull this from the GH releases API
"video": {
"@type": "VideoObject",
"name": "HTTP Toolkit",
"description": "A short demo of HTTP Toolkit in action",
"contentUrl": "https://httptoolkit.com/http-mock-demo.mp4",
"thumbnailUrl": "https://httptoolkit.com/http-mock-demo-thumbnail.png",
"uploadDate": "2019-09-25T00:00:00Z"
},
"name": "HTTP Toolkit",
"description": "Beautiful & open-source tools to debug, test and develop with HTTP(S)",
"softwareVersion": siteMetadata.latestAppVersion,
"operatingSystem": [
"Windows",
"Mac",
"Linux",
"Android"
],
"url": "https://httptoolkit.com/",
"downloadUrl": "https://httptoolkit.com/",
"applicationCategory": "DeveloperApplication",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
}
})}
</script>
</Helmet>

<Header {...visibilityProps}>
Expand Down
52 changes: 52 additions & 0 deletions src/components/product-ld-data.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import React from 'react';

import { siteMetadata } from '../../gatsby-config.js';

export const ProductLdData = () => <script type="application/ld+json">{
JSON.stringify({
"@context": "https://schema.org",
"@type": ["SoftwareApplication", "WebApplication", "MobileApplication"],
"image": "https://httptoolkit.com/logo-square.png",
"screenshot": "https://httptoolkit.com/screenshot.png",
"dateModified": siteMetadata.latestSiteUpdate, // Bit hacky - we should really pull this from the GH releases API
"video": {
"@type": "VideoObject",
"name": "HTTP Toolkit",
"description": "A short demo of HTTP Toolkit in action",
"contentUrl": "https://httptoolkit.com/http-mock-demo.mp4",
"thumbnailUrl": "https://httptoolkit.com/http-mock-demo-thumbnail.png",
"uploadDate": "2019-09-25T00:00:00Z"
},
"name": "HTTP Toolkit",
"description": "Beautiful & open-source tools to debug, test and develop with HTTP(S)",
"softwareVersion": siteMetadata.latestAppVersion,
"operatingSystem": [
"Windows",
"Mac",
"Linux",
"Android"
],
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "5",
"reviewCount": "33" // Update as new testimonials are added
},
"url": "https://httptoolkit.com/",
"downloadUrl": [
"https://httptoolkit.com/download/win-exe/",
"https://httptoolkit.com/download/win-standalone/",
"https://httptoolkit.com/download/win-winget/",
"https://httptoolkit.com/download/linux-deb/",
"https://httptoolkit.com/download/linux-standalone/",
"https://httptoolkit.com/download/linux-aur/",
"https://httptoolkit.com/download/osx-dmg/",
"https://httptoolkit.com/download/osx-homebrew/"
],
"applicationCategory": "DeveloperApplication",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
}
})
}</script>;
2 changes: 2 additions & 0 deletions src/pages/android.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { EmailSignupModal } from '../components/email-signup-modal';
import { StandaloneDownloadCTA } from '../components/cta';
import { AndroidDemoVideo } from '../components/per-target/android-demo-video';
import { SectionSpacer } from '../components/section-spacer';
import { ProductLdData } from '../components/product-ld-data.jsx';

import { TopHeroContainer, Pitch } from '../components/pitch/leading-pitch';
import { Description } from '../components/pitch/description';
Expand Down Expand Up @@ -42,6 +43,7 @@ export default class JSPage extends React.Component {
<meta property="og:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:card" content="summary_large_image" />
{ ProductLdData() }
</Helmet>
<TopHeroContainer>
<Pitch target='Android' />
Expand Down
2 changes: 2 additions & 0 deletions src/pages/charles-alternative.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Layout } from '../components/layout';
import { EmailSignupModal } from '../components/email-signup-modal';
import { StandaloneDownloadCTA } from '../components/cta';
import { DemoVideo } from '../components/demo-video';
import { ProductLdData } from '../components/product-ld-data.jsx';

import { TopHeroContainer } from '../components/pitch/leading-pitch';
import { FuturePlans } from '../components/pitch/future-plans';
Expand Down Expand Up @@ -143,6 +144,7 @@ export default class CharlesAlternativePage extends React.Component {
<meta property="og:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:card" content="summary_large_image" />
{ ProductLdData() }
</Helmet>
<TopHeroContainer>
<Heading>
Expand Down
2 changes: 2 additions & 0 deletions src/pages/chrome-devtools-alternative.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Layout } from '../components/layout';
import { EmailSignupModal } from '../components/email-signup-modal';
import { StandaloneDownloadCTA } from '../components/cta';
import { DemoVideo } from '../components/demo-video';
import { ProductLdData } from '../components/product-ld-data.jsx';

import { TopHeroContainer } from '../components/pitch/leading-pitch';
import { FuturePlans } from '../components/pitch/future-plans';
Expand Down Expand Up @@ -143,6 +144,7 @@ export default class CharlesAlternativePage extends React.Component {
<meta property="og:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:card" content="summary_large_image" />
{ ProductLdData() }
</Helmet>
<TopHeroContainer>
<Heading>
Expand Down
2 changes: 2 additions & 0 deletions src/pages/docker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { EmailSignupModal } from '../components/email-signup-modal';
import { StandaloneDownloadCTA } from '../components/cta';
import { DemoVideo } from '../components/demo-video';
import { SectionSpacer } from '../components/section-spacer';
import { ProductLdData } from '../components/product-ld-data.jsx';

import { TopHeroContainer, Pitch } from '../components/pitch/leading-pitch';
import { Description } from '../components/pitch/description';
Expand Down Expand Up @@ -98,6 +99,7 @@ export default class DockerPage extends React.Component {
<meta property="og:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:card" content="summary_large_image" />
{ ProductLdData() }
</Helmet>
<TopHeroContainer>
<Pitch target='Docker' />
Expand Down
2 changes: 2 additions & 0 deletions src/pages/electron.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { EmailSignupModal } from '../components/email-signup-modal';
import { StandaloneDownloadCTA } from '../components/cta';
import { DemoVideo } from '../components/demo-video';
import { SectionSpacer } from '../components/section-spacer';
import { ProductLdData } from '../components/product-ld-data.jsx';

import { TopHeroContainer, Pitch } from '../components/pitch/leading-pitch';
import { Description } from '../components/pitch/description';
Expand Down Expand Up @@ -41,6 +42,7 @@ export default class ElectronPage extends React.Component {
<meta property="og:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:card" content="summary_large_image" />
{ ProductLdData() }
</Helmet>
<TopHeroContainer>
<Pitch target='Electron' />
Expand Down
2 changes: 2 additions & 0 deletions src/pages/fiddler-alternative.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Layout } from '../components/layout';
import { EmailSignupModal } from '../components/email-signup-modal';
import { StandaloneDownloadCTA } from '../components/cta';
import { DemoVideo } from '../components/demo-video';
import { ProductLdData } from '../components/product-ld-data.jsx';

import { TopHeroContainer } from '../components/pitch/leading-pitch';
import { FuturePlans } from '../components/pitch/future-plans';
Expand Down Expand Up @@ -143,6 +144,7 @@ export default class FiddlerAlternativePage extends React.Component {
<meta property="og:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:card" content="summary_large_image" />
{ ProductLdData() }
</Helmet>
<TopHeroContainer>
<Heading>
Expand Down
2 changes: 2 additions & 0 deletions src/pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Layout } from '../components/layout';
import { EmailSignupModal } from '../components/email-signup-modal';
import { StandaloneDownloadCTA } from '../components/cta';
import { DemoVideo } from '../components/demo-video';
import { ProductLdData } from '../components/product-ld-data.jsx';

import { TopHeroContainer, Pitch } from '../components/pitch/leading-pitch';
import { Description } from '../components/pitch/description';
Expand Down Expand Up @@ -34,6 +35,7 @@ export default class IndexPage extends React.Component {
<meta property="og:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:card" content="summary_large_image" />
{ ProductLdData() }
</Helmet>
<TopHeroContainer>
<Pitch />
Expand Down
2 changes: 2 additions & 0 deletions src/pages/java.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { EmailSignupModal } from '../components/email-signup-modal';
import { StandaloneDownloadCTA } from '../components/cta';
import { DemoVideo } from '../components/demo-video';
import { SectionSpacer } from '../components/section-spacer';
import { ProductLdData } from '../components/product-ld-data.jsx';

import { TopHeroContainer, Pitch } from '../components/pitch/leading-pitch';
import { Description } from '../components/pitch/description';
Expand Down Expand Up @@ -107,6 +108,7 @@ export default class JavaPage extends React.Component {
<meta property="og:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:card" content="summary_large_image" />
{ ProductLdData() }
</Helmet>
<TopHeroContainer>
<Pitch target='Java' />
Expand Down
2 changes: 2 additions & 0 deletions src/pages/javascript.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { EmailSignupModal } from '../components/email-signup-modal';
import { StandaloneDownloadCTA } from '../components/cta';
import { DemoVideo } from '../components/demo-video';
import { SectionSpacer } from '../components/section-spacer';
import { ProductLdData } from '../components/product-ld-data.jsx';

import { TopHeroContainer, Pitch } from '../components/pitch/leading-pitch';
import { Description } from '../components/pitch/description';
Expand Down Expand Up @@ -45,6 +46,7 @@ export default class JSPage extends React.Component {
<meta property="og:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:card" content="summary_large_image" />
{ ProductLdData() }
</Helmet>
<TopHeroContainer>
<Pitch target='JavaScript' />
Expand Down
2 changes: 2 additions & 0 deletions src/pages/python.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { EmailSignupModal } from '../components/email-signup-modal';
import { StandaloneDownloadCTA } from '../components/cta';
import { DemoVideo } from '../components/demo-video';
import { SectionSpacer } from '../components/section-spacer';
import { ProductLdData } from '../components/product-ld-data.jsx';

import { TopHeroContainer, Pitch } from '../components/pitch/leading-pitch';
import { Description } from '../components/pitch/description';
Expand Down Expand Up @@ -43,6 +44,7 @@ export default class PythonPage extends React.Component {
<meta property="og:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:card" content="summary_large_image" />
{ ProductLdData() }
</Helmet>
<TopHeroContainer>
<Pitch target='Python' />
Expand Down
2 changes: 2 additions & 0 deletions src/pages/ruby.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { EmailSignupModal } from '../components/email-signup-modal';
import { StandaloneDownloadCTA } from '../components/cta';
import { DemoVideo } from '../components/demo-video';
import { SectionSpacer } from '../components/section-spacer';
import { ProductLdData } from '../components/product-ld-data.jsx';

import { TopHeroContainer, Pitch } from '../components/pitch/leading-pitch';
import { Description } from '../components/pitch/description';
Expand Down Expand Up @@ -43,6 +44,7 @@ export default class RubyPage extends React.Component {
<meta property="og:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:image" content={siteMetadata.siteUrl + 'screenshot-social.png'} />
<meta name="twitter:card" content="summary_large_image" />
{ ProductLdData() }
</Helmet>
<TopHeroContainer>
<Pitch target='Ruby' />
Expand Down

0 comments on commit 008a390

Please sign in to comment.