Skip to content
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

SEO Meta Tags #225

Merged
merged 6 commits into from
Aug 12, 2021
Merged

SEO Meta Tags #225

merged 6 commits into from
Aug 12, 2021

Conversation

codemonkey800
Copy link
Collaborator

@codemonkey800 codemonkey800 commented Aug 4, 2021

Description

This PR sets up rendering the keywords and description meta tags on the hub. The keywords and description are sourced from this Airtable: https://airtable.com/shruYyyCiLOyBvfAD

Demo

https://seo-meta-frontend.dev.imaging.cziscience.com

Using the following script, I was able to verify that every page had the correct keywords and descriptions:

metadata.js
const cheerio = require('cheerio')
const axios = require('axios')

const FRONTEND_URL = 'https://seo-meta-frontend.dev.imaging.cziscience.com'

async function printMetadata(path) {
  console.log(`Metadata for ${path}`)

  let data
  try {
    const response = await axios.get(`${FRONTEND_URL}${path}`)
    data = response.data
  } catch (err) {
    data = err.response.data
  }

  const $ = cheerio.load(data)

  const keywords = $('meta[name=keywords]')
  const description = $('meta[name=description]')

  console.log(' keywords:', keywords.attr('content'))
  console.log(' description:', description.attr('content'))
  console.log()
}

async function main() {
  await printMetadata('/')
  await printMetadata('/about')
  await printMetadata('/contact')
  await printMetadata('/faq')
  await printMetadata('/privacy')
  await printMetadata('/plugins/napari-compressed-io')
  await printMetadata('/throw-error')
}

main()
$ node metadata

Metadata for /
 keywords: napari hub, napari, hub, plugin, image analysis, imaging, chan zuckerberg initiative, workflow, find, python, pypi, algorithm
 description: A site for napari plugins. Discover plugins that solve your image analysis challenges, learn how to install into napari, and share image analysis tools with napari’s growing community.

Metadata for /about
 keywords: napari hub, napari, hub, plugin, image analysis, imaging, chan zuckerberg initiative, about
 description: The napari hub is a service of the Chan Zuckerberg Initiative in collaboration with napari.
The napari hub seeks to solve many of the challenges and needs in finding analysis solutions to bioimaging problems.

Metadata for /contact
 keywords: napari hub, napari, hub, plugin, image analysis, imaging, chan zuckerberg initiative, contact
 description: If you would like to contact the napari hub team, you can do so in a variety of ways. For help with or ideas for the napari hub, please check out the discussion board.

Metadata for /faq
 keywords: napari hub, napari, hub, plugin, image analysis, imaging, chan zuckerberg initiative, workflow, find, python, FAQ, frequently asked questions, question
 description: We hope these questions will help you in your napari plugin journey! We endeavour to update this regularly. If you need additional information or assistance, check out the Contact page or you can reach a human at [email protected].

Metadata for /privacy
 keywords: napari hub, napari, hub, plugin, image analysis, imaging, chan zuckerberg initiative, privacy
 description: Information about napari hub's website privacy notice.

Metadata for /plugins/napari-compressed-io
 keywords: napari-compressed-labels-io, Draga Doncila, napari hub, napari, hub, plugin, image analysis, imaging, chan zuckerberg initiative
 description: Plugin exploring different options for reading and writing compressed and portable labels layers in napari.

Metadata for /throw-error
 keywords: undefined
 description: undefined

@codemonkey800 codemonkey800 requested a review from klai95 August 10, 2021 16:38
@codemonkey800 codemonkey800 requested a review from klai95 August 11, 2021 01:06
Copy link
Contributor

@klai95 klai95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@codemonkey800 codemonkey800 merged commit 403c9d0 into main Aug 12, 2021
@codemonkey800 codemonkey800 deleted the jeremy/seo-meta-tags branch August 12, 2021 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants