You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_document.tsx 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import NextDocument, { Html, Head, Main, NextScript } from 'next/document'
  2. import { dark, getCssString } from 'styles'
  3. class MyDocument extends NextDocument {
  4. static async getInitialProps(ctx) {
  5. try {
  6. const initialProps = await NextDocument.getInitialProps(ctx)
  7. return {
  8. ...initialProps,
  9. styles: (
  10. <>
  11. {initialProps.styles}
  12. <style
  13. id="stitches"
  14. dangerouslySetInnerHTML={{ __html: getCssString() }}
  15. />
  16. </>
  17. ),
  18. }
  19. } catch (e) {
  20. console.error(e.message)
  21. } finally {
  22. }
  23. }
  24. render() {
  25. return (
  26. <Html lang="en">
  27. <Head>
  28. <link rel="manifest" href="/manifest.json" />
  29. <link rel="shortcut icon" href="/favicon.ico" />
  30. <meta name="application-name" content="tldraw" />
  31. <meta name="apple-mobile-web-app-capable" content="yes" />
  32. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  33. <meta name="apple-mobile-web-app-title" content="tldraw" />
  34. <meta name="description" content="A tiny little drawing app." />
  35. <meta name="format-detection" content="telephone=no" />
  36. <meta name="mobile-web-app-capable" content="yes" />
  37. <meta name="theme-color" content="#fafafa" />
  38. <meta name="twitter:card" content="summary" />
  39. <meta name="twitter:url" content="https://tldraw.com" />
  40. <meta name="twitter:title" content="tldraw" />
  41. <meta
  42. name="twitter:description"
  43. content="A tiny little drawing app."
  44. />
  45. <meta name="twitter:creator" content="@steveruizok" />
  46. <meta property="og:type" content="website" />
  47. <meta property="og:title" content="tldraw" />
  48. <meta
  49. property="og:description"
  50. content="A tiny little drawing app."
  51. />
  52. <meta property="og:site_name" content="tldraw" />
  53. <meta property="og:url" content="https://tldraw.com" />
  54. </Head>
  55. <body className={dark}>
  56. <Main />
  57. <NextScript />
  58. </body>
  59. </Html>
  60. )
  61. }
  62. }
  63. export default MyDocument