Coder Social home page Coder Social logo

gatsby-docs's Introduction

Developer turned PM

Working on updates with Dependabot, sprucing up my product skills, and dusting off my math skills

Living in ATX, but you'll find me traveling around the states in my Winnebago

gatsby-docs's People

Contributors

exvuma avatar

gatsby-docs's Issues

Make sure all browser javascript doesn't throw errors

Errors thrown currently as an example:

Uncaught SyntaxError: Unexpected token '&'
(index):13 Uncaught SyntaxError: Unexpected token '&'
(index):1 Access to link prefetch resource at 'https://developers.cloudflare.com/workers' (redirected from 'https://staging.bigfluffycloudflare.com/workers/page-data/tutorials/build-an-application/page-data.json') from origin 'https://staging.bigfluffycloudflare.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
developers.cloudflare.com/workers:1 Failed to load resource: net::ERR_FAILED
(index):1 Access to link prefetch resource at 'https://developers.cloudflare.com/workers' (redirected from 'https://staging.bigfluffycloudflare.com/workers/page-data/tutorials/build-a-serverless-function/page-data.json') from origin 'https://staging.bigfluffycloudflare.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
developers.cloudflare.com/workers:1 Failed to load resource: net::ERR_FAILED

Search nice to have for Gallery

consider re-adding:

  • type filter searches to gallery
  • URL query string searches (e.g. /workers/templates?q=blah searches the gallery for blah)
//   // Handle ?q query param and set default search with it,
//   // if it exists
//   const url = new URL(window.location)
//   const initialSearch = url.searchParams.get('q')
//   if (initialSearch) {
//     handleNewSearchValue(initialSearch)
//   }

Check that there are no 523 errors in network tab

Current there are 523 errors on staging

Some examples:

GET https://staging.bigfluffycloudflare.com/component---src-templates-markdown-template-tsx-e80553dd79cd2ce40efb.js net::ERR_ABORTED 523
5(index):145 GET https://staging.bigfluffycloudflare.com/webpack-runtime-38809eaa3280422b456e.js net::ERR_ABORTED 523
8staging.bigfluffycloudflare.com/:5 GET https://staging.bigfluffycloudflare.com/styles-c4c8dcf3e0a9436343be.js net::ERR_ABORTED 523
(index):1114 GET https://staging.bigfluffycloudflare.com/styles-c4c8dcf3e0a9436343be.js net::ERR_ABORTED 523

This makes sense staging is just on the path /workers/*, we should make gatsby look instead for those files under /workers

Make sure all config from hugo accounted for

Look into how to replace the following fields in gatsby:

  • disableKinds
  • canonifyURLs
  • PygmentsStyle
  • PygmentsCodeFences

Old hugo config:

baseURL = "https://developers.cloudflare.com/workers/"
languageCode = "en-us"
title = "Cloudflare Workers Docs"
theme = "@cloudflare/hugo-cloudflare-docs"
themesDir = "node_modules"
description = "Cloudflare Workers lets you write JavaScript on the Edge"
PygmentsCodeFences = true
PygmentsStyle = "monokai"
canonifyURLs = true
disableKinds = "taxonomyTerm"
ignoreFiles = [ "style/*", "CONTRIBUTING.md" ]

Add copy functionality to gallery?

I decided to not prioritize getting Copy to Clipboard to work for snippets in the galllery

Screen Shot 2020-02-21 at 4 01 40 PM

See commit: 97def14ed34cc050bcdaa899f8f51d77707277e1

Get worker routing setup

Now both gatsby and the worker is considering the /workers prefix, we should have one or the other handler all this

SEO meta data for template pages - title and descriptiono

Make sure the title, description meta data is accurate for template pages.

We used to use the HTML rewriter the manually rewrite those elements, but this is clearly not best practice and actually break things in gatsby. What used to be in the worker main.js:

    // TODO remove this and just set the meta title/descriptions in Gatsby
    if (/^templates\/pages(?!.+\/)/.test(pathname)){
      //Grab the template's title from the registry
      const templateIdMatch = pathname.split(/^templates\/pages(?!.+\/)/)//pathname.replace(/.*pages\//, '')
      console.log("templateIdMatch",  templateIdMatch)
      if(!templateIdMatch[1]){
        throw 'Not in a format where a template ID can be found' + pathname
      }
      const templateId = templateIdMatch[1]
      const templateResp = await fetch(templateRegURL + templateId)
      console.log(templateRegURL + templateId)
      const templateJSON = await templateResp.json()
      const metaInfo = {
        title: templateJSON.title + ' - Cloudflare Workers Docs',
        description: templateJSON.description,
      }
      // Rewrite all meta titles/descriptions the the correct title
      return await new HTMLRewriter()
        .on('meta', new MetaHandler(metaInfo))
        .on('head>title', new TitleHandler(metaInfo))
        .transform(body)
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.