From 04c44518b205fae902c189a21d10fd768357f3bd Mon Sep 17 00:00:00 2001 From: Zeb Pykosz Date: Wed, 25 Jul 2018 07:47:26 -0400 Subject: [PATCH] convert website from hugo to gatsby (#1369) --- .gitignore | 4 +- .nvmrc | 2 +- website/.babelrc | 9 +- website/.eslintrc | 5 + website/.gitignore | 3 + website/.nvmrc | 2 +- website/README.md | 6 +- website/{site => }/content/.keep | 0 ...fy-cms-now-supports-gitlab-as-a-backend.md | 0 .../content/docs/add-to-your-site.md | 9 +- .../{site => }/content/docs/architecture.md | 8 +- .../content/docs/authentication-backends.md | 5 +- .../{site => }/content/docs/beta-features.md | 6 +- .../content/docs/collection-types.md | 5 +- .../content/docs/configuration-options.md | 6 +- .../content/docs/contributor-guide.md | 6 +- .../{site => }/content/docs/custom-widgets.md | 17 +- .../{site => }/content/docs/customization.md | 7 +- website/{site => }/content/docs/examples.md | 6 +- website/{site => }/content/docs/intro.md | 6 +- .../content/docs/start-with-a-template.md | 6 +- .../content/docs/update-the-cms-version.md | 6 +- .../content/docs/widgets/boolean.md | 6 +- .../{site => }/content/docs/widgets/date.md | 6 +- .../content/docs/widgets/datetime.md | 4 +- .../{site => }/content/docs/widgets/file.md | 6 +- .../{site => }/content/docs/widgets/hidden.md | 6 +- .../{site => }/content/docs/widgets/image.md | 6 +- .../{site => }/content/docs/widgets/index.md | 6 +- .../{site => }/content/docs/widgets/list.md | 4 +- .../content/docs/widgets/markdown.md | 4 +- .../{site => }/content/docs/widgets/number.md | 7 +- .../{site => }/content/docs/widgets/object.md | 6 +- .../content/docs/widgets/relation.md | 4 +- .../{site => }/content/docs/widgets/select.md | 4 +- .../{site => }/content/docs/widgets/string.md | 4 +- .../{site => }/content/docs/widgets/text.md | 4 +- website/{site => }/content/pages/community.md | 2 - website/{site => }/data/.keep | 0 website/{site => }/data/docs.yml | 2 - website/{site => }/data/global.yaml | 2 - website/{site => }/data/landing.yaml | 8 +- website/data/notifications.yml | 22 + website/{site => }/data/updates.yml | 30 +- website/gatsby-browser.js | 10 + website/gatsby-config.js | 96 + website/gatsby-node.js | 91 + website/gulpfile.babel.js | 128 - website/package.json | 61 +- website/site/config.yaml | 22 - website/site/data/notifications.yml | 22 - website/site/layouts/_default/single.html | 46 - website/site/layouts/blog/single.html | 16 - website/site/layouts/index.html | 88 - website/site/layouts/pages/community.html | 38 - website/site/layouts/partials/edit-link.html | 10 - website/site/layouts/partials/footer.html | 46 - website/site/layouts/partials/header.html | 63 - website/site/layouts/partials/widgets.html | 14 - website/site/layouts/section/blog.html | 17 - website/site/static/jquery.localScroll.min.js | 7 - website/site/static/jquery.scrollTo.min.js | 7 - website/site/static/moment.min.js | 7 - website/site/static/prism.js | 18 - website/site/static/widgets.js | 76 - website/src/components/docs-nav.js | 70 + website/src/components/docsearch.js | 39 + website/src/components/edit-link.js | 30 + website/src/components/event-widget.js | 71 + website/src/components/footer.js | 36 + website/src/components/header.js | 94 + website/src/components/markdownify.js | 11 + website/src/components/mobile-nav.js | 32 + website/src/components/video-embed.js | 41 + website/src/components/widgets.js | 90 + website/src/css/imports/base.css | 6 + website/src/css/imports/docs.css | 10 +- website/src/css/imports/header.css | 20 +- website/src/css/imports/widgets.css | 80 +- website/src/css/main.css | 13 - website/src/html.js | 86 + .../img/favicon/android-chrome-192x192.png | Bin 16847 -> 0 bytes website/src/img/favicon/manifest.json | 18 - website/src/js/app.js | 135 - website/src/layouts/index.js | 66 + website/src/pages/blog.js | 58 + website/src/pages/community.js | 87 + website/src/pages/index.js | 188 + website/src/templates/blog-post.js | 46 + website/src/templates/doc-page.js | 108 + website/{config/variables.js => src/theme.js} | 0 website/{site => }/static/.keep | 0 website/{site => }/static/_redirects | 0 website/{site => }/static/admin/config.yml | 11 +- website/{site => }/static/admin/index.html | 0 .../{site => }/static/img/create-password.png | Bin .../{site => }/static/img/email-subject.png | Bin .../img/favicon/apple-touch-icon.png | Bin .../img/favicon/browserconfig.xml | 2 +- .../img/favicon/favicon-16x16.png | Bin .../img/favicon/favicon-32x32.png | Bin .../{src => static}/img/favicon/favicon.ico | Bin .../img/favicon/icon-512x512.png} | Bin .../img/favicon/mstile-144x144.png | Bin .../img/favicon/mstile-150x150.png | Bin .../img/favicon/mstile-310x150.png | Bin .../img/favicon/mstile-310x310.png | Bin .../img/favicon/mstile-70x70.png | Bin .../img/favicon/safari-pinned-tab.svg | 0 .../screen shot 2018-01-05 at 4.25.07 pm.png | Bin .../static/img/widgets-markdown.PNG | Bin website/webpack.conf.js | 37 - website/yarn.lock | 7577 +++++++++++++---- 113 files changed, 7441 insertions(+), 2771 deletions(-) create mode 100644 website/.eslintrc create mode 100644 website/.gitignore rename website/{site => }/content/.keep (100%) rename website/{site => }/content/blog/netlify-cms-now-supports-gitlab-as-a-backend.md (100%) rename website/{site => }/content/docs/add-to-your-site.md (99%) rename website/{site => }/content/docs/architecture.md (98%) rename website/{site => }/content/docs/authentication-backends.md (99%) rename website/{site => }/content/docs/beta-features.md (99%) rename website/{site => }/content/docs/collection-types.md (98%) rename website/{site => }/content/docs/configuration-options.md (99%) rename website/{site => }/content/docs/contributor-guide.md (93%) rename website/{site => }/content/docs/custom-widgets.md (99%) rename website/{site => }/content/docs/customization.md (98%) rename website/{site => }/content/docs/examples.md (96%) rename website/{site => }/content/docs/intro.md (97%) rename website/{site => }/content/docs/start-with-a-template.md (98%) rename website/{site => }/content/docs/update-the-cms-version.md (94%) rename website/{site => }/content/docs/widgets/boolean.md (90%) rename website/{site => }/content/docs/widgets/date.md (95%) rename website/{site => }/content/docs/widgets/datetime.md (95%) rename website/{site => }/content/docs/widgets/file.md (94%) rename website/{site => }/content/docs/widgets/hidden.md (93%) rename website/{site => }/content/docs/widgets/image.md (95%) rename website/{site => }/content/docs/widgets/index.md (97%) rename website/{site => }/content/docs/widgets/list.md (98%) rename website/{site => }/content/docs/widgets/markdown.md (97%) rename website/{site => }/content/docs/widgets/number.md (95%) rename website/{site => }/content/docs/widgets/object.md (97%) rename website/{site => }/content/docs/widgets/relation.md (97%) rename website/{site => }/content/docs/widgets/select.md (97%) rename website/{site => }/content/docs/widgets/string.md (92%) rename website/{site => }/content/docs/widgets/text.md (93%) rename website/{site => }/content/pages/community.md (96%) rename website/{site => }/data/.keep (100%) rename website/{site => }/data/docs.yml (97%) rename website/{site => }/data/global.yaml (95%) rename website/{site => }/data/landing.yaml (95%) create mode 100644 website/data/notifications.yml rename website/{site => }/data/updates.yml (85%) create mode 100644 website/gatsby-browser.js create mode 100644 website/gatsby-config.js create mode 100644 website/gatsby-node.js delete mode 100755 website/gulpfile.babel.js delete mode 100755 website/site/config.yaml delete mode 100644 website/site/data/notifications.yml delete mode 100644 website/site/layouts/_default/single.html delete mode 100644 website/site/layouts/blog/single.html delete mode 100755 website/site/layouts/index.html delete mode 100644 website/site/layouts/pages/community.html delete mode 100644 website/site/layouts/partials/edit-link.html delete mode 100755 website/site/layouts/partials/footer.html delete mode 100755 website/site/layouts/partials/header.html delete mode 100644 website/site/layouts/partials/widgets.html delete mode 100644 website/site/layouts/section/blog.html delete mode 100644 website/site/static/jquery.localScroll.min.js delete mode 100644 website/site/static/jquery.scrollTo.min.js delete mode 100644 website/site/static/moment.min.js delete mode 100644 website/site/static/prism.js delete mode 100644 website/site/static/widgets.js create mode 100644 website/src/components/docs-nav.js create mode 100644 website/src/components/docsearch.js create mode 100644 website/src/components/edit-link.js create mode 100644 website/src/components/event-widget.js create mode 100644 website/src/components/footer.js create mode 100644 website/src/components/header.js create mode 100644 website/src/components/markdownify.js create mode 100644 website/src/components/mobile-nav.js create mode 100644 website/src/components/video-embed.js create mode 100644 website/src/components/widgets.js delete mode 100755 website/src/css/main.css create mode 100644 website/src/html.js delete mode 100644 website/src/img/favicon/android-chrome-192x192.png delete mode 100644 website/src/img/favicon/manifest.json delete mode 100755 website/src/js/app.js create mode 100644 website/src/layouts/index.js create mode 100644 website/src/pages/blog.js create mode 100644 website/src/pages/community.js create mode 100644 website/src/pages/index.js create mode 100644 website/src/templates/blog-post.js create mode 100644 website/src/templates/doc-page.js rename website/{config/variables.js => src/theme.js} (100%) rename website/{site => }/static/.keep (100%) rename website/{site => }/static/_redirects (100%) rename website/{site => }/static/admin/config.yml (84%) rename website/{site => }/static/admin/index.html (100%) rename website/{site => }/static/img/create-password.png (100%) rename website/{site => }/static/img/email-subject.png (100%) rename website/{src => static}/img/favicon/apple-touch-icon.png (100%) rename website/{src => static}/img/favicon/browserconfig.xml (76%) rename website/{src => static}/img/favicon/favicon-16x16.png (100%) rename website/{src => static}/img/favicon/favicon-32x32.png (100%) rename website/{src => static}/img/favicon/favicon.ico (100%) rename website/{src/img/favicon/android-chrome-512x512.png => static/img/favicon/icon-512x512.png} (100%) rename website/{src => static}/img/favicon/mstile-144x144.png (100%) rename website/{src => static}/img/favicon/mstile-150x150.png (100%) rename website/{src => static}/img/favicon/mstile-310x150.png (100%) rename website/{src => static}/img/favicon/mstile-310x310.png (100%) rename website/{src => static}/img/favicon/mstile-70x70.png (100%) rename website/{src => static}/img/favicon/safari-pinned-tab.svg (100%) rename website/{site => }/static/img/screen shot 2018-01-05 at 4.25.07 pm.png (100%) rename website/{site => }/static/img/widgets-markdown.PNG (100%) delete mode 100755 website/webpack.conf.js diff --git a/.gitignore b/.gitignore index 02d67216..2ef2cbac 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,5 @@ yarn-error.log .vscode/ manifest.yml .imdone/ -website/site/data/contributors.yml -/coverage/ +website/data/contributors.json +/coverage/ diff --git a/.nvmrc b/.nvmrc index 1e8b3149..45a4fb75 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -6 +8 diff --git a/website/.babelrc b/website/.babelrc index a1b6bb78..b5d91ec8 100644 --- a/website/.babelrc +++ b/website/.babelrc @@ -1,7 +1,4 @@ { - "presets": ["es2015"], - "plugins": [ - "syntax-object-rest-spread", - "transform-object-rest-spread" - ] -} \ No newline at end of file + "presets": ["react", "es2015", "stage-1"], + "plugins": ["add-module-exports"] +} diff --git a/website/.eslintrc b/website/.eslintrc new file mode 100644 index 00000000..362eb8bf --- /dev/null +++ b/website/.eslintrc @@ -0,0 +1,5 @@ +{ + "globals": { + "graphql": true + } +} diff --git a/website/.gitignore b/website/.gitignore new file mode 100644 index 00000000..0174e7b8 --- /dev/null +++ b/website/.gitignore @@ -0,0 +1,3 @@ +.cache +public +dist diff --git a/website/.nvmrc b/website/.nvmrc index 64f5a0a6..45a4fb75 100644 --- a/website/.nvmrc +++ b/website/.nvmrc @@ -1 +1 @@ -node +8 diff --git a/website/README.md b/website/README.md index e6797129..3c175453 100755 --- a/website/README.md +++ b/website/README.md @@ -4,7 +4,7 @@ This directory builds netlifycms.org. If you'd like to propose changes to the si ## Local development -The site is built with [Hugo](https://gohugo.io/), managed as an npm dependency via [hugo-bin](https://www.npmjs.com/package/hugo-bin). +The site is built with [GatsbyJS](https://gatsbyjs.org/). To run the site locally, you'll need to have [Node](https://nodejs.org) and [Yarn](https://yarnpkg.com/en/) installed on your computer. @@ -15,5 +15,5 @@ yarn yarn start ``` -Then visit http://localhost:3000/ - BrowserSync will automatically reload CSS or -refresh the page when stylesheets or content changes. \ No newline at end of file +Then visit http://localhost:8000/ - Gatsby will automatically reload CSS or +refresh the page when stylesheets or content changes. diff --git a/website/site/content/.keep b/website/content/.keep similarity index 100% rename from website/site/content/.keep rename to website/content/.keep diff --git a/website/site/content/blog/netlify-cms-now-supports-gitlab-as-a-backend.md b/website/content/blog/netlify-cms-now-supports-gitlab-as-a-backend.md similarity index 100% rename from website/site/content/blog/netlify-cms-now-supports-gitlab-as-a-backend.md rename to website/content/blog/netlify-cms-now-supports-gitlab-as-a-backend.md diff --git a/website/site/content/docs/add-to-your-site.md b/website/content/docs/add-to-your-site.md similarity index 99% rename from website/site/content/docs/add-to-your-site.md rename to website/content/docs/add-to-your-site.md index c5d21d41..7c3fe161 100755 --- a/website/site/content/docs/add-to-your-site.md +++ b/website/content/docs/add-to-your-site.md @@ -1,13 +1,9 @@ --- title: Add to Your Site weight: 20 -menu: - docs: - parent: start +group: start --- -# Add Netlify CMS to Your Site - Netlify CMS is adaptable to a wide variety of projects. It works with any content written in markdown, JSON, YAML, or TOML files, stored in a repo on [GitHub](https://github.com/), [GitLab](https://about.gitlab.com/), or [Bitbucket](https://bitbucket.org). You can also create your own custom backend. This tutorial will guide you through the steps for adding Netlify CMS to a site that's built with a common [static site generator](https://www.staticgen.com/), like Jekyll, Hugo, Hexo, or Gatsby. Alternatively, you can [start from a template](https://www.netlifycms.org/docs/start-with-a-template) or dive right into to [configuration options](https://www.netlifycms.org/docs/configuration-options). @@ -126,7 +122,8 @@ public_folder: "/images/uploads" # The src attribute for uploaded media will beg The configuration above adds a new setting, `public_folder`. While `media_folder` specifies where uploaded files will be saved in the repo, `public_folder` indicates where they can be found in the published site. This path is used in image `src` attributes and is relative to the file where it's called. For this reason, we usually start the path at the site root, using the opening `/`. -_If `public_folder` is not set, Netlify CMS will default to the same value as `media_folder`, adding an opening `/` if one is not included._ +*If `public_folder` is not set, Netlify CMS will default to the same value as `media_folder`, adding an opening `/` if one is not included.* + ### Collections diff --git a/website/site/content/docs/architecture.md b/website/content/docs/architecture.md similarity index 98% rename from website/site/content/docs/architecture.md rename to website/content/docs/architecture.md index fe3cd49f..c0cea65a 100755 --- a/website/site/content/docs/architecture.md +++ b/website/content/docs/architecture.md @@ -1,13 +1,9 @@ --- title: Architecture -weight: 90 -menu: - docs: - parent: reference +position: 90 +group: contributing --- -# Technical Architecture - Netlify CMS is a React application, using Redux for state management with immutable data structures (immutable.js). The core abstractions for content editing are `collections`, `entries` and `widgets`. diff --git a/website/site/content/docs/authentication-backends.md b/website/content/docs/authentication-backends.md similarity index 99% rename from website/site/content/docs/authentication-backends.md rename to website/content/docs/authentication-backends.md index 84308cf0..a4b1eb77 100644 --- a/website/site/content/docs/authentication-backends.md +++ b/website/content/docs/authentication-backends.md @@ -1,11 +1,8 @@ --- title: Authentication & Backends weight: 25 -menu: - docs: - parent: start +group: start --- -# Authentication & Backends Netlify CMS stores content in your GitHub, GitLab, or Bitbucket repository. In order for this to work, you need to authenticate with your Git host, and in most cases that requires a server. We have a few options for handling this. diff --git a/website/site/content/docs/beta-features.md b/website/content/docs/beta-features.md similarity index 99% rename from website/site/content/docs/beta-features.md rename to website/content/docs/beta-features.md index 3cb25b54..8b276448 100644 --- a/website/site/content/docs/beta-features.md +++ b/website/content/docs/beta-features.md @@ -1,11 +1,9 @@ --- title: Beta Features! weight: 200 -menu: - docs: - parent: reference +group: reference --- -# Beta Features! + We run new functionality in an open beta format from time to time. That means that this functionality is totally available for use, and we _think_ it might be ready for primetime, but it could break or change without notice. **Use these features at your own risk.** diff --git a/website/site/content/docs/collection-types.md b/website/content/docs/collection-types.md similarity index 98% rename from website/site/content/docs/collection-types.md rename to website/content/docs/collection-types.md index f0b4af24..d1db9c9b 100644 --- a/website/site/content/docs/collection-types.md +++ b/website/content/docs/collection-types.md @@ -1,11 +1,8 @@ --- title: Collection Types weight: 27 -menu: - docs: - parent: start +group: start --- -# Collection Types All editable content types are defined in the `collections` field of your `config.yml` file, and display in the left sidebar of the Content page of the editor UI. diff --git a/website/site/content/docs/configuration-options.md b/website/content/docs/configuration-options.md similarity index 99% rename from website/site/content/docs/configuration-options.md rename to website/content/docs/configuration-options.md index d47a8319..a912871c 100644 --- a/website/site/content/docs/configuration-options.md +++ b/website/content/docs/configuration-options.md @@ -1,13 +1,9 @@ --- title: Configuration Options weight: 23 -menu: - docs: - parent: reference +group: reference --- -# Configuration Options - All configuration options for Netlify CMS are specified in a `config.yml` file, in the folder where you access the editor UI (usually in the `/admin` folder). Alternatively, you can specify a custom config file using a link tag: diff --git a/website/site/content/docs/contributor-guide.md b/website/content/docs/contributor-guide.md similarity index 93% rename from website/site/content/docs/contributor-guide.md rename to website/content/docs/contributor-guide.md index e5dd6503..56f54851 100644 --- a/website/site/content/docs/contributor-guide.md +++ b/website/content/docs/contributor-guide.md @@ -1,13 +1,9 @@ --- title: Contributor Guide weight: 100 -menu: - docs: - parent: contributing +group: contributing --- -# Welcome, contributors! - We're hoping that Netlify CMS will do for the [JAMstack](https://www.jamstack.org) what WordPress did for dynamic sites back in the day. We know we can't do that without building a thriving community of contributors and users, and we'd love to have you join us. While we work on building this page (and you can help!), here are some links with more information about getting involved: diff --git a/website/site/content/docs/custom-widgets.md b/website/content/docs/custom-widgets.md similarity index 99% rename from website/site/content/docs/custom-widgets.md rename to website/content/docs/custom-widgets.md index dbd726d6..f636966e 100644 --- a/website/site/content/docs/custom-widgets.md +++ b/website/content/docs/custom-widgets.md @@ -1,11 +1,8 @@ --- title: Creating Custom Widgets weight: 35 -menu: - docs: - parent: guides +group: guides --- -# Custom Widgets The NetlifyCMS exposes a `window.CMS` global object that you can use to register custom widgets, previews, and editor plugins. The same object is also the default export if you import Netify CMS as an npm module. The available widget extension methods are: @@ -22,12 +19,12 @@ However, although possible, it may be cumbersome or even impractical to add a Re Register a custom widget. -```js -// Using global window object -CMS.registerWidget(name, control, [preview]); - -// Using npm module import -import CMS from 'netlify-cms'; +```js +// Using global window object +CMS.registerWidget(name, control, [preview]); + +// Using npm module import +import CMS from 'netlify-cms'; CMS.registerWidget(name, control, [preview]); ``` diff --git a/website/site/content/docs/customization.md b/website/content/docs/customization.md similarity index 98% rename from website/site/content/docs/customization.md rename to website/content/docs/customization.md index 84bf3b42..613388ea 100644 --- a/website/site/content/docs/customization.md +++ b/website/content/docs/customization.md @@ -1,11 +1,8 @@ --- title: Creating Custom Previews -weight: 50 -menu: - docs: - parent: guides +position: 50 +group: guides --- -# Customizing the Preview Pane The NetlifyCMS exposes a `window.CMS` global object that you can use to register custom widgets, previews and editor plugins. The available customization methods are: diff --git a/website/site/content/docs/examples.md b/website/content/docs/examples.md similarity index 96% rename from website/site/content/docs/examples.md rename to website/content/docs/examples.md index ef34eeb3..bf47c32f 100644 --- a/website/site/content/docs/examples.md +++ b/website/content/docs/examples.md @@ -1,13 +1,9 @@ --- title: Examples weight: 110 -menu: - docs: - parent: start +group: start --- -# Examples - Do you have a great, open source example? Submit a pull request to this page! Example | Tools | Type | Source | More info | diff --git a/website/site/content/docs/intro.md b/website/content/docs/intro.md similarity index 97% rename from website/site/content/docs/intro.md rename to website/content/docs/intro.md index 5e630be8..e6efc807 100755 --- a/website/site/content/docs/intro.md +++ b/website/content/docs/intro.md @@ -1,13 +1,9 @@ --- title: Introduction weight: 1 -menu: - docs: - parent: start +group: start --- -# Introduction - Netlify CMS is an open source content management system for your Git workflow that enables you to provide editors with friendly UI and intuitive workflow. You can use it with any static site generator to create faster, more flexible web projects. Content is stored in your Git repository alongside your code for easier versioning, multi-channel publishing, and the option to handle content updates directly in Git. At its core, Netlify CMS is an open-source React app that acts as a wrapper for the Git workflow, using the GitHub, GitLab, or Bitbucket API. This provides many advantages, including: diff --git a/website/site/content/docs/start-with-a-template.md b/website/content/docs/start-with-a-template.md similarity index 98% rename from website/site/content/docs/start-with-a-template.md rename to website/content/docs/start-with-a-template.md index 5d0b2072..9808e7ac 100644 --- a/website/site/content/docs/start-with-a-template.md +++ b/website/content/docs/start-with-a-template.md @@ -1,13 +1,9 @@ --- title: Start with a Template weight: 10 -menu: - docs: - parent: start +group: start --- -# Start with a Template - Netlify CMS can be [added to an existing site](https://www.netlifycms.org/docs/add-to-your-site), but the quickest way to get started is with a template. Our featured templates below deploy to Netlify, giving you a fully working CMS-enabled site with just a few clicks.
diff --git a/website/site/content/docs/update-the-cms-version.md b/website/content/docs/update-the-cms-version.md similarity index 94% rename from website/site/content/docs/update-the-cms-version.md rename to website/content/docs/update-the-cms-version.md index 4a83d891..1a6482d1 100644 --- a/website/site/content/docs/update-the-cms-version.md +++ b/website/content/docs/update-the-cms-version.md @@ -1,13 +1,9 @@ --- title: Update the CMS Version weight: 60 -menu: - docs: - parent: start +group: start --- -# Update the CMS Version - The update procedure for your CMS depends upon the method you used to install Netlify CMS. ## Package Manager diff --git a/website/site/content/docs/widgets/boolean.md b/website/content/docs/widgets/boolean.md similarity index 90% rename from website/site/content/docs/widgets/boolean.md rename to website/content/docs/widgets/boolean.md index 4aa65713..083cee69 100644 --- a/website/site/content/docs/widgets/boolean.md +++ b/website/content/docs/widgets/boolean.md @@ -1,10 +1,8 @@ --- label: "Boolean" -target: "boolean" +target: boolean --- -### Boolean - The boolean widget translates a toggle switch input to a true/false value. - **Name:** `boolean` @@ -16,4 +14,4 @@ The boolean widget translates a toggle switch input to a true/false value. ```yaml - {label: "Draft", name: "draft", widget: "boolean", default: true} - ``` \ No newline at end of file + ``` diff --git a/website/site/content/docs/widgets/date.md b/website/content/docs/widgets/date.md similarity index 95% rename from website/site/content/docs/widgets/date.md rename to website/content/docs/widgets/date.md index a962fd9f..42e6b273 100644 --- a/website/site/content/docs/widgets/date.md +++ b/website/content/docs/widgets/date.md @@ -1,10 +1,8 @@ --- label: "Date" -target: "date" +target: date --- -### Date - The date widget translates a date picker input to a date string. For saving date and time together, use the datetime widget. - **Name:** `date` @@ -21,4 +19,4 @@ The date widget translates a date picker input to a date string. For saving date widget: "date" default: "" format: "MMM Do YY" - ``` \ No newline at end of file + ``` diff --git a/website/site/content/docs/widgets/datetime.md b/website/content/docs/widgets/datetime.md similarity index 95% rename from website/site/content/docs/widgets/datetime.md rename to website/content/docs/widgets/datetime.md index 8bf02a04..65f2700b 100644 --- a/website/site/content/docs/widgets/datetime.md +++ b/website/content/docs/widgets/datetime.md @@ -1,10 +1,8 @@ --- label: "DateTime" -target: "datetime" +target: datetime --- -### DateTime - The datetime widget translates a datetime picker to a datetime string. For saving the date only, use the date widget. - **Name:** `datetime` diff --git a/website/site/content/docs/widgets/file.md b/website/content/docs/widgets/file.md similarity index 94% rename from website/site/content/docs/widgets/file.md rename to website/content/docs/widgets/file.md index 4b0bdb77..dbe3186c 100644 --- a/website/site/content/docs/widgets/file.md +++ b/website/content/docs/widgets/file.md @@ -1,10 +1,8 @@ --- label: "File" -target: "file" +target: file --- -### File - The file widget allows editors to upload a file or select an existing one from the media library. The path to the file will be saved to the field as a string. - **Name:** `file` @@ -19,4 +17,4 @@ The file widget allows editors to upload a file or select an existing one from t name: "manual_pdf" widget: "file" default: "/uploads/general-manual.pdf" - ``` \ No newline at end of file + ``` diff --git a/website/site/content/docs/widgets/hidden.md b/website/content/docs/widgets/hidden.md similarity index 93% rename from website/site/content/docs/widgets/hidden.md rename to website/content/docs/widgets/hidden.md index 8f18b566..4e5fffeb 100644 --- a/website/site/content/docs/widgets/hidden.md +++ b/website/content/docs/widgets/hidden.md @@ -1,10 +1,8 @@ --- label: "Hidden" -target: "hidden" +target: hidden --- -### Hidden - Hidden widgets do not display in the UI. In folder collections that allow users to create new items, you will often want to set a default for hidden fields, so they will be set without requiring an input. - **Name:** `hidden` @@ -16,4 +14,4 @@ Hidden widgets do not display in the UI. In folder collections that allow users ```yaml - {label: "Layout", name: "layout", widget: "hidden", default: "blog"} - ``` \ No newline at end of file + ``` diff --git a/website/site/content/docs/widgets/image.md b/website/content/docs/widgets/image.md similarity index 95% rename from website/site/content/docs/widgets/image.md rename to website/content/docs/widgets/image.md index 534c3bcc..4af9f8bf 100644 --- a/website/site/content/docs/widgets/image.md +++ b/website/content/docs/widgets/image.md @@ -1,10 +1,8 @@ --- label: "Image" -target: "image" +target: image --- -### Image - The image widget allows editors to upload an image or select an existing one from the media library. The path to the image file will be saved to the field as a string. - **Name:** `image` @@ -19,4 +17,4 @@ The image widget allows editors to upload an image or select an existing one fro name: "thumbnail" widget: "image" default: "/uploads/chocolate-dogecoin.jpg" - ``` \ No newline at end of file + ``` diff --git a/website/site/content/docs/widgets/index.md b/website/content/docs/widgets/index.md similarity index 97% rename from website/site/content/docs/widgets/index.md rename to website/content/docs/widgets/index.md index a3632353..6c533d51 100644 --- a/website/site/content/docs/widgets/index.md +++ b/website/content/docs/widgets/index.md @@ -1,13 +1,9 @@ --- title: Widgets weight: 30 -menu: - docs: - parent: reference +group: reference --- -# Widgets - Widgets define the data type and interface for entry fields. Netlify CMS comes with several built-in widgets. Click the widget names in the sidebar to jump to specific widget details. We’re always adding new widgets, and you can also [create your own](https://www.netlifycms.org/docs/custom-widgets)! Widgets are specified as collection fields in the Netlify CMS `config.yml` file. Note that [YAML syntax](https://en.wikipedia.org/wiki/YAML#Basic_components) allows lists and objects to be written in block or inline style, and the code samples below include a mix of both. diff --git a/website/site/content/docs/widgets/list.md b/website/content/docs/widgets/list.md similarity index 98% rename from website/site/content/docs/widgets/list.md rename to website/content/docs/widgets/list.md index 38125ba8..41181f29 100644 --- a/website/site/content/docs/widgets/list.md +++ b/website/content/docs/widgets/list.md @@ -1,10 +1,8 @@ --- label: "List" -target: "list" +target: list --- -### List - The list widget allows you to create a repeatable item in the UI which saves as a list of widget values. map a user-provided string with a comma delimiter into a list. You can choose any widget as a child of a list widget—even other lists. - **Name:** `list` diff --git a/website/site/content/docs/widgets/markdown.md b/website/content/docs/widgets/markdown.md similarity index 97% rename from website/site/content/docs/widgets/markdown.md rename to website/content/docs/widgets/markdown.md index 75c8a479..2df28322 100644 --- a/website/site/content/docs/widgets/markdown.md +++ b/website/content/docs/widgets/markdown.md @@ -1,10 +1,8 @@ --- label: "Markdown" -target: "markdown" +target: markdown --- -### Markdown - The markdown widget provides a full fledged text editor - which is based on [slate](https://github.com/ianstormtaylor/slate) - that allows users to format text with features such as headings and blockquotes. Users are also allowed to write in markdown by simply flipping a switch. *Please note:* in case you want to use your markdown editor to fill a markdown's file content after the frontmatter, you'll have name the field as `body` so then the CMS can recognize it and save the file accordingly. diff --git a/website/site/content/docs/widgets/number.md b/website/content/docs/widgets/number.md similarity index 95% rename from website/site/content/docs/widgets/number.md rename to website/content/docs/widgets/number.md index f90014a2..383f35f4 100644 --- a/website/site/content/docs/widgets/number.md +++ b/website/content/docs/widgets/number.md @@ -1,11 +1,8 @@ --- label: "Number" -target: "number" +target: number --- -### Number - - The number widget uses an HTML number input, saving the value as a string, integer, or floating point number. - **Name:** `number` @@ -26,4 +23,4 @@ The number widget uses an HTML number input, saving the value as a string, integ valueType: "int" min: 1 max: 101 - ``` \ No newline at end of file + ``` diff --git a/website/site/content/docs/widgets/object.md b/website/content/docs/widgets/object.md similarity index 97% rename from website/site/content/docs/widgets/object.md rename to website/content/docs/widgets/object.md index 38513415..fb3eb6c8 100644 --- a/website/site/content/docs/widgets/object.md +++ b/website/content/docs/widgets/object.md @@ -1,10 +1,8 @@ --- label: "Object" -target: "object" +target: object --- -### Object - The object widget allows you to group multiple widgets together, nested under a single field. You can choose any widget as a child of an object widget—even other objects. - **Name:** `object` @@ -34,4 +32,4 @@ The object widget allows you to group multiple widgets together, nested under a - {label: "Street Address", name: "street", widget: "string"} - {label: "City", name: "city", widget: "string"} - {label: "Postal Code", name: "post-code", widget: "string"} - ``` \ No newline at end of file + ``` diff --git a/website/site/content/docs/widgets/relation.md b/website/content/docs/widgets/relation.md similarity index 97% rename from website/site/content/docs/widgets/relation.md rename to website/content/docs/widgets/relation.md index 3be24bcd..6d5af6f4 100644 --- a/website/site/content/docs/widgets/relation.md +++ b/website/content/docs/widgets/relation.md @@ -1,10 +1,8 @@ --- label: "Relation" -target: "relation" +target: relation --- -### Relation - The relation widget allows you to reference items from another collection. It provides a search input with a list of entries from the collection you're referencing, and the list automatically updates with matched entries based on what you've typed. - **Name:** `relation` diff --git a/website/site/content/docs/widgets/select.md b/website/content/docs/widgets/select.md similarity index 97% rename from website/site/content/docs/widgets/select.md rename to website/content/docs/widgets/select.md index 2c527169..2cf37ed7 100644 --- a/website/site/content/docs/widgets/select.md +++ b/website/content/docs/widgets/select.md @@ -1,10 +1,8 @@ --- label: "Select" -target: "select" +target: select --- -### Select - The select widget allows you to pick a single string value from a dropdown menu. - **Name:** `select` diff --git a/website/site/content/docs/widgets/string.md b/website/content/docs/widgets/string.md similarity index 92% rename from website/site/content/docs/widgets/string.md rename to website/content/docs/widgets/string.md index c5b2c114..bb5e8afb 100644 --- a/website/site/content/docs/widgets/string.md +++ b/website/content/docs/widgets/string.md @@ -1,10 +1,8 @@ --- label: "String" -target: "string" +target: string --- -### String - The string widget translates a basic text input to a string value. For larger textarea inputs, use the text widget. - **Name:** `string` diff --git a/website/site/content/docs/widgets/text.md b/website/content/docs/widgets/text.md similarity index 93% rename from website/site/content/docs/widgets/text.md rename to website/content/docs/widgets/text.md index d0ff72df..f1e0392d 100644 --- a/website/site/content/docs/widgets/text.md +++ b/website/content/docs/widgets/text.md @@ -1,10 +1,8 @@ --- label: "Text" -target: "text" +target: text --- -### Text - The text widget takes a multiline text field and saves it as a string. For shorter text inputs, use the string widget. - **Name:** `text` diff --git a/website/site/content/pages/community.md b/website/content/pages/community.md similarity index 96% rename from website/site/content/pages/community.md rename to website/content/pages/community.md index 2bc747ed..3561904b 100644 --- a/website/site/content/pages/community.md +++ b/website/content/pages/community.md @@ -1,7 +1,5 @@ --- title: Community -layout: community -url: /community headline: Be a part of building the CMS of the future. subhead: We’re serious about being community driven, so everyone is welcome to join the [community chat](https://gitter.im/netlify/NetlifyCMS), and to be a part of our bi-weekly planning sessions (details below). diff --git a/website/site/data/.keep b/website/data/.keep similarity index 100% rename from website/site/data/.keep rename to website/data/.keep diff --git a/website/site/data/docs.yml b/website/data/docs.yml similarity index 97% rename from website/site/data/docs.yml rename to website/data/docs.yml index cbc20bb1..168f6f02 100644 --- a/website/site/data/docs.yml +++ b/website/data/docs.yml @@ -1,4 +1,3 @@ ---- styleoverrides: '/docs.css' headline: Netlify builds, deploys, and hosts your front end. bottomcta: @@ -10,4 +9,3 @@ bottomcta: - type: secondary btntext: Read our Tutorials linksto: /tags/tutorial/ ---- \ No newline at end of file diff --git a/website/site/data/global.yaml b/website/data/global.yaml similarity index 95% rename from website/site/data/global.yaml rename to website/data/global.yaml index 4313f631..e5addedc 100644 --- a/website/site/data/global.yaml +++ b/website/data/global.yaml @@ -1,8 +1,6 @@ ---- footer: buttons: - name: "Twitter" url: "https://twitter.com/netlifycms" - name: "GitHub" url: "https://github.com/netlify/netlify-cms" ---- diff --git a/website/site/data/landing.yaml b/website/data/landing.yaml similarity index 95% rename from website/site/data/landing.yaml rename to website/data/landing.yaml index 3e3452b9..460899c2 100644 --- a/website/site/data/landing.yaml +++ b/website/data/landing.yaml @@ -1,4 +1,3 @@ ---- hero: headline: "Open source content management for your Git workflow" subhead: "Use Netlify CMS with any static site generator for a faster and more flexible web project" @@ -21,13 +20,13 @@ editors: features: - feature: "Editor-friendly user interface" description: "The web-based app includes rich-text editing, real-time preview, and drag-and-drop media uploads." - imgpath: "/img/feature-editor.svg" + imgpath: "feature-editor.svg" - feature: "Intuitive workflow for content teams" description: "Writers and editors can easily manage content from draft to review to publish across any number of custom content types." - imgpath: "/img/feature-workflow.svg" + imgpath: "feature-workflow.svg" - feature: "Instant access without GitHub account" description: "With [Git Gateway](/docs/authentication-backends/#git-gateway-with-netlify-identity), you can add CMS access for any team member — even if they don’t have a GitHub account. " - imgpath: "/img/feature-access.svg" + imgpath: "feature-access.svg" community: hook: "Supported by a growing community" @@ -40,4 +39,3 @@ community: description: "Netlify CMS is built by a community of more than 100 contributors — and you can help. Join our [bi-weekly planning sessions](/community) or read the [contributing guide](/docs/contributor-guide) to join in." contributors: "Made possible by awesome contributors" ---- diff --git a/website/data/notifications.yml b/website/data/notifications.yml new file mode 100644 index 00000000..027bf0e9 --- /dev/null +++ b/website/data/notifications.yml @@ -0,0 +1,22 @@ +notifications: +- loud: true + message: >- + Register to join us online for our next community dev meeting, every other + Wednesday at 9am-10am PT! + published: false + title: Netlify CMS Development Planning Sessions Promo + url: >- + https://www.eventbrite.com/e/netlify-cms-planning-session-bi-weekly-tickets-35794058994 +- loud: true + message: >- + We have a community on Gitter - join now to ask questions and discuss the + project with other devs! + published: false + title: Gitter shoutout + url: 'https://gitter.im/netlify/netlifycms' +- loud: true + message: >- + Netlify CMS now supports GitLab! + published: true + title: GitLab announcement + url: '/blog/2018/06/netlify-cms-now-supports-gitlab-as-a-backend/' diff --git a/website/site/data/updates.yml b/website/data/updates.yml similarity index 85% rename from website/site/data/updates.yml rename to website/data/updates.yml index f5647a0d..cf38bbd1 100644 --- a/website/site/data/updates.yml +++ b/website/data/updates.yml @@ -45,59 +45,59 @@ updates: - date: '2018-03-29' description: 'More control over filenames, lots of bugfixes, and new beta features!' version: 1.4.0 - - date: 2018-03-06T00:00:00.000Z + - date: '2018-03-06' description: Fixes styling issues version: 1.3.5 - - date: 2018-03-06T00:00:00.000Z + - date: '2018-03-06' description: Fixes editorial workflow entry failure. version: 1.3.4 - - date: 2018-03-06T00:00:00.000Z + - date: '2018-03-06' description: Fixes load failure version: 1.3.3 - - date: 2018-03-06T00:00:00.000Z + - date: '2018-03-06' description: >- Fixes date widget default format, collection load failure when entry fails. version: 1.3.2 - - date: 2018-03-03T00:00:00.000Z + - date: '2018-03-03' description: Fixes editorial workflow failure for unknown collections. version: 1.3.1 - - date: 2018-02-27T00:00:00.000Z + - date: '2018-02-27' description: >- Multi-part extensions, e.g. "en.md", a11y improvements in the editor, and bugfixes. version: 1.3.0 - - date: 2018-02-21T00:00:00.000Z + - date: '2018-02-21' description: Fixes ES5 transpiling. version: 1.2.2 - - date: 2018-02-21T00:00:00.000Z + - date: '2018-02-21' description: >- Allows label_singular config for collections and lists and distinct frontmatter delimiters. version: 1.2.1 - - date: 2018-02-13T00:00:00.000Z + - date: '2018-02-13' description: >- Adds support for multiple frontmatter formats and custom delimiters, UI improvements. version: '1.2' - - date: 2018-01-25T00:00:00.000Z + - date: '2018-01-25' description: You can now register external backends and we improved metadata handling. version: '1.1' - - date: 2018-01-23T00:00:00.000Z + - date: '2018-01-23' description: >- Fixes various UI bugs and adds expand / collapse functionality to the object widget. version: 1.0.4 - - date: 2018-12-19T00:00:00.000Z + - date: '2018-12-19' description: Small bug fix release. version: 1.0.3 - - date: 2018-12-07T00:00:00.000Z + - date: '2018-12-07' description: Small bug fix release. version: 1.0.2 - - date: 2018-12-07T00:00:00.000Z + - date: '2018-12-07' description: Small bug fix release. version: 1.0.1 - - date: 2018-12-07T00:00:00.000Z + - date: '2018-12-07' description: >- The first major release of Netlify CMS with an all-new UI, revamped documentation and much more. diff --git a/website/gatsby-browser.js b/website/gatsby-browser.js new file mode 100644 index 00000000..16395bdf --- /dev/null +++ b/website/gatsby-browser.js @@ -0,0 +1,10 @@ +import SmoothScroll from 'smooth-scroll'; + +// Make scroll behavior of internal links smooth +exports.onClientEntry = () => { + new SmoothScroll('a[href*="#"]', { + offset() { + return document.querySelector('#header').offsetHeight; + } + }); +}; diff --git a/website/gatsby-config.js b/website/gatsby-config.js new file mode 100644 index 00000000..4af8061b --- /dev/null +++ b/website/gatsby-config.js @@ -0,0 +1,96 @@ +const pkg = require('./package.json'); + +const neatgrid = require('postcss-neat'); +const nestedcss = require('postcss-nested'); +const colorfunctions = require('postcss-colour-functions'); +const hdBackgrounds = require('postcss-at2x'); +const cssextend = require('postcss-simple-extend'); +const cssvars = require('postcss-simple-vars-async'); + +const styleVariables = require('./src/theme'); + +const postCssPlugins = [ + neatgrid(), + nestedcss(), + colorfunctions(), + hdBackgrounds(), + cssextend(), + cssvars({ variables: styleVariables }) +]; + +module.exports = { + siteMetadata: { + title: 'Netlify CMS | Open-Source Content Management System', + description: 'Open source content management for your Git workflow', + siteUrl: pkg.homepage, + menu: { + docs: [ + { + name: 'start', + title: 'Quick Start' + }, + { + name: 'guides', + title: 'Guides' + }, + { + name: 'reference', + title: 'Reference' + }, + { + name: 'contributing', + title: 'Contributing' + } + ] + } + }, + plugins: [ + { + resolve: 'gatsby-source-filesystem', + options: { + path: `${__dirname}/content`, + name: 'content' + } + }, + 'gatsby-transformer-yaml', + 'gatsby-transformer-json', + { + resolve: 'gatsby-source-filesystem', + options: { + path: `${__dirname}/data`, + name: 'data' + } + }, + { + resolve: 'gatsby-transformer-remark', + options: { + // prettier-ignore + plugins: [ + 'gatsby-remark-autolink-headers', + 'gatsby-remark-prismjs' + ] + } + }, + { + resolve: 'gatsby-plugin-postcss-sass', + options: { + postCssPlugins + } + }, + 'gatsby-plugin-react-helmet', + 'gatsby-plugin-react-next', + 'gatsby-plugin-catch-links', + { + resolve: `gatsby-plugin-manifest`, + options: { + name: 'NetlifyCMS', + short_name: 'NetlifyCMS', + start_url: '/', + background_color: '#ffffff', + theme_color: '#ffffff', + display: 'standalone', + icon: 'static/img/favicon/icon-512x512.png' + } + } + ] +}; diff --git a/website/gatsby-node.js b/website/gatsby-node.js new file mode 100644 index 00000000..7b6b8442 --- /dev/null +++ b/website/gatsby-node.js @@ -0,0 +1,91 @@ +const path = require('path'); +const { createFilePath } = require('gatsby-source-filesystem'); + +exports.createPages = async ({ graphql, boundActionCreators }) => { + const { createPage } = boundActionCreators; + + const docPage = path.resolve('./src/templates/doc-page.js'); + const blogPost = path.resolve('./src/templates/blog-post.js'); + + // get all markdown with a frontmatter path field and title + const allMarkdown = await graphql(` + { + allMarkdownRemark(filter: { frontmatter: { title: { ne: null } } }) { + edges { + node { + fields { + slug + } + frontmatter { + title + } + } + } + } + } + `); + + if (allMarkdown.errors) { + console.error(allMarkdown.errors); + throw Error(allMarkdown.errors); + } + + allMarkdown.data.allMarkdownRemark.edges.forEach(({ node }) => { + const { slug } = node.fields; + + let template = docPage; + + if (slug.includes('blog/')) { + template = blogPost; + } + + createPage({ + path: slug, + component: template, + context: { + slug + } + }); + }); +}; + +const pad = n => (n >= 10 ? n : `0${n}`); + +exports.onCreateNode = ({ node, boundActionCreators, getNode }) => { + const { createNodeField } = boundActionCreators; + + if (node.internal.type === 'MarkdownRemark') { + const value = createFilePath({ node, getNode }); + const { relativePath } = getNode(node.parent); + + let slug = value; + + if (relativePath.includes('blog/')) { + const date = new Date(node.frontmatter.date); + const year = date.getFullYear(); + const month = date.getMonth() + 1; + const filename = path.basename(relativePath, '.md'); + slug = `/blog/${year}/${pad(month)}/${filename}`; + + createNodeField({ + node, + name: 'date', + value: date.toJSON() + }); + } + + // used for doc posts + createNodeField({ + node, + name: 'slug', + value: slug + }); + + // used to create GitHub edit link + createNodeField({ + node, + name: 'path', + value: relativePath + }); + } +}; diff --git a/website/gulpfile.babel.js b/website/gulpfile.babel.js deleted file mode 100755 index 35a8a28f..00000000 --- a/website/gulpfile.babel.js +++ /dev/null @@ -1,128 +0,0 @@ -import gulp from "gulp"; -import cp from "child_process"; -import hugoBin from "hugo-bin"; -import gutil from "gulp-util"; -import postcss from "gulp-postcss"; -import transform from "gulp-transform"; -import yaml from "yamljs"; -import rename from "gulp-rename"; -import cssImport from "postcss-import"; -import neatgrid from "postcss-neat"; -import nestedcss from "postcss-nested"; -import colorfunctions from "postcss-colour-functions"; -import hdBackgrounds from "postcss-at2x"; -import cssvars from "postcss-simple-vars-async"; -import cssextend from "postcss-simple-extend"; -import styleVariables from "./config/variables"; -import BrowserSync from "browser-sync"; -import webpack from "webpack"; -import webpackConfig from "./webpack.conf"; -import url from "url"; - -// Always exit non-zero on unhandled promise rejection -process.on('unhandledRejection', err => { throw err }); - -const browserSync = BrowserSync.create(); -const defaultArgs = ["-d", "../dist", "-s", "site", "-v"]; - -function buildSite(cb, options) { - const args = options ? defaultArgs.concat(options) : defaultArgs; - return cp.spawn(hugoBin, args, { stdio: "inherit" }).on("close", code => { - if (code === 0) { - browserSync.reload(); - cb(); - } else { - browserSync.notify("Hugo build failed :("); - cb("Hugo build failed"); - } - }); -} - -gulp.task("hugo", ["copy"], cb => buildSite(cb)); -gulp.task("hugo-preview", ["copy"], cb => - buildSite(cb, ["--buildDrafts", "--buildFuture"]) -); - -gulp.task("build", ["css", "js", "images", "hugo"]); -gulp.task("build-preview", ["css", "js", "images", "hugo-preview"]); - -gulp.task("css", () => - gulp - .src("./src/css/**/*.css") - .pipe( - postcss([ - cssImport({ from: "./src/css/main.css" }), - neatgrid(), - nestedcss(), - colorfunctions(), - hdBackgrounds(), - cssextend(), - cssvars({ variables: styleVariables }) - ]) - ) - .pipe(gulp.dest("./dist/css")) - .pipe(browserSync.stream()) -); - -gulp.task("js", cb => { - const myConfig = Object.assign({}, webpackConfig); - - webpack(myConfig, (err, stats) => { - if (err) throw new gutil.PluginError("webpack", err); - gutil.log( - "[webpack]", - stats.toString({ - colors: true, - progress: true - }) - ); - browserSync.reload(); - cb(); - }); -}); - -gulp.task("images", () => - gulp - .src("./src/img/**/*") - .pipe(gulp.dest("./dist/img")) - .pipe(browserSync.stream()) -); - -gulp.task("copy", () => - gulp - .src("../.all-contributorsrc") - .pipe( - transform( - "utf8", - content => - new Promise((resolve, reject) => { - const contributors = JSON.parse(content).contributors.map(c => { - const avatar = url.parse(c['avatar_url'], true); - avatar.search = undefined; // Override so that we can use `avatar.query`. - if (avatar.hostname.endsWith('githubusercontent.com')) { - // Use 32px avatars, instead of full-size. - avatar.query['s'] = '32'; - } - const avatar_url = url.format(avatar); - return Object.assign({}, c, { avatar_url }); - }); - resolve(yaml.dump({ contributors })); - }) - ) - ) - .pipe(rename("contributors.yml")) - .pipe(gulp.dest("./site/data")) -); - -gulp.task("server", ["css", "js", "images", "hugo"], () => { - browserSync.init({ - server: { - baseDir: "./dist" - }, - notify: false - }); - gulp.watch("./src/js/**/*.js", ["js"]); - gulp.watch("./src/css/**/*.css", ["css"]); - gulp.watch("./src/img/**/*", ["images"]); - gulp.watch("./site/**/*", ["hugo"]); -}); diff --git a/website/package.json b/website/package.json index 81971acb..7899af42 100755 --- a/website/package.json +++ b/website/package.json @@ -1,55 +1,46 @@ { - "name": "victor-hugo", + "name": "netlify-cms-site", "version": "1.0.0", - "description": "Victor Hugo is a Hugo boilerplate for creating truly epic websites!", - "main": "index.js", + "description": "Netlify CMS documentation website built with Gatsby", "scripts": { - "hugo": "gulp hugo", - "webpack": "gulp webpack", - "build": "gulp build", - "build-preview": "gulp build-preview", - "start": "gulp server", + "start": "gatsby develop", + "build": "gatsby build && mv public dist", + "copy:contribs": "cp ../.all-contributorsrc data/contributors.json", + "prepare": "npm run copy:contribs", + "reset": "rm -rf .cache", "lint": "eslint src" }, "author": "", + "homepage": "https://www.netlifycms.org/", "license": "MIT", "dependencies": { - "autoprefixer": "^6.3.7", - "babel-eslint": "^6.1.2", - "babel-loader": "^6.2.4", - "babel-plugin-syntax-object-rest-spread": "^6.13.0", - "babel-plugin-transform-class-properties": "^6.10.2", - "babel-plugin-transform-object-assign": "^6.8.0", - "babel-plugin-transform-object-rest-spread": "^6.8.0", - "babel-preset-es2015": "^6.9.0", - "babel-register": "^6.11.6", - "browser-sync": "^2.13.0", - "css-loader": "^0.23.1", + "classnames": "^2.2.5", "eslint": "^3.1.1", "eslint-plugin-import": "^1.11.1", - "exports-loader": "^0.6.3", - "file-loader": "^0.9.0", - "gulp": "^3.9.1", - "gulp-babel": "^6.1.2", - "gulp-postcss": "^6.1.1", - "gulp-rename": "^1.2.2", - "gulp-transform": "^3.0.5", - "gulp-util": "^3.0.7", - "hugo-bin": "^0.23.0", - "imports-loader": "^0.6.5", + "gatsby": "^1.9.270", + "gatsby-plugin-catch-links": "^1.0.22", + "gatsby-plugin-manifest": "^1.0.21", + "gatsby-plugin-postcss-sass": "^1.0.20", + "gatsby-plugin-react-helmet": "^2.0.11", + "gatsby-plugin-react-next": "^1.0.11", + "gatsby-remark-autolink-headers": "^1.4.18", + "gatsby-remark-prismjs": "^2.0.2", + "gatsby-source-filesystem": "^1.5.35", + "gatsby-transformer-json": "^1.0.17", + "gatsby-transformer-remark": "^1.7.42", + "gatsby-transformer-yaml": "^1.5.16", "postcss-at2x": "^2.0.0", "postcss-colour-functions": "^1.5.1", "postcss-cssnext": "^2.7.0", - "postcss-import": "^8.1.2", - "postcss-loader": "^0.9.1", "postcss-neat": "^2.5.2", "postcss-nested": "^1.0.0", "postcss-simple-extend": "^1.0.0", "postcss-simple-vars-async": "^1.2.1", - "url-loader": "^0.5.7", - "webpack": "^1.13.1", - "whatwg-fetch": "^1.0.0", - "yamljs": "^0.2.8" + "prismjs": "^1.14.0", + "react-helmet": "^5.2.0", + "react-markdown": "^3.3.2", + "react-sidecar": "^0.1.1", + "smooth-scroll": "^14.2.0" }, "devDependencies": {} } diff --git a/website/site/config.yaml b/website/site/config.yaml deleted file mode 100755 index a62238bf..00000000 --- a/website/site/config.yaml +++ /dev/null @@ -1,22 +0,0 @@ -baseurl: "https://www.netlifycms.org/" -languageCode: "en-us" -title: "Netlify CMS | Open-Source Content Management System" -disable404: true -pluralizeListTitles: false -metaDataFormat: "yaml" -permalinks: - blog: /blog/:year/:month/:title/ -menu: - docs: - - name: start - title: Quick Start - weight: 100 - - name: guides - title: Guides - weight: 200 - - name: reference - title: Reference - weight: 300 - - name: contributing - title: Contributing - weight: 400 \ No newline at end of file diff --git a/website/site/data/notifications.yml b/website/site/data/notifications.yml deleted file mode 100644 index f8f4e362..00000000 --- a/website/site/data/notifications.yml +++ /dev/null @@ -1,22 +0,0 @@ -notifications: - - loud: true - message: >- - Register to join us online for our next community dev meeting, every other - Wednesday at 9am-10am PT! - published: false - title: Netlify CMS Development Planning Sessions Promo - url: >- - https://www.eventbrite.com/e/netlify-cms-planning-session-bi-weekly-tickets-35794058994 - - loud: true - message: >- - We have a community on Gitter - join now to ask questions and discuss the - project with other devs! - published: false - title: Gitter shoutout - url: 'https://gitter.im/netlify/netlifycms' - - loud: true - message: >- - Netlify CMS now supports GitLab! - published: true - title: GitLab announcement - url: '/blog/2018/06/netlify-cms-now-supports-gitlab-as-a-backend/' diff --git a/website/site/layouts/_default/single.html b/website/site/layouts/_default/single.html deleted file mode 100644 index b774c783..00000000 --- a/website/site/layouts/_default/single.html +++ /dev/null @@ -1,46 +0,0 @@ -{{ partial "header" . }} -{{ $activePage := .Params.position }} - -
-
- -
- {{ partial "edit-link" . }} - {{ .Content }} - {{- if eq .Title "Widgets" -}} - {{- partial "widgets" . -}} - {{- end -}} -
-
-
- -{{ partial "footer" . }} diff --git a/website/site/layouts/blog/single.html b/website/site/layouts/blog/single.html deleted file mode 100644 index e4aa4185..00000000 --- a/website/site/layouts/blog/single.html +++ /dev/null @@ -1,16 +0,0 @@ -{{ partial "header" . }} - -
-
-
-
-

{{ .Title }}

-

by {{ .Params.author }} on {{ .Date.Format "January 2, 2006" }}

-
- {{ .Content }} -
-
-
- -{{ partial "footer" . }} - diff --git a/website/site/layouts/index.html b/website/site/layouts/index.html deleted file mode 100755 index 4a7f63eb..00000000 --- a/website/site/layouts/index.html +++ /dev/null @@ -1,88 +0,0 @@ -{{ partial "header" . }} - -
-
-
- -
-

{{ .Site.Data.landing.hero.headline | markdownify }}

- {{ .Site.Data.landing.hero.subhead | markdownify }} - {{ .Site.Data.landing.cta.button | markdownify }} -
-
- {{ range $index, $id := .Site.Data.landing.hero.devfeatures }} -
-

{{ .feature | markdownify }}

-

{{ .description | markdownify }}

-
- {{ end }} -
- - - - - -
-
- -
-
-

{{ .Site.Data.landing.cta.primaryhook | markdownify }} {{ .Site.Data.landing.cta.primary | markdownify }}

{{ .Site.Data.landing.cta.button | markdownify }} -
-
- -
-
-
    - {{ range .Site.Data.updates }} - {{ range first 3 . }} -
  1. {{ .description | markdownify }}
  2. - {{ end }} - {{ end }} -
-
-
- -
-
-

{{ .Site.Data.landing.editors.hook | markdownify }}

-

{{ .Site.Data.landing.editors.intro | markdownify }}

-
- {{ range $index, $id := .Site.Data.landing.editors.features }} -
- -

{{ .feature | markdownify }}

-

{{ .description | markdownify }}

-
- {{ end }} -
-
-
- -
-
-

{{ .Site.Data.landing.community.hook | markdownify }}

-
-
- {{ range $index, $id := .Site.Data.landing.community.features }} -
-

{{ .feature | markdownify }}

-

{{ .description | markdownify }}

-
- {{ end }} -
-
-
-

{{ .Site.Data.landing.community.contributors | markdownify }}

- {{ range .Site.Data.contributors }} -
- {{ range . }} - {{.login}} - {{ end }} -
- {{ end }} -
-
-
- -{{ partial "footer" . }} diff --git a/website/site/layouts/pages/community.html b/website/site/layouts/pages/community.html deleted file mode 100644 index 8908ca73..00000000 --- a/website/site/layouts/pages/community.html +++ /dev/null @@ -1,38 +0,0 @@ -{{ partial "header" . }} - -
-
-
- -
-

{{ .Params.headline | markdownify }}

-

{{ .Params.subhead | markdownify }}

-

  • {{ .Params.primarycta | markdownify }}

-
- -
-

{{ .Params.upcomingevent.hook }}

-
-
-
-
-

at

-
{{ .Params.primarycta | markdownify }}
-
- -
-
- -
-
-
- -

{{ .Params.howitworks | markdownify }}

- -

{{ .Params.howtojoin | markdownify }}

-
-
-
-
- -{{ partial "footer" . }} diff --git a/website/site/layouts/partials/edit-link.html b/website/site/layouts/partials/edit-link.html deleted file mode 100644 index d50e1e42..00000000 --- a/website/site/layouts/partials/edit-link.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Edit this page - \ No newline at end of file diff --git a/website/site/layouts/partials/footer.html b/website/site/layouts/partials/footer.html deleted file mode 100755 index 8a13e0f5..00000000 --- a/website/site/layouts/partials/footer.html +++ /dev/null @@ -1,46 +0,0 @@ - - - -{{ if or (eq .Section "docs") (eq .Title "Docs") }} - - - -{{ end }} -{{ if eq .Title "Community" }} - -{{ end }} - - - -{{- if eq .Title "Widgets" -}} - -{{- end -}} - -{{ if or (eq .Section "docs") (eq .Title "Docs") (eq .Title "Community") }} - - -{{ end }} - - diff --git a/website/site/layouts/partials/header.html b/website/site/layouts/partials/header.html deleted file mode 100755 index b56f4505..00000000 --- a/website/site/layouts/partials/header.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - {{ .Site.Title }} - - - - - - - - - - - - - - {{ if or (eq .Section "docs") (eq .Title "Docs") }} - - {{ end }} - - {{ range .AlternativeOutputFormats -}} - {{ printf `` .Rel .MediaType.Type .MediaType.Suffix .Permalink $.Site.Title | safeHTML }} - {{ end -}} - - - {{ range .Site.Data.notifications }} - {{ range . }} - {{ if .published }} - {{ .message }} - {{ end }} - {{ end }} - {{ end }} - diff --git a/website/site/layouts/partials/widgets.html b/website/site/layouts/partials/widgets.html deleted file mode 100644 index dfa2ea95..00000000 --- a/website/site/layouts/partials/widgets.html +++ /dev/null @@ -1,14 +0,0 @@ -
-
- {{- range $index, $widget := .Resources -}} - {{.Params.label}} - {{- end -}} -
-
- {{- range $index, $widget := .Resources -}} -
- {{.Content}} -
- {{- end -}} -
-
\ No newline at end of file diff --git a/website/site/layouts/section/blog.html b/website/site/layouts/section/blog.html deleted file mode 100644 index 77e89617..00000000 --- a/website/site/layouts/section/blog.html +++ /dev/null @@ -1,17 +0,0 @@ -{{ partial "header" . }} - -
-
-

Netlify CMS Blog

- {{ range (.Paginate .Data.Pages.ByDate.Reverse ).Pages }} -
-

{{ .Title }}

-

by {{ .Params.author }} on {{ .Date.Format "January 2, 2006" }}

-

{{ .Description }}

-
- {{ end }} - {{ template "_internal/pagination.html" . }} -
-
- -{{ partial "footer" . }} \ No newline at end of file diff --git a/website/site/static/jquery.localScroll.min.js b/website/site/static/jquery.localScroll.min.js deleted file mode 100644 index 89f6d47f..00000000 --- a/website/site/static/jquery.localScroll.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Copyright (c) 2007-2016 Ariel Flesler - afleslergmailcom | http://flesler.blogspot.com - * Licensed under MIT - * @author Ariel Flesler - * @version 1.4.0 - */ -;(function(a){if(typeof define==='function'&&define.amd){define(['jquery'],a)}else{a(jQuery)}}(function($){var g=location.href.replace(/#.*/,'');var h=$.localScroll=function(a){$('body').localScroll(a)};h.defaults={duration:1000,axis:'y',event:'click',stop:true,target:window};$.fn.localScroll=function(a){a=$.extend({},h.defaults,a);if(a.hash&&location.hash){if(a.target)window.scrollTo(0,0);scroll(0,location,a)}return a.lazy?this.on(a.event,'a,area',function(e){if(filter.call(this)){scroll(e,this,a)}}):this.find('a,area').filter(filter).bind(a.event,function(e){scroll(e,this,a)}).end().end();function filter(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')===g&&(!a.filter||$(this).is(a.filter))}};h.hash=function(){};function scroll(e,a,b){var c=a.hash.slice(1),elem=document.getElementById(c)||document.getElementsByName(c)[0];if(!elem)return;if(e)e.preventDefault();var d=$(b.target);if(b.lock&&d.is(':animated')||b.onBefore&&b.onBefore(e,elem,d)===false)return;if(b.stop){d.stop(true)}if(b.hash){var f=elem.id===c?'id':'name',$a=$(' ').attr(f,c).css({position:'absolute',top:$(window).scrollTop(),left:$(window).scrollLeft()});elem[f]='';$('body').prepend($a);location.hash=a.hash;$a.remove();elem[f]=c}d.scrollTo(elem,b).trigger('notify.serialScroll',[elem])}return h})); \ No newline at end of file diff --git a/website/site/static/jquery.scrollTo.min.js b/website/site/static/jquery.scrollTo.min.js deleted file mode 100644 index 0be11d92..00000000 --- a/website/site/static/jquery.scrollTo.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Copyright (c) 2007-2015 Ariel Flesler - afleslergmailcom | http://flesler.blogspot.com - * Licensed under MIT - * @author Ariel Flesler - * @version 2.1.0 - */ -;(function(l){'use strict';l(['jquery'],function($){var k=$.scrollTo=function(a,b,c){return $(window).scrollTo(a,b,c)};k.defaults={axis:'xy',duration:0,limit:true};function isWin(a){return!a.nodeName||$.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!==-1}$.fn.scrollTo=function(f,g,h){if(typeof g==='object'){h=g;g=0}if(typeof h==='function'){h={onAfter:h}}if(f==='max'){f=9e9}h=$.extend({},k.defaults,h);g=g||h.duration;var j=h.queue&&h.axis.length>1;if(j){g/=2}h.offset=both(h.offset);h.over=both(h.over);return this.each(function(){if(f===null)return;var d=isWin(this),elem=d?this.contentWindow||window:this,$elem=$(elem),targ=f,attr={},toff;switch(typeof targ){case'number':case'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=d?$(targ):$(targ,elem);if(!targ.length)return;case'object':if(targ.is||targ.style){toff=(targ=$(targ)).offset()}}var e=$.isFunction(h.offset)&&h.offset(elem,targ)||h.offset;$.each(h.axis.split(''),function(i,a){var b=a==='x'?'Left':'Top',pos=b.toLowerCase(),key='scroll'+b,prev=$elem[key](),max=k.max(elem,a);if(toff){attr[key]=toff[pos]+(d?0:prev-$elem.offset()[pos]);if(h.margin){attr[key]-=parseInt(targ.css('margin'+b),10)||0;attr[key]-=parseInt(targ.css('border'+b+'Width'),10)||0}attr[key]+=e[pos]||0;if(h.over[pos]){attr[key]+=targ[a==='x'?'width':'height']()*h.over[pos]}}else{var c=targ[pos];attr[key]=c.slice&&c.slice(-1)==='%'?parseFloat(c)/100*max:c}if(h.limit&&/^\d+$/.test(attr[key])){attr[key]=attr[key]<=0?0:Math.min(attr[key],max)}if(!i&&h.axis.length>1){if(prev===attr[key]){attr={}}else if(j){animate(h.onAfterFirst);attr={}}}});animate(h.onAfter);function animate(a){var b=$.extend({},h,{queue:true,duration:g,complete:a&&function(){a.call(elem,targ,h)}});$elem.animate(attr,b)}})};k.max=function(a,b){var c=b==='x'?'Width':'Height',scroll='scroll'+c;if(!isWin(a))return a[scroll]-$(a)[c.toLowerCase()]();var d='client'+c,doc=a.ownerDocument||a.document,html=doc.documentElement,body=doc.body;return Math.max(html[scroll],body[scroll])-Math.min(html[d],body[d])};function both(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}$.Tween.propHooks.scrollLeft=$.Tween.propHooks.scrollTop={get:function(t){return $(t.elem)[t.prop]()},set:function(t){var a=this.get(t);if(t.options.interrupt&&t._last&&t._last!==a){return $(t.elem).stop()}var b=Math.round(t.now);if(a!==b){$(t.elem)[t.prop](b);t._last=this.get(t)}}};return k})}(typeof define==='function'&&define.amd?define:function(a,b){'use strict';if(typeof module!=='undefined'&&module.exports){module.exports=b(require('jquery'))}else{b(jQuery)}})); \ No newline at end of file diff --git a/website/site/static/moment.min.js b/website/site/static/moment.min.js deleted file mode 100644 index 770f8bc5..00000000 --- a/website/site/static/moment.min.js +++ /dev/null @@ -1,7 +0,0 @@ -//! moment.js -//! version : 2.18.1 -//! authors : Tim Wood, Iskren Chernev, Moment.js contributors -//! license : MIT -//! momentjs.com -!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return sd.apply(null,arguments)}function b(a){sd=a}function c(a){return a instanceof Array||"[object Array]"===Object.prototype.toString.call(a)}function d(a){return null!=a&&"[object Object]"===Object.prototype.toString.call(a)}function e(a){var b;for(b in a)return!1;return!0}function f(a){return void 0===a}function g(a){return"number"==typeof a||"[object Number]"===Object.prototype.toString.call(a)}function h(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function i(a,b){var c,d=[];for(c=0;c0)for(c=0;c0?"future":"past"];return z(c)?c(b):c.replace(/%s/i,b)}function J(a,b){var c=a.toLowerCase();Hd[c]=Hd[c+"s"]=Hd[b]=a}function K(a){return"string"==typeof a?Hd[a]||Hd[a.toLowerCase()]:void 0}function L(a){var b,c,d={};for(c in a)j(a,c)&&(b=K(c),b&&(d[b]=a[c]));return d}function M(a,b){Id[a]=b}function N(a){var b=[];for(var c in a)b.push({unit:c,priority:Id[c]});return b.sort(function(a,b){return a.priority-b.priority}),b}function O(b,c){return function(d){return null!=d?(Q(this,b,d),a.updateOffset(this,c),this):P(this,b)}}function P(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function Q(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}function R(a){return a=K(a),z(this[a])?this[a]():this}function S(a,b){if("object"==typeof a){a=L(a);for(var c=N(a),d=0;d=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function U(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(Md[a]=e),b&&(Md[b[0]]=function(){return T(e.apply(this,arguments),b[1],b[2])}),c&&(Md[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function V(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function W(a){var b,c,d=a.match(Jd);for(b=0,c=d.length;b=0&&Kd.test(a);)a=a.replace(Kd,c),Kd.lastIndex=0,d-=1;return a}function Z(a,b,c){ce[a]=z(b)?b:function(a,d){return a&&c?c:b}}function $(a,b){return j(ce,a)?ce[a](b._strict,b._locale):new RegExp(_(a))}function _(a){return aa(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function aa(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ba(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),g(b)&&(d=function(a,c){c[b]=u(a)}),c=0;c=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function ta(a){var b=new Date(Date.UTC.apply(null,arguments));return a<100&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}function ua(a,b,c){var d=7+b-c,e=(7+ta(a,0,d).getUTCDay()-b)%7;return-e+d-1}function va(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=ua(a,d,e),j=1+7*(b-1)+h+i;return j<=0?(f=a-1,g=pa(f)+j):j>pa(a)?(f=a+1,g=j-pa(a)):(f=a,g=j),{year:f,dayOfYear:g}}function wa(a,b,c){var d,e,f=ua(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return g<1?(e=a.year()-1,d=g+xa(e,b,c)):g>xa(a.year(),b,c)?(d=g-xa(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function xa(a,b,c){var d=ua(a,b,c),e=ua(a+1,b,c);return(pa(a)-d+e)/7}function ya(a){return wa(a,this._week.dow,this._week.doy).week}function za(){return this._week.dow}function Aa(){return this._week.doy}function Ba(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function Ca(a){var b=wa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function Da(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function Ea(a,b){return"string"==typeof a?b.weekdaysParse(a)%7||7:isNaN(a)?null:a}function Fa(a,b){return a?c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]:c(this._weekdays)?this._weekdays:this._weekdays.standalone}function Ga(a){return a?this._weekdaysShort[a.day()]:this._weekdaysShort}function Ha(a){return a?this._weekdaysMin[a.day()]:this._weekdaysMin}function Ia(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;d<7;++d)f=l([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(f,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(f,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(f,"").toLocaleLowerCase();return c?"dddd"===b?(e=ne.call(this._weekdaysParse,g),e!==-1?e:null):"ddd"===b?(e=ne.call(this._shortWeekdaysParse,g),e!==-1?e:null):(e=ne.call(this._minWeekdaysParse,g),e!==-1?e:null):"dddd"===b?(e=ne.call(this._weekdaysParse,g),e!==-1?e:(e=ne.call(this._shortWeekdaysParse,g),e!==-1?e:(e=ne.call(this._minWeekdaysParse,g),e!==-1?e:null))):"ddd"===b?(e=ne.call(this._shortWeekdaysParse,g),e!==-1?e:(e=ne.call(this._weekdaysParse,g),e!==-1?e:(e=ne.call(this._minWeekdaysParse,g),e!==-1?e:null))):(e=ne.call(this._minWeekdaysParse,g),e!==-1?e:(e=ne.call(this._weekdaysParse,g),e!==-1?e:(e=ne.call(this._shortWeekdaysParse,g),e!==-1?e:null)))}function Ja(a,b,c){var d,e,f;if(this._weekdaysParseExact)return Ia.call(this,a,b,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;d<7;d++){if(e=l([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}function Ka(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Da(a,this.localeData()),this.add(a-b,"d")):b}function La(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function Ma(a){if(!this.isValid())return null!=a?this:NaN;if(null!=a){var b=Ea(a,this.localeData());return this.day(this.day()%7?b:b-7)}return this.day()||7}function Na(a){return this._weekdaysParseExact?(j(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysStrictRegex:this._weekdaysRegex):(j(this,"_weekdaysRegex")||(this._weekdaysRegex=ye),this._weekdaysStrictRegex&&a?this._weekdaysStrictRegex:this._weekdaysRegex)}function Oa(a){return this._weekdaysParseExact?(j(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(j(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ze),this._weekdaysShortStrictRegex&&a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Pa(a){return this._weekdaysParseExact?(j(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(j(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ae),this._weekdaysMinStrictRegex&&a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Qa(){function a(a,b){return b.length-a.length}var b,c,d,e,f,g=[],h=[],i=[],j=[];for(b=0;b<7;b++)c=l([2e3,1]).day(b),d=this.weekdaysMin(c,""),e=this.weekdaysShort(c,""),f=this.weekdays(c,""),g.push(d),h.push(e),i.push(f),j.push(d),j.push(e),j.push(f);for(g.sort(a),h.sort(a),i.sort(a),j.sort(a),b=0;b<7;b++)h[b]=aa(h[b]),i[b]=aa(i[b]),j[b]=aa(j[b]);this._weekdaysRegex=new RegExp("^("+j.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+g.join("|")+")","i")}function Ra(){return this.hours()%12||12}function Sa(){return this.hours()||24}function Ta(a,b){U(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function Ua(a,b){return b._meridiemParse}function Va(a){return"p"===(a+"").toLowerCase().charAt(0)}function Wa(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function Xa(a){return a?a.toLowerCase().replace("_","-"):a}function Ya(a){for(var b,c,d,e,f=0;f0;){if(d=Za(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)break;b--}f++}return null}function Za(a){var b=null;if(!Fe[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Be._abbr,require("./locale/"+a),$a(b)}catch(a){}return Fe[a]}function $a(a,b){var c;return a&&(c=f(b)?bb(a):_a(a,b),c&&(Be=c)),Be._abbr}function _a(a,b){if(null!==b){var c=Ee;if(b.abbr=a,null!=Fe[a])y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),c=Fe[a]._config;else if(null!=b.parentLocale){if(null==Fe[b.parentLocale])return Ge[b.parentLocale]||(Ge[b.parentLocale]=[]),Ge[b.parentLocale].push({name:a,config:b}),null;c=Fe[b.parentLocale]._config}return Fe[a]=new C(B(c,b)),Ge[a]&&Ge[a].forEach(function(a){_a(a.name,a.config)}),$a(a),Fe[a]}return delete Fe[a],null}function ab(a,b){if(null!=b){var c,d=Ee;null!=Fe[a]&&(d=Fe[a]._config),b=B(d,b),c=new C(b),c.parentLocale=Fe[a],Fe[a]=c,$a(a)}else null!=Fe[a]&&(null!=Fe[a].parentLocale?Fe[a]=Fe[a].parentLocale:null!=Fe[a]&&delete Fe[a]);return Fe[a]}function bb(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Be;if(!c(a)){if(b=Za(a))return b;a=[a]}return Ya(a)}function cb(){return Ad(Fe)}function db(a){var b,c=a._a;return c&&n(a).overflow===-2&&(b=c[fe]<0||c[fe]>11?fe:c[ge]<1||c[ge]>ea(c[ee],c[fe])?ge:c[he]<0||c[he]>24||24===c[he]&&(0!==c[ie]||0!==c[je]||0!==c[ke])?he:c[ie]<0||c[ie]>59?ie:c[je]<0||c[je]>59?je:c[ke]<0||c[ke]>999?ke:-1,n(a)._overflowDayOfYear&&(bge)&&(b=ge),n(a)._overflowWeeks&&b===-1&&(b=le),n(a)._overflowWeekday&&b===-1&&(b=me),n(a).overflow=b),a}function eb(a){var b,c,d,e,f,g,h=a._i,i=He.exec(h)||Ie.exec(h);if(i){for(n(a).iso=!0,b=0,c=Ke.length;b10?"YYYY ":"YY "),f="HH:mm"+(c[4]?":ss":""),c[1]){var l=new Date(c[2]),m=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][l.getDay()];if(c[1].substr(0,3)!==m)return n(a).weekdayMismatch=!0,void(a._isValid=!1)}switch(c[5].length){case 2:0===i?h=" +0000":(i=k.indexOf(c[5][1].toUpperCase())-12,h=(i<0?" -":" +")+(""+i).replace(/^-?/,"0").match(/..$/)[0]+"00");break;case 4:h=j[c[5]];break;default:h=j[" GMT"]}c[5]=h,a._i=c.splice(1).join(""),g=" ZZ",a._f=d+e+f+g,lb(a),n(a).rfc2822=!0}else a._isValid=!1}function gb(b){var c=Me.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,fb(b),b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b)))))}function hb(a,b,c){return null!=a?a:null!=b?b:c}function ib(b){var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function jb(a){var b,c,d,e,f=[];if(!a._d){for(d=ib(a),a._w&&null==a._a[ge]&&null==a._a[fe]&&kb(a),null!=a._dayOfYear&&(e=hb(a._a[ee],d[ee]),(a._dayOfYear>pa(e)||0===a._dayOfYear)&&(n(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[fe]=c.getUTCMonth(),a._a[ge]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[he]&&0===a._a[ie]&&0===a._a[je]&&0===a._a[ke]&&(a._nextDay=!0,a._a[he]=0),a._d=(a._useUTC?ta:sa).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[he]=24)}}function kb(a){var b,c,d,e,f,g,h,i;if(b=a._w,null!=b.GG||null!=b.W||null!=b.E)f=1,g=4,c=hb(b.GG,a._a[ee],wa(tb(),1,4).year),d=hb(b.W,1),e=hb(b.E,1),(e<1||e>7)&&(i=!0);else{f=a._locale._week.dow,g=a._locale._week.doy;var j=wa(tb(),f,g);c=hb(b.gg,a._a[ee],j.year),d=hb(b.w,j.week),null!=b.d?(e=b.d,(e<0||e>6)&&(i=!0)):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f}d<1||d>xa(c,f,g)?n(a)._overflowWeeks=!0:null!=i?n(a)._overflowWeekday=!0:(h=va(c,d,e,f,g),a._a[ee]=h.year,a._dayOfYear=h.dayOfYear)}function lb(b){if(b._f===a.ISO_8601)return void eb(b);if(b._f===a.RFC_2822)return void fb(b);b._a=[],n(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,j=0;for(e=Y(b._f,b._locale).match(Jd)||[],c=0;c0&&n(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),j+=d.length),Md[f]?(d?n(b).empty=!1:n(b).unusedTokens.push(f),da(f,d,b)):b._strict&&!d&&n(b).unusedTokens.push(f);n(b).charsLeftOver=i-j,h.length>0&&n(b).unusedInput.push(h),b._a[he]<=12&&n(b).bigHour===!0&&b._a[he]>0&&(n(b).bigHour=void 0),n(b).parsedDateParts=b._a.slice(0),n(b).meridiem=b._meridiem,b._a[he]=mb(b._locale,b._a[he],b._meridiem),jb(b),db(b)}function mb(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&b<12&&(b+=12),d||12!==b||(b=0),b):b}function nb(a){var b,c,d,e,f;if(0===a._f.length)return n(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;ethis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ob(){if(!f(this._isDSTShifted))return this._isDSTShifted;var a={};if(q(a,this),a=qb(a),a._a){var b=a._isUTC?l(a._a):tb(a._a);this._isDSTShifted=this.isValid()&&v(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Pb(){return!!this.isValid()&&!this._isUTC}function Qb(){return!!this.isValid()&&this._isUTC}function Rb(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Sb(a,b){var c,d,e,f=a,h=null;return Bb(a)?f={ms:a._milliseconds,d:a._days,M:a._months}:g(a)?(f={},b?f[b]=a:f.milliseconds=a):(h=Te.exec(a))?(c="-"===h[1]?-1:1,f={y:0,d:u(h[ge])*c,h:u(h[he])*c,m:u(h[ie])*c,s:u(h[je])*c,ms:u(Cb(1e3*h[ke]))*c}):(h=Ue.exec(a))?(c="-"===h[1]?-1:1,f={y:Tb(h[2],c),M:Tb(h[3],c),w:Tb(h[4],c),d:Tb(h[5],c),h:Tb(h[6],c),m:Tb(h[7],c),s:Tb(h[8],c)}):null==f?f={}:"object"==typeof f&&("from"in f||"to"in f)&&(e=Vb(tb(f.from),tb(f.to)),f={},f.ms=e.milliseconds,f.M=e.months),d=new Ab(f),Bb(a)&&j(a,"_locale")&&(d._locale=a._locale),d}function Tb(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function Ub(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function Vb(a,b){var c;return a.isValid()&&b.isValid()?(b=Fb(b,a),a.isBefore(b)?c=Ub(a,b):(c=Ub(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function Wb(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(y(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Sb(c,d),Xb(this,e,a),this}}function Xb(b,c,d,e){var f=c._milliseconds,g=Cb(c._days),h=Cb(c._months);b.isValid()&&(e=null==e||e,f&&b._d.setTime(b._d.valueOf()+f*d),g&&Q(b,"Date",P(b,"Date")+g*d),h&&ja(b,P(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function Yb(a,b){var c=a.diff(b,"days",!0);return c<-6?"sameElse":c<-1?"lastWeek":c<0?"lastDay":c<1?"sameDay":c<2?"nextDay":c<7?"nextWeek":"sameElse"}function Zb(b,c){var d=b||tb(),e=Fb(d,this).startOf("day"),f=a.calendarFormat(this,e)||"sameElse",g=c&&(z(c[f])?c[f].call(this,d):c[f]);return this.format(g||this.localeData().calendar(f,this,tb(d)))}function $b(){return new r(this)}function _b(a,b){var c=s(a)?a:tb(a);return!(!this.isValid()||!c.isValid())&&(b=K(f(b)?"millisecond":b),"millisecond"===b?this.valueOf()>c.valueOf():c.valueOf()9999?X(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):z(Date.prototype.toISOString)?this.toDate().toISOString():X(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function jc(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var a="moment",b="";this.isLocal()||(a=0===this.utcOffset()?"moment.utc":"moment.parseZone",b="Z");var c="["+a+'("]',d=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",e="-MM-DD[T]HH:mm:ss.SSS",f=b+'[")]';return this.format(c+d+e+f)}function kc(b){b||(b=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var c=X(this,b);return this.localeData().postformat(c)}function lc(a,b){return this.isValid()&&(s(a)&&a.isValid()||tb(a).isValid())?Sb({to:this,from:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function mc(a){return this.from(tb(),a)}function nc(a,b){return this.isValid()&&(s(a)&&a.isValid()||tb(a).isValid())?Sb({from:this,to:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function oc(a){return this.to(tb(),a)}function pc(a){var b;return void 0===a?this._locale._abbr:(b=bb(a),null!=b&&(this._locale=b),this)}function qc(){return this._locale}function rc(a){switch(a=K(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a&&this.weekday(0),"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this}function sc(a){return a=K(a),void 0===a||"millisecond"===a?this:("date"===a&&(a="day"),this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms"))}function tc(){return this._d.valueOf()-6e4*(this._offset||0)}function uc(){return Math.floor(this.valueOf()/1e3)}function vc(){return new Date(this.valueOf())}function wc(){var a=this;return[a.year(),a.month(),a.date(),a.hour(),a.minute(),a.second(),a.millisecond()]}function xc(){var a=this;return{years:a.year(),months:a.month(),date:a.date(),hours:a.hours(),minutes:a.minutes(),seconds:a.seconds(),milliseconds:a.milliseconds()}}function yc(){return this.isValid()?this.toISOString():null}function zc(){return o(this)}function Ac(){ -return k({},n(this))}function Bc(){return n(this).overflow}function Cc(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Dc(a,b){U(0,[a,a.length],0,b)}function Ec(a){return Ic.call(this,a,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Fc(a){return Ic.call(this,a,this.isoWeek(),this.isoWeekday(),1,4)}function Gc(){return xa(this.year(),1,4)}function Hc(){var a=this.localeData()._week;return xa(this.year(),a.dow,a.doy)}function Ic(a,b,c,d,e){var f;return null==a?wa(this,d,e).year:(f=xa(a,d,e),b>f&&(b=f),Jc.call(this,a,b,c,d,e))}function Jc(a,b,c,d,e){var f=va(a,b,c,d,e),g=ta(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}function Kc(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Lc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function Mc(a,b){b[ke]=u(1e3*("0."+a))}function Nc(){return this._isUTC?"UTC":""}function Oc(){return this._isUTC?"Coordinated Universal Time":""}function Pc(a){return tb(1e3*a)}function Qc(){return tb.apply(null,arguments).parseZone()}function Rc(a){return a}function Sc(a,b,c,d){var e=bb(),f=l().set(d,b);return e[c](f,a)}function Tc(a,b,c){if(g(a)&&(b=a,a=void 0),a=a||"",null!=b)return Sc(a,b,c,"month");var d,e=[];for(d=0;d<12;d++)e[d]=Sc(a,d,c,"month");return e}function Uc(a,b,c,d){"boolean"==typeof a?(g(b)&&(c=b,b=void 0),b=b||""):(b=a,c=b,a=!1,g(b)&&(c=b,b=void 0),b=b||"");var e=bb(),f=a?e._week.dow:0;if(null!=c)return Sc(b,(c+f)%7,d,"day");var h,i=[];for(h=0;h<7;h++)i[h]=Sc(b,(h+f)%7,d,"day");return i}function Vc(a,b){return Tc(a,b,"months")}function Wc(a,b){return Tc(a,b,"monthsShort")}function Xc(a,b,c){return Uc(a,b,c,"weekdays")}function Yc(a,b,c){return Uc(a,b,c,"weekdaysShort")}function Zc(a,b,c){return Uc(a,b,c,"weekdaysMin")}function $c(){var a=this._data;return this._milliseconds=df(this._milliseconds),this._days=df(this._days),this._months=df(this._months),a.milliseconds=df(a.milliseconds),a.seconds=df(a.seconds),a.minutes=df(a.minutes),a.hours=df(a.hours),a.months=df(a.months),a.years=df(a.years),this}function _c(a,b,c,d){var e=Sb(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function ad(a,b){return _c(this,a,b,1)}function bd(a,b){return _c(this,a,b,-1)}function cd(a){return a<0?Math.floor(a):Math.ceil(a)}function dd(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||f<=0&&g<=0&&h<=0||(f+=864e5*cd(fd(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=t(f/1e3),i.seconds=a%60,b=t(a/60),i.minutes=b%60,c=t(b/60),i.hours=c%24,g+=t(c/24),e=t(ed(g)),h+=e,g-=cd(fd(e)),d=t(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function ed(a){return 4800*a/146097}function fd(a){return 146097*a/4800}function gd(a){if(!this.isValid())return NaN;var b,c,d=this._milliseconds;if(a=K(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+ed(b),"month"===a?c:c/12;switch(b=this._days+Math.round(fd(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function hd(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*u(this._months/12):NaN}function id(a){return function(){return this.as(a)}}function jd(a){return a=K(a),this.isValid()?this[a+"s"]():NaN}function kd(a){return function(){return this.isValid()?this._data[a]:NaN}}function ld(){return t(this.days()/7)}function md(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function nd(a,b,c){var d=Sb(a).abs(),e=uf(d.as("s")),f=uf(d.as("m")),g=uf(d.as("h")),h=uf(d.as("d")),i=uf(d.as("M")),j=uf(d.as("y")),k=e<=vf.ss&&["s",e]||e0,k[4]=c,md.apply(null,k)}function od(a){return void 0===a?uf:"function"==typeof a&&(uf=a,!0)}function pd(a,b){return void 0!==vf[a]&&(void 0===b?vf[a]:(vf[a]=b,"s"===a&&(vf.ss=b-1),!0))}function qd(a){if(!this.isValid())return this.localeData().invalidDate();var b=this.localeData(),c=nd(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function rd(){if(!this.isValid())return this.localeData().invalidDate();var a,b,c,d=wf(this._milliseconds)/1e3,e=wf(this._days),f=wf(this._months);a=t(d/60),b=t(a/60),d%=60,a%=60,c=t(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(m<0?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var sd,td;td=Array.prototype.some?Array.prototype.some:function(a){for(var b=Object(this),c=b.length>>>0,d=0;d68?1900:2e3)};var te=O("FullYear",!0);U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"),J("week","w"),J("isoWeek","W"),M("week",5),M("isoWeek",5),Z("w",Sd),Z("ww",Sd,Od),Z("W",Sd),Z("WW",Sd,Od),ca(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=u(a)});var ue={dow:0,doy:6};U("d",0,"do","day"),U("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),U("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),U("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"),J("day","d"),J("weekday","e"),J("isoWeekday","E"),M("day",11),M("weekday",11),M("isoWeekday",11),Z("d",Sd),Z("e",Sd),Z("E",Sd),Z("dd",function(a,b){return b.weekdaysMinRegex(a)}),Z("ddd",function(a,b){return b.weekdaysShortRegex(a)}),Z("dddd",function(a,b){return b.weekdaysRegex(a)}),ca(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:n(c).invalidWeekday=a}),ca(["d","e","E"],function(a,b,c,d){b[d]=u(a)});var ve="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),we="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),xe="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ye=be,ze=be,Ae=be;U("H",["HH",2],0,"hour"),U("h",["hh",2],0,Ra),U("k",["kk",2],0,Sa),U("hmm",0,0,function(){return""+Ra.apply(this)+T(this.minutes(),2)}),U("hmmss",0,0,function(){return""+Ra.apply(this)+T(this.minutes(),2)+T(this.seconds(),2)}),U("Hmm",0,0,function(){return""+this.hours()+T(this.minutes(),2)}),U("Hmmss",0,0,function(){return""+this.hours()+T(this.minutes(),2)+T(this.seconds(),2)}),Ta("a",!0),Ta("A",!1),J("hour","h"),M("hour",13),Z("a",Ua),Z("A",Ua),Z("H",Sd),Z("h",Sd),Z("k",Sd),Z("HH",Sd,Od),Z("hh",Sd,Od),Z("kk",Sd,Od),Z("hmm",Td),Z("hmmss",Ud),Z("Hmm",Td),Z("Hmmss",Ud),ba(["H","HH"],he),ba(["k","kk"],function(a,b,c){var d=u(a);b[he]=24===d?0:d}),ba(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),ba(["h","hh"],function(a,b,c){b[he]=u(a),n(c).bigHour=!0}),ba("hmm",function(a,b,c){var d=a.length-2;b[he]=u(a.substr(0,d)),b[ie]=u(a.substr(d)),n(c).bigHour=!0}),ba("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[he]=u(a.substr(0,d)),b[ie]=u(a.substr(d,2)),b[je]=u(a.substr(e)),n(c).bigHour=!0}),ba("Hmm",function(a,b,c){var d=a.length-2;b[he]=u(a.substr(0,d)),b[ie]=u(a.substr(d))}),ba("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[he]=u(a.substr(0,d)),b[ie]=u(a.substr(d,2)),b[je]=u(a.substr(e))});var Be,Ce=/[ap]\.?m?\.?/i,De=O("Hours",!0),Ee={calendar:Bd,longDateFormat:Cd,invalidDate:Dd,ordinal:Ed,dayOfMonthOrdinalParse:Fd,relativeTime:Gd,months:pe,monthsShort:qe,week:ue,weekdays:ve,weekdaysMin:xe,weekdaysShort:we,meridiemParse:Ce},Fe={},Ge={},He=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ie=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Je=/Z|[+-]\d\d(?::?\d\d)?/,Ke=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Le=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Me=/^\/?Date\((\-?\d+)/i,Ne=/^((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d?\d\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(?:\d\d)?\d\d\s)(\d\d:\d\d)(\:\d\d)?(\s(?:UT|GMT|[ECMP][SD]T|[A-IK-Za-ik-z]|[+-]\d{4}))$/;a.createFromInputFallback=x("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),a.ISO_8601=function(){},a.RFC_2822=function(){};var Oe=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var a=tb.apply(null,arguments);return this.isValid()&&a.isValid()?athis?this:a:p()}),Qe=function(){return Date.now?Date.now():+new Date},Re=["year","quarter","month","week","day","hour","minute","second","millisecond"];Db("Z",":"),Db("ZZ",""),Z("Z",_d),Z("ZZ",_d),ba(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Eb(_d,a)});var Se=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var Te=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Ue=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Sb.fn=Ab.prototype,Sb.invalid=zb;var Ve=Wb(1,"add"),We=Wb(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Xe=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});U(0,["gg",2],0,function(){return this.weekYear()%100}),U(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Dc("gggg","weekYear"),Dc("ggggg","weekYear"),Dc("GGGG","isoWeekYear"),Dc("GGGGG","isoWeekYear"),J("weekYear","gg"),J("isoWeekYear","GG"),M("weekYear",1),M("isoWeekYear",1),Z("G",Zd),Z("g",Zd),Z("GG",Sd,Od),Z("gg",Sd,Od),Z("GGGG",Wd,Qd),Z("gggg",Wd,Qd),Z("GGGGG",Xd,Rd),Z("ggggg",Xd,Rd),ca(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=u(a)}),ca(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),U("Q",0,"Qo","quarter"),J("quarter","Q"),M("quarter",7),Z("Q",Nd),ba("Q",function(a,b){b[fe]=3*(u(a)-1)}),U("D",["DD",2],"Do","date"),J("date","D"),M("date",9),Z("D",Sd),Z("DD",Sd,Od),Z("Do",function(a,b){return a?b._dayOfMonthOrdinalParse||b._ordinalParse:b._dayOfMonthOrdinalParseLenient}),ba(["D","DD"],ge),ba("Do",function(a,b){b[ge]=u(a.match(Sd)[0],10)});var Ye=O("Date",!0);U("DDD",["DDDD",3],"DDDo","dayOfYear"),J("dayOfYear","DDD"),M("dayOfYear",4),Z("DDD",Vd),Z("DDDD",Pd),ba(["DDD","DDDD"],function(a,b,c){c._dayOfYear=u(a)}),U("m",["mm",2],0,"minute"),J("minute","m"),M("minute",14),Z("m",Sd),Z("mm",Sd,Od),ba(["m","mm"],ie);var Ze=O("Minutes",!1);U("s",["ss",2],0,"second"),J("second","s"),M("second",15),Z("s",Sd),Z("ss",Sd,Od),ba(["s","ss"],je);var $e=O("Seconds",!1);U("S",0,0,function(){return~~(this.millisecond()/100)}),U(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,function(){return 10*this.millisecond()}),U(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),U(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),U(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),U(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),U(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),J("millisecond","ms"),M("millisecond",16),Z("S",Vd,Nd),Z("SS",Vd,Od),Z("SSS",Vd,Pd);var _e;for(_e="SSSS";_e.length<=9;_e+="S")Z(_e,Yd);for(_e="S";_e.length<=9;_e+="S")ba(_e,Mc);var af=O("Milliseconds",!1);U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var bf=r.prototype;bf.add=Ve,bf.calendar=Zb,bf.clone=$b,bf.diff=fc,bf.endOf=sc,bf.format=kc,bf.from=lc,bf.fromNow=mc,bf.to=nc,bf.toNow=oc,bf.get=R,bf.invalidAt=Bc,bf.isAfter=_b,bf.isBefore=ac,bf.isBetween=bc,bf.isSame=cc,bf.isSameOrAfter=dc,bf.isSameOrBefore=ec,bf.isValid=zc,bf.lang=Xe,bf.locale=pc,bf.localeData=qc,bf.max=Pe,bf.min=Oe,bf.parsingFlags=Ac,bf.set=S,bf.startOf=rc,bf.subtract=We,bf.toArray=wc,bf.toObject=xc,bf.toDate=vc,bf.toISOString=ic,bf.inspect=jc,bf.toJSON=yc,bf.toString=hc,bf.unix=uc,bf.valueOf=tc,bf.creationData=Cc,bf.year=te,bf.isLeapYear=ra,bf.weekYear=Ec,bf.isoWeekYear=Fc,bf.quarter=bf.quarters=Kc,bf.month=ka,bf.daysInMonth=la,bf.week=bf.weeks=Ba,bf.isoWeek=bf.isoWeeks=Ca,bf.weeksInYear=Hc,bf.isoWeeksInYear=Gc,bf.date=Ye,bf.day=bf.days=Ka,bf.weekday=La,bf.isoWeekday=Ma,bf.dayOfYear=Lc,bf.hour=bf.hours=De,bf.minute=bf.minutes=Ze,bf.second=bf.seconds=$e,bf.millisecond=bf.milliseconds=af,bf.utcOffset=Hb,bf.utc=Jb,bf.local=Kb,bf.parseZone=Lb,bf.hasAlignedHourOffset=Mb,bf.isDST=Nb,bf.isLocal=Pb,bf.isUtcOffset=Qb,bf.isUtc=Rb,bf.isUTC=Rb,bf.zoneAbbr=Nc,bf.zoneName=Oc,bf.dates=x("dates accessor is deprecated. Use date instead.",Ye),bf.months=x("months accessor is deprecated. Use month instead",ka),bf.years=x("years accessor is deprecated. Use year instead",te),bf.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ib),bf.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ob);var cf=C.prototype;cf.calendar=D,cf.longDateFormat=E,cf.invalidDate=F,cf.ordinal=G,cf.preparse=Rc,cf.postformat=Rc,cf.relativeTime=H,cf.pastFuture=I,cf.set=A,cf.months=fa,cf.monthsShort=ga,cf.monthsParse=ia,cf.monthsRegex=na,cf.monthsShortRegex=ma,cf.week=ya,cf.firstDayOfYear=Aa,cf.firstDayOfWeek=za,cf.weekdays=Fa,cf.weekdaysMin=Ha,cf.weekdaysShort=Ga,cf.weekdaysParse=Ja,cf.weekdaysRegex=Na,cf.weekdaysShortRegex=Oa,cf.weekdaysMinRegex=Pa,cf.isPM=Va,cf.meridiem=Wa,$a("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===u(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=x("moment.lang is deprecated. Use moment.locale instead.",$a),a.langData=x("moment.langData is deprecated. Use moment.localeData instead.",bb);var df=Math.abs,ef=id("ms"),ff=id("s"),gf=id("m"),hf=id("h"),jf=id("d"),kf=id("w"),lf=id("M"),mf=id("y"),nf=kd("milliseconds"),of=kd("seconds"),pf=kd("minutes"),qf=kd("hours"),rf=kd("days"),sf=kd("months"),tf=kd("years"),uf=Math.round,vf={ss:44,s:45,m:45,h:22,d:26,M:11},wf=Math.abs,xf=Ab.prototype;return xf.isValid=yb,xf.abs=$c,xf.add=ad,xf.subtract=bd,xf.as=gd,xf.asMilliseconds=ef,xf.asSeconds=ff,xf.asMinutes=gf,xf.asHours=hf,xf.asDays=jf,xf.asWeeks=kf,xf.asMonths=lf,xf.asYears=mf,xf.valueOf=hd,xf._bubble=dd,xf.get=jd,xf.milliseconds=nf,xf.seconds=of,xf.minutes=pf,xf.hours=qf,xf.days=rf,xf.weeks=ld,xf.months=sf,xf.years=tf,xf.humanize=qd,xf.toISOString=rd,xf.toString=rd,xf.toJSON=rd,xf.locale=pc,xf.localeData=qc,xf.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",rd),xf.lang=Xe,U("X",0,0,"unix"),U("x",0,0,"valueOf"),Z("x",Zd),Z("X",ae),ba("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),ba("x",function(a,b,c){c._d=new Date(u(a))}),a.version="2.18.1",b(tb),a.fn=bf,a.min=vb,a.max=wb,a.now=Qe,a.utc=l,a.unix=Pc,a.months=Vc,a.isDate=h,a.locale=$a,a.invalid=p,a.duration=Sb,a.isMoment=s,a.weekdays=Xc,a.parseZone=Qc,a.localeData=bb,a.isDuration=Bb,a.monthsShort=Wc,a.weekdaysMin=Zc,a.defineLocale=_a,a.updateLocale=ab,a.locales=cb,a.weekdaysShort=Yc,a.normalizeUnits=K,a.relativeTimeRounding=od,a.relativeTimeThreshold=pd,a.calendarFormat=Yb,a.prototype=bf,a}); \ No newline at end of file diff --git a/website/site/static/prism.js b/website/site/static/prism.js deleted file mode 100644 index fbf00a13..00000000 --- a/website/site/static/prism.js +++ /dev/null @@ -1,18 +0,0 @@ -/* PrismJS 1.14.0 -http://prismjs.com/download.html?#themes=prism&languages=markup+css+clike+javascript+bash+ruby+markup-templating+git+go+handlebars+json+markdown+jsx+yaml&plugins=line-numbers */ -var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-([\w-]+)\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,disableWorkerMessageHandler:_self.Prism&&_self.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof r?new r(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(w instanceof s)){if(m&&b!=t.length-1){h.lastIndex=k;var _=h.exec(e);if(!_)break;for(var j=_.index+(d?_[1].length:0),P=_.index+_[0].length,A=b,x=k,O=t.length;O>A&&(P>x||!t[A].type&&!t[A-1].greedy);++A)x+=t[A].length,j>=x&&(++b,k=x);if(t[b]instanceof s)continue;I=A-b,w=e.slice(k,x),_.index-=k}else{h.lastIndex=0;var _=h.exec(w),I=1}if(_){d&&(p=_[1]?_[1].length:0);var j=_.index+p,_=_[0].slice(p),P=j+_.length,N=w.slice(0,j),S=w.slice(P),C=[b,I];N&&(++b,k+=N.length,C.push(N));var E=new s(u,f?n.tokenize(_,f):_,y,_,m);if(C.push(E),S&&C.push(S),Array.prototype.splice.apply(t,C),1!=I&&n.matchGrammar(e,t,r,b,k,!0,u),i)break}else if(i)break}}}}},tokenize:function(e,t){var r=[e],a=t.rest;if(a){for(var l in a)t[l]=a[l];delete t.rest}return n.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){var r=n.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){var r=n.hooks.all[e];if(r&&r.length)for(var a,l=0;a=r[l++];)a(t)}}},r=n.Token=function(e,t,n,r,a){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length,this.greedy=!!a};if(r.stringify=function(e,t,a){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return r.stringify(n,t,e)}).join("");var l={type:e.type,content:r.stringify(e.content,t,a),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:a};if(e.alias){var i="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}n.hooks.run("wrap",l);var o=Object.keys(l.attributes).map(function(e){return e+'="'+(l.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+l.tag+' class="'+l.classes.join(" ")+'"'+(o?" "+o:"")+">"+l.content+""},!_self.document)return _self.addEventListener?(n.disableWorkerMessageHandler||_self.addEventListener("message",function(e){var t=JSON.parse(e.data),r=t.language,a=t.code,l=t.immediateClose;_self.postMessage(n.highlight(a,n.languages[r],r)),l&&_self.close()},!1),_self.Prism):_self.Prism;var a=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return a&&(n.filename=a.src,n.manual||a.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism); -Prism.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/(^|[^\\])["']/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup; -Prism.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^{}\s][^{};]*?(?=\s*\{)/,string:{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.languages.css,Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/()[\s\S]*?(?=<\/style>)/i,lookbehind:!0,inside:Prism.languages.css,alias:"language-css",greedy:!0}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag)); -Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(?:true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/}; -Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,"function":/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/i,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[[^\]\r\n]+]|\\.|[^\/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i,alias:"function"},constant:/\b[A-Z][A-Z\d_]*\b/}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${[^}]+}|[^\\`])*`/,greedy:!0,inside:{interpolation:{pattern:/\${[^}]+}/,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}}}),Prism.languages.javascript["template-string"].inside.interpolation.inside.rest=Prism.languages.javascript,Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/()[\s\S]*?(?=<\/script>)/i,lookbehind:!0,inside:Prism.languages.javascript,alias:"language-javascript",greedy:!0}}),Prism.languages.js=Prism.languages.javascript; -!function(e){var t={variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\([^)]+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},/\$(?:[\w#?*!@]+|\{[^}]+\})/i]};e.languages.bash={shebang:{pattern:/^#!\s*\/bin\/bash|^#!\s*\/bin\/sh/,alias:"important"},comment:{pattern:/(^|[^"{\\])#.*/,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<\s*)["']?(\w+?)["']?\s*\r?\n(?:[\s\S])*?\r?\n\2/,lookbehind:!0,greedy:!0,inside:t},{pattern:/(["'])(?:\\[\s\S]|\$\([^)]+\)|`[^`]+`|(?!\1)[^\\])*\1/,greedy:!0,inside:t}],variable:t.variable,"function":{pattern:/(^|[\s;|&])(?:alias|apropos|apt-get|aptitude|aspell|awk|basename|bash|bc|bg|builtin|bzip2|cal|cat|cd|cfdisk|chgrp|chmod|chown|chroot|chkconfig|cksum|clear|cmp|comm|command|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|enable|env|ethtool|eval|exec|expand|expect|export|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|getopts|git|grep|groupadd|groupdel|groupmod|groups|gzip|hash|head|help|hg|history|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|jobs|join|kill|killall|less|link|ln|locate|logname|logout|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|make|man|mkdir|mkfifo|mkisofs|mknod|more|most|mount|mtools|mtr|mv|mmv|nano|netstat|nice|nl|nohup|notify-send|npm|nslookup|open|op|passwd|paste|pathchk|ping|pkill|popd|pr|printcap|printenv|printf|ps|pushd|pv|pwd|quota|quotacheck|quotactl|ram|rar|rcp|read|readarray|readonly|reboot|rename|renice|remsync|rev|rm|rmdir|rsync|screen|scp|sdiff|sed|seq|service|sftp|shift|shopt|shutdown|sleep|slocate|sort|source|split|ssh|stat|strace|su|sudo|sum|suspend|sync|tail|tar|tee|test|time|timeout|times|touch|top|traceroute|trap|tr|tsort|tty|type|ulimit|umask|umount|unalias|uname|unexpand|uniq|units|unrar|unshar|uptime|useradd|userdel|usermod|users|uuencode|uudecode|v|vdir|vi|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yes|zip)(?=$|[\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&])(?:let|:|\.|if|then|else|elif|fi|for|break|continue|while|in|case|function|select|do|done|until|echo|exit|return|set|declare)(?=$|[\s;|&])/,lookbehind:!0},"boolean":{pattern:/(^|[\s;|&])(?:true|false)(?=$|[\s;|&])/,lookbehind:!0},operator:/&&?|\|\|?|==?|!=?|<<>|<=?|>=?|=~/,punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];]/};var a=t.variable[1].inside;a.string=e.languages.bash.string,a["function"]=e.languages.bash["function"],a.keyword=e.languages.bash.keyword,a["boolean"]=e.languages.bash["boolean"],a.operator=e.languages.bash.operator,a.punctuation=e.languages.bash.punctuation,e.languages.shell=e.languages.bash}(Prism); -!function(e){e.languages.ruby=e.languages.extend("clike",{comment:[/#.*/,{pattern:/^=begin(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?=end/m,greedy:!0}],keyword:/\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/});var n={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:e.languages.ruby}};e.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0,greedy:!0}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:{pattern:/(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/,lookbehind:!0}}),e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z]\w*(?:[?!]|\b)/}),e.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,greedy:!0,inside:{interpolation:n}},{pattern:/("|')(?:#\{[^}]+\}|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{interpolation:n}}]}(Prism); -Prism.languages["markup-templating"]={},Object.defineProperties(Prism.languages["markup-templating"],{buildPlaceholders:{value:function(e,t,n,a){e.language===t&&(e.tokenStack=[],e.code=e.code.replace(n,function(n){if("function"==typeof a&&!a(n))return n;for(var r=e.tokenStack.length;-1!==e.code.indexOf("___"+t.toUpperCase()+r+"___");)++r;return e.tokenStack[r]=n,"___"+t.toUpperCase()+r+"___"}),e.grammar=Prism.languages.markup)}},tokenizePlaceholders:{value:function(e,t){if(e.language===t&&e.tokenStack){e.grammar=Prism.languages[t];var n=0,a=Object.keys(e.tokenStack),r=function(o){if(!(n>=a.length))for(var i=0;i-1){++n;var f,u=l.substring(0,p),_=new Prism.Token(t,Prism.tokenize(s,e.grammar,t),"language-"+t,s),k=l.substring(p+("___"+t.toUpperCase()+c+"___").length);if(u||k?(f=[u,_,k].filter(function(e){return!!e}),r(f)):f=_,"string"==typeof g?Array.prototype.splice.apply(o,[i,1].concat(f)):g.content=f,n>=a.length)break}}else g.content&&"string"!=typeof g.content&&r(g.content)}};r(e.tokens)}}}}); -Prism.languages.git={comment:/^#.*/m,deleted:/^[-–].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/m,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/m}},coord:/^@@.*@@$/m,commit_sha1:/^commit \w{40}$/m}; -Prism.languages.go=Prism.languages.extend("clike",{keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,builtin:/\b(?:bool|byte|complex(?:64|128)|error|float(?:32|64)|rune|string|u?int(?:8|16|32|64)?|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(?:ln)?|real|recover)\b/,"boolean":/\b(?:_|iota|nil|true|false)\b/,operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,number:/(?:\b0x[a-f\d]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[-+]?\d+)?)i?/i,string:{pattern:/(["'`])(\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0}}),delete Prism.languages.go["class-name"]; -!function(a){a.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/i,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,"boolean":/\b(?:true|false)\b/,block:{pattern:/^(\s*~?\s*)[#\/]\S+?(?=\s*~?\s*$|\s)/i,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~\s]+/},a.hooks.add("before-tokenize",function(e){var n=/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g;a.languages["markup-templating"].buildPlaceholders(e,"handlebars",n)}),a.hooks.add("after-tokenize",function(e){a.languages["markup-templating"].tokenizePlaceholders(e,"handlebars")})}(Prism); -Prism.languages.json={property:/"(?:\\.|[^\\"\r\n])*"(?=\s*:)/i,string:{pattern:/"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,greedy:!0},number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,punctuation:/[{}[\]);,]/,operator:/:/g,"boolean":/\b(?:true|false)\b/i,"null":/\bnull\b/i},Prism.languages.jsonp=Prism.languages.json; -Prism.languages.markdown=Prism.languages.extend("markup",{}),Prism.languages.insertBefore("markdown","prolog",{blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},code:[{pattern:/^(?: {4}|\t).+/m,alias:"keyword"},{pattern:/``.+?``|`[^`\n]+`/,alias:"keyword"}],title:[{pattern:/\w+.*(?:\r?\n|\r)(?:==+|--+)/,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#+.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:/(^|[^\\])(\*\*|__)(?:(?:\r?\n|\r)(?!\r?\n|\r)|.)+?\2/,lookbehind:!0,inside:{punctuation:/^\*\*|^__|\*\*$|__$/}},italic:{pattern:/(^|[^\\])([*_])(?:(?:\r?\n|\r)(?!\r?\n|\r)|.)+?\2/,lookbehind:!0,inside:{punctuation:/^[*_]|[*_]$/}},url:{pattern:/!?\[[^\]]+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)| ?\[[^\]\n]*\])/,inside:{variable:{pattern:/(!?\[)[^\]]+(?=\]$)/,lookbehind:!0},string:{pattern:/"(?:\\.|[^"\\])*"(?=\)$)/}}}}),Prism.languages.markdown.bold.inside.url=Prism.languages.markdown.url,Prism.languages.markdown.italic.inside.url=Prism.languages.markdown.url,Prism.languages.markdown.bold.inside.italic=Prism.languages.markdown.italic,Prism.languages.markdown.italic.inside.bold=Prism.languages.markdown.bold; -!function(t){var n=t.util.clone(t.languages.javascript);t.languages.jsx=t.languages.extend("markup",n),t.languages.jsx.tag.pattern=/<\/?[\w.:-]+\s*(?:\s+(?:[\w.:-]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s{'">=]+|\{(?:\{[^}]*\}|[^{}])+\}))?|\{\.{3}[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\}))*\s*\/?>/i,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">]+)/i,t.languages.insertBefore("inside","attr-name",{spread:{pattern:/\{\.{3}[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\}/,inside:{punctuation:/\.{3}|[{}.]/,"attr-value":/\w+/}}},t.languages.jsx.tag),t.languages.insertBefore("inside","attr-value",{script:{pattern:/=(\{(?:\{[^}]*\}|[^}])+\})/i,inside:{"script-punctuation":{pattern:/^=(?={)/,alias:"punctuation"},rest:t.languages.jsx},alias:"language-javascript"}},t.languages.jsx.tag);var e=function(t){return"string"==typeof t?t:"string"==typeof t.content?t.content:t.content.map(e).join("")},a=function(n){for(var s=[],g=0;g0&&s[s.length-1].tagName===e(o.content[0].content[1])&&s.pop():"/>"===o.content[o.content.length-1].content||s.push({tagName:e(o.content[0].content[1]),openedBraces:0}):s.length>0&&"punctuation"===o.type&&"{"===o.content?s[s.length-1].openedBraces++:s.length>0&&s[s.length-1].openedBraces>0&&"punctuation"===o.type&&"}"===o.content?s[s.length-1].openedBraces--:i=!0),(i||"string"==typeof o)&&s.length>0&&0===s[s.length-1].openedBraces){var p=e(o);g0&&("string"==typeof n[g-1]||"plain-text"===n[g-1].type)&&(p=e(n[g-1])+p,n.splice(g-1,1),g--),n[g]=new t.Token("plain-text",p,null,p)}o.content&&"string"!=typeof o.content&&a(o.content)}};t.hooks.add("after-tokenize",function(t){("jsx"===t.language||"tsx"===t.language)&&a(t.tokens)})}(Prism); -Prism.languages.yaml={scalar:{pattern:/([\-:]\s*(?:![^\s]+)?[ \t]*[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)[^\r\n]+(?:\2[^\r\n]+)*)/,lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:/(\s*(?:^|[:\-,[{\r\n?])[ \t]*(?:![^\s]+)?[ \t]*)[^\r\n{[\]},#\s]+?(?=\s*:\s)/,lookbehind:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:/([:\-,[{]\s*(?:![^\s]+)?[ \t]*)(?:\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?)?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?)(?=[ \t]*(?:$|,|]|}))/m,lookbehind:!0,alias:"number"},"boolean":{pattern:/([:\-,[{]\s*(?:![^\s]+)?[ \t]*)(?:true|false)[ \t]*(?=$|,|]|})/im,lookbehind:!0,alias:"important"},"null":{pattern:/([:\-,[{]\s*(?:![^\s]+)?[ \t]*)(?:null|~)[ \t]*(?=$|,|]|})/im,lookbehind:!0,alias:"important"},string:{pattern:/([:\-,[{]\s*(?:![^\s]+)?[ \t]*)("|')(?:(?!\2)[^\\\r\n]|\\.)*\2(?=[ \t]*(?:$|,|]|}))/m,lookbehind:!0,greedy:!0},number:{pattern:/([:\-,[{]\s*(?:![^\s]+)?[ \t]*)[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+\.?\d*|\.?\d+)(?:e[+-]?\d+)?|\.inf|\.nan)[ \t]*(?=$|,|]|})/im,lookbehind:!0},tag:/![^\s]+/,important:/[&*][\w]+/,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./}; -!function(){if("undefined"!=typeof self&&self.Prism&&self.document){var e="line-numbers",t=/\n(?!$)/g,n=function(e){var n=r(e),s=n["white-space"];if("pre-wrap"===s||"pre-line"===s){var l=e.querySelector("code"),i=e.querySelector(".line-numbers-rows"),a=e.querySelector(".line-numbers-sizer"),o=l.textContent.split(t);a||(a=document.createElement("span"),a.className="line-numbers-sizer",l.appendChild(a)),a.style.display="block",o.forEach(function(e,t){a.textContent=e||"\n";var n=a.getBoundingClientRect().height;i.children[t].style.height=n+"px"}),a.textContent="",a.style.display="none"}},r=function(e){return e?window.getComputedStyle?getComputedStyle(e):e.currentStyle||null:null};window.addEventListener("resize",function(){Array.prototype.forEach.call(document.querySelectorAll("pre."+e),n)}),Prism.hooks.add("complete",function(e){if(e.code){var r=e.element.parentNode,s=/\s*\bline-numbers\b\s*/;if(r&&/pre/i.test(r.nodeName)&&(s.test(r.className)||s.test(e.element.className))&&!e.element.querySelector(".line-numbers-rows")){s.test(e.element.className)&&(e.element.className=e.element.className.replace(s," ")),s.test(r.className)||(r.className+=" line-numbers");var l,i=e.code.match(t),a=i?i.length+1:1,o=new Array(a+1);o=o.join(""),l=document.createElement("span"),l.setAttribute("aria-hidden","true"),l.className="line-numbers-rows",l.innerHTML=o,r.hasAttribute("data-start")&&(r.style.counterReset="linenumber "+(parseInt(r.getAttribute("data-start"),10)-1)),e.element.appendChild(l),n(r),Prism.hooks.run("line-numbers",e)}}}),Prism.hooks.add("line-numbers",function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0}),Prism.plugins.lineNumbers={getLine:function(t,n){if("PRE"===t.tagName&&t.classList.contains(e)){var r=t.querySelector(".line-numbers-rows"),s=parseInt(t.getAttribute("data-start"),10)||1,l=s+(r.children.length-1);s>n&&(n=s),n>l&&(n=l);var i=n-s;return r.children[i]}}}}}(); diff --git a/website/site/static/widgets.js b/website/site/static/widgets.js deleted file mode 100644 index 8b05b855..00000000 --- a/website/site/static/widgets.js +++ /dev/null @@ -1,76 +0,0 @@ -// Widgets section -function widgetsCloud() { - - const widgetItems = document.getElementsByClassName("widgets__item"), // Widget word cloud - widgets = document.getElementsByClassName("widget"); // Widgets' bodies - let activeWidgetItem = document.getElementsByClassName("widgets__item_active")[0]; // Active button in the widgets cloud - - if (document.getElementsByClassName("widgets")) { - - if (loadWidgetFromHash()) { // Scroll to widget cloud if URL hash set to a widget. - setTimeout(() => { - document.getElementsByClassName("widgets")[0].scrollIntoView({ - behavior: "smooth", - block: "nearest" - }); // Scrolls to the widgets section - }, 200); - } - window.addEventListener('hashchange', loadWidgetFromHash); - - for (let i = 0; i < widgetItems.length; i++) { - widgetItems[i].addEventListener("click", e => { // Add click event for each widget button in the cloud - const targetWidget = document.getElementById(e.target.dataset.widgetTarget), // Defines which widget the user is trying to render - openedWidget = document.getElementsByClassName("widget_open")[0], // Defines the current open widget - targetWidgetItem = e.target; // Defines the current open widget - changeWidgets(openedWidget, targetWidget, targetWidgetItem); // Runs the function to change which widget is displayed - }) - } - } - function loadWidgetFromHash() { - if (!window.location.hash) return; // Check if the given URL has a hash to make each widget shareable - - const targetWidget = document.getElementById(window.location.hash.substr(1)), - openedWidget = document.getElementsByClassName("widget_open")[0]; - - let targetWidgetItem = ""; - for (let i = 0; i < widgetItems.length; i++) { - if (widgetItems[i].dataset.widgetTarget == window.location.hash.substr(1)) { - targetWidgetItem = widgetItems[i] - } - }; - if (!targetWidgetItem) return; // Make sure the hash pointed to a widget, not something else. - - changeWidgets(openedWidget, targetWidget, targetWidgetItem, true); // Runs the function to change which widget is displayed - return true; - } - function changeWidgets(active, target, cloudItem, preventHistoryUpdate) { - - target.classList.add("widget_opening"); // Starts the process of opening the next widget - - active.classList.remove("widget_open"); // Removes the active state of the current widget - active.classList.add("widget_closing"); // But guarantees the current active widget a closing class for transition purposes - - activeWidgetItem.classList.remove("widgets__item_active"); // Removes the active state of the current widget item in the cloud - activeWidgetItem = cloudItem; // Sets the new active widget item as the clicked one - activeWidgetItem.classList.add("widgets__item_active"); // And adds the active CSS class to it - - if (!preventHistoryUpdate) { - if (history.pushState) { - history.pushState(null, null, '#' + cloudItem.dataset.widgetTarget); - } - else { - location.hash = '#' + cloudItem.dataset.widgetTarget; - } - } - - setTimeout(() => { - target.classList.remove("widget_opening"); // Removes the opening class to finish transition - target.classList.add("widget_open"); // Defines the new target widget - active.classList.remove("widget_closing"); // Finally gets completely rid of the previously openened widget - - }, 150) // When the transition is done, finish the process by attributing the final classes to each widget - } -} - - -widgetsCloud(); diff --git a/website/src/components/docs-nav.js b/website/src/components/docs-nav.js new file mode 100644 index 00000000..4b0b1b5e --- /dev/null +++ b/website/src/components/docs-nav.js @@ -0,0 +1,70 @@ +import React, { Component } from 'react'; +import Link from 'gatsby-link'; + +/** + * Maually get table of contents since tableOfContents from markdown + * nodes have code added. + * + * https://github.com/gatsbyjs/gatsby/issues/5436 + */ +class TableOfContents extends Component { + state = { + headings: [] + }; + + componentDidMount() { + const contentHeadings = document.querySelectorAll('.docs-content h2'); + + const headings = []; + contentHeadings.forEach(h => { + headings.push({ + id: h.id, + text: h.innerText + }); + }); + + this.setState({ + headings + }); + } + + render() { + const { headings } = this.state; + return ( + + ); + } +} + +const DocsNav = ({ items, location }) => ( + +); + +export default DocsNav; diff --git a/website/src/components/docsearch.js b/website/src/components/docsearch.js new file mode 100644 index 00000000..bd595bcd --- /dev/null +++ b/website/src/components/docsearch.js @@ -0,0 +1,39 @@ +import React, { Component } from 'react'; + +import searchIcon from '../img/search.svg'; + +class DocSearch extends Component { + state = { + enabled: true + }; + componentDidMount() { + if (window.docsearch) { + window.docsearch({ + apiKey: '08d03dc80862e84c70c5a1e769b13019', + indexName: 'netlifycms', + inputSelector: '.algolia-search', + debug: false // Set debug to true if you want to inspect the dropdown + }); + } else { + this.setState({ enabled: false }); + } + } + render() { + if (!this.state.enabled) { + return null; + } + + return ( + + + + + ); + } +} + +export default DocSearch; diff --git a/website/src/components/edit-link.js b/website/src/components/edit-link.js new file mode 100644 index 00000000..ae338377 --- /dev/null +++ b/website/src/components/edit-link.js @@ -0,0 +1,30 @@ +import React from 'react'; + +const EditLink = ({ path }) => ( + + + + {' '} + Edit this page + +); + +export default EditLink; diff --git a/website/src/components/event-widget.js b/website/src/components/event-widget.js new file mode 100644 index 00000000..3de82660 --- /dev/null +++ b/website/src/components/event-widget.js @@ -0,0 +1,71 @@ +import React, { Component } from 'react'; +import moment from 'moment'; + +class EventWidget extends Component { + state = { + loading: false, + eventDate: '' + }; + + componentDidMount() { + const eventbriteToken = 'C5PX65CJBVIXWWLNFKLO'; + const eventbriteOrganiser = '14281996019'; + + const url = `https://www.eventbriteapi.com/v3/events/search/?token=${eventbriteToken}&organizer.id=${eventbriteOrganiser}&expand=venue%27`; + + this.setState({ + loading: true + }); + + fetch(url) + .then(res => res.json()) + .then(data => { + const eventDate = data.events[0].start.utc; + + this.setState({ + loading: false, + eventDate + }); + }) + .catch(err => { + console.log(err); + // TODO: set state to show error message + this.setState({ + loading: false + }); + }); + } + render() { + const { loading, eventDate } = this.state; + + if (loading) { + return Loading...; + } + + const eventDateMoment = moment(eventDate); + + const offset = eventDateMoment.isDST() ? -7 : -8; + + const month = eventDateMoment.format('MMMM'); + const day = eventDateMoment.format('DD'); + + const datePrefix = eventDateMoment.format('dddd, MMMM Do'); + const dateSuffix = eventDateMoment.utcOffset(offset).format('h a'); + + return ( +
+
+
{month}
+
{day}
+
+

+ + {datePrefix} at {dateSuffix} PT + +

+
+ ); + } +} + +export default EventWidget; diff --git a/website/src/components/footer.js b/website/src/components/footer.js new file mode 100644 index 00000000..e14bda3d --- /dev/null +++ b/website/src/components/footer.js @@ -0,0 +1,36 @@ +import React from 'react'; + +import '../css/imports/footer.css'; + +const Footer = ({ buttons }) => ( + +); + +export default Footer; diff --git a/website/src/components/header.js b/website/src/components/header.js new file mode 100644 index 00000000..8c24387f --- /dev/null +++ b/website/src/components/header.js @@ -0,0 +1,94 @@ +import React, { Component } from 'react'; +import Link from 'gatsby-link'; +import classnames from 'classnames'; + +import DocSearch from './docsearch'; + +import logo from '../img/netlify-cms-logo.svg'; + +import '../css/imports/header.css'; + +class Header extends Component { + state = { + scrolled: false + }; + + componentDidMount() { + // TODO: use raf to throttle events + window.addEventListener('scroll', this.handleScroll); + } + + componentWillUnmount() { + window.removeEventListener('scroll', this.handleScroll); + } + + handleScroll = event => { + const currentWindowPos = + document.documentElement.scrollTop || document.body.scrollTop; + + const scrolled = currentWindowPos > 0; + + this.setState({ + scrolled + }); + }; + + render() { + const { location } = this.props; + const { scrolled } = this.state; + + const isDocs = location.pathname.indexOf('docs') !== -1; + const isBlog = location.pathname.indexOf('blog') !== -1; + + return ( + + ); + } +} + +export default Header; diff --git a/website/src/components/markdownify.js b/website/src/components/markdownify.js new file mode 100644 index 00000000..e13baa4b --- /dev/null +++ b/website/src/components/markdownify.js @@ -0,0 +1,11 @@ +import React, { Fragment } from 'react'; +import Markdown from 'react-markdown'; + +const Markdownify = ({ source }) => ( + +); + +export default Markdownify; diff --git a/website/src/components/mobile-nav.js b/website/src/components/mobile-nav.js new file mode 100644 index 00000000..7463a9c5 --- /dev/null +++ b/website/src/components/mobile-nav.js @@ -0,0 +1,32 @@ +import React, { Component } from 'react'; + +class MobileNav extends Component { + handleChange = event => { + this.props.history.push(event.target.value); + }; + render() { + const { items } = this.props; + + return ( +
+ +
+ ); + } +} + +export default MobileNav; diff --git a/website/src/components/video-embed.js b/website/src/components/video-embed.js new file mode 100644 index 00000000..9f985537 --- /dev/null +++ b/website/src/components/video-embed.js @@ -0,0 +1,41 @@ +import React, { Component } from 'react'; + +import screenshotEditor from '../img/screenshot-editor.jpg'; + +class VideoEmbed extends Component { + state = { + toggled: false + }; + toggleVideo = event => { + this.setState({ + toggled: true + }); + }; + render() { + const { toggled } = this.state; + + const embedcode = ( + '; - -$('.hero-graphic').click(function() { - $('.hero-graphic img').replaceWith(embedcode); - $('.hero-videolink').remove(); -}); diff --git a/website/src/layouts/index.js b/website/src/layouts/index.js new file mode 100644 index 00000000..20fb6913 --- /dev/null +++ b/website/src/layouts/index.js @@ -0,0 +1,66 @@ +import React, { Fragment } from 'react'; +import Helmet from 'react-helmet'; +import classnames from 'classnames'; + +import Header from '../components/header'; +import Footer from '../components/footer'; + +import '../css/imports/base.css'; +import '../css/imports/utilities.css'; +import '../css/imports/gitter.css'; + +const Layout = ({ data, location, children }) => { + const { title, description } = data.site.siteMetadata; + const notifs = data.notifs.notifications.filter(notif => notif.published); + + return ( + + + + + {notifs.map((node, i) => ( + + {node.message} + + ))} +
+ {children()} +