Skip to content

Commit

Permalink
Migrate website from netlify-cms-www
Browse files Browse the repository at this point in the history
Some modifications, including most of the changes in netlify/netlify-cms-www#58 (previously reverted).

Also updated the readme and added hugo-bin for quicker onboarding of new docs contributors.
  • Loading branch information
verythorough committed Dec 4, 2017
1 parent 1d12d87 commit bfb8fc3
Show file tree
Hide file tree
Showing 74 changed files with 9,557 additions and 0 deletions.
7 changes: 7 additions & 0 deletions website/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": ["es2015"],
"plugins": [
"syntax-object-rest-spread",
"transform-object-rest-spread"
]
}
1 change: 1 addition & 0 deletions website/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node
19 changes: 19 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Netlify CMS Website & Docs

This directory builds netlifycms.org. If you'd like to propose changes to the site or docs, you'll find the source files in here.

## 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).

To run the site locally, you'll need to have [Node](https://nodejs.org) and [Yarn](https://yarnpkg.com/en/) installed on your computer.

From your terminal window, `cd` into the `website` directory of the repo, and run

```bash
yarn
yarn start
```

Then visit http://localhost:3000/ - BrowserSync will automatically reload CSS or
refresh the page when stylesheets or content changes.
45 changes: 45 additions & 0 deletions website/config/variables.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// if you change these you must restart the server

module.exports = {

// colors
lightestGrey: '#E6E6E6',
lighterGrey: '#F7F8F8',
lightGrey: '#F6F6F6',
grey: '#313D3E',
darkGrey: '#2F3132',
darkerGrey: '#1C1E1E',
lightGreen: '#97bf2f',
green: '#C9FA4B',
darkGreen: '#7CA511',

// typography
thin: 100,
light: 300,
regular: 400,
semibold: 500,
bold: 700,
black: 900,

// fonts
roboto: "'Roboto', -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif",

// padding
micro: '8px',
tiny: '16px',
small: '24px',
medium: '40px',
large: '64px',
xl: '104px',
xxl: '168px',

// border radius
borderRadius: '4px',
largeBorderRadius: '10px',

// responsive breakpoints
mobile: '480px',
tablet: '768px',
desktop: '960px',
display: '1200px'
}
94 changes: 94 additions & 0 deletions website/gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
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 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";

const browserSync = BrowserSync.create();
const defaultArgs = ["-d", "../dist", "-s", "site", "-v"];

gulp.task("hugo", (cb) => buildSite(cb));
gulp.task("hugo-preview", (cb) => buildSite(cb, ["--buildDrafts", "--buildFuture"]));

gulp.task("build", ["css", "js", "fonts", "images", "hugo"]);
gulp.task("build-preview", ["css", "js", "fonts", "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("fonts", () => (
gulp.src("./src/fonts/**/*")
.pipe(gulp.dest("./dist/fonts"))
.pipe(browserSync.stream())
));

gulp.task("images", () => (
gulp.src("./src/img/**/*")
.pipe(gulp.dest("./dist/img"))
.pipe(browserSync.stream())
));

gulp.task("server", ["hugo", "css", "js", "fonts", "images"], () => {
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("./src/fonts/**/*", ["fonts"]);
gulp.watch("./site/**/*", ["hugo"]);
});

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");
}
});
}

6 changes: 6 additions & 0 deletions website/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build]
command = "yarn build"
publish = "dist"

[context.deploy-preview]
command = "yarn build-preview"
53 changes: 53 additions & 0 deletions website/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "victor-hugo",
"version": "1.0.0",
"description": "Victor Hugo is a Hugo boilerplate for creating truly epic websites!",
"main": "index.js",
"scripts": {
"hugo": "gulp hugo",
"webpack": "gulp webpack",
"build": "gulp build",
"build-preview": "gulp build-preview",
"start": "gulp server",
"lint": "eslint src"
},
"author": "",
"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",
"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-util": "^3.0.7",
"hugo-bin": "^0.18.0",
"imports-loader": "^0.6.5",
"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"
},
"devDependencies": {}
}
6 changes: 6 additions & 0 deletions website/site/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
baseurl: "/"
languageCode: "en-us"
title: "Netlify CMS | Open-Source Content Management System"
disable404: true
pluralizeListTitles: false
metaDataFormat: "yaml"
Empty file added website/site/content/.keep
Empty file.
29 changes: 29 additions & 0 deletions website/site/content/pages/community.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
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 our open, bi-weekly planning sessions.
primarycta: "[Register on Eventbrite →](https://www.eventbrite.com/e/netlify-cms-planning-session-bi-weekly-tickets-35794058994)"

upcomingevent:
hook: The next development planning session is on

howitworks: Every other week we have public development planning sessions. They're web based, last about an hour, and are geared toward contributors and those interested in contributing. Sessions currently take place every other Wednesday, 9am - 10am PT.

howtojoin: |
**On the web:**
1. https://bluejeans.com/278173690
**By phone:**
1. [+1.408.740.7256](tel:+14087407256) (United States)
[+1.408.317.9253](tel:+14083179253) (Alternate number)
(http://bluejeans.com/numbers)
2. Enter Meeting ID: 278173690
---
Empty file added website/site/data/.keep
Empty file.
13 changes: 13 additions & 0 deletions website/site/data/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
styleoverrides: '/docs.css'
headline: Netlify builds, deploys, and hosts your front end.
bottomcta:
hook: Want to get started quick?
btns:
- type: primary
btntext: View our Templates
linksto: https://app.netlify.com/signup/templates
- type: secondary
btntext: Read our Tutorials
linksto: /tags/tutorial/
---
13 changes: 13 additions & 0 deletions website/site/data/global.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
footer:
hook: |
Host faster.</br>
Manage easier.</br>
Smile bigger.
headline: "Netlify is your one-stop web dev solution."
body: "Vestibulum rutrum quam vitae fringilla tincidunt. Suspendisse nec tortor urna. Ut laoreet sodales nisi, quis iaculis nulla iaculis vitae. Donec sagittis faucibu."
cta:
secondarycta:
copy: "Try it now FREE"
link: "/intro"
---
6 changes: 6 additions & 0 deletions website/site/data/header.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
notification:
hook: '**Active Ingredients Conf** _•_ San Francisco 4/28 _•_ Best Practices For the Modern Web'
cta: Tickets 20% off!
link: https://activeingredients.info/?utm_source=NB&amp;utm_medium=NB&amp;utm_campaign=NB
---
50 changes: 50 additions & 0 deletions website/site/data/landing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
hero:
headline: An open-source CMS for your Git workflow
subhead: |
- Content management in a single-page app
- Built in React.js with extensible components
- Integrate with any build tool
- Plug in to any static site generator
ctas: |
- [Take it for a test drive →](/docs/test-drive)
productvideo:
thumbnail: "/img/hero-graphic.jpg"
mp4: "/img/demo.mp4"
ogg: "/img/demo.ogg"
webm: "/img/demo.webm"

thanksdevs: "**Thanks to all our contributors.**Keep shooting for the stars with Netlify CMS."

collab:
hook: "Integrate the roles of developers, writers, and editors."
body: "Writers can focus on writing. Editors can approve content and publish with ease. Developers can use their favorite tools and libraries. **Netlify CMS keeps all of their contributions together, in Git.**"
graphicpath: "/img/collab.svg"

featureshook: "Designed with developers in mind - it’s in our DNA."

features:
- feature: "Fast, web-based UI"
description: "Built with React, featuring rich-text editing, real-time preview, and drag-and-drop media uploads."
- feature: "Platform agnostic"
description: "Works with most static site generators for sites stored in GitHub."
- feature: "Easy installation"
description: "Add two files to your site, include or link to the JS, and add your custom configuration."
- feature: "Modern authentication"
description: "Connect with Netflify's authentication service or roll your own, using GitHub and JSON web tokens."
- feature: "Flexible content types"
description: "Specify an unlimited number of content types with custom fields."
- feature: "Fully extensible"
description: "Create custom-styled previews, UI widgets, and editor plugins."

featuresgraphic: "/img/helix.svg"

inspiration: |
Netlify CMS is part of a long evolution in content management for the web. Even in the budding realm of the [JAMstack](https://www.jamstack.org) and [static site generators](https://www.staticgen.com), developers have a variety [“headless” CMS](http://www.headlesscms.org) options to choose from.
Proprietary services like Contentful and DatoCMS provide the ease and polish of a concierge provider, while simple open source projects like Prose and Google Drive CMS provide targeted functionality for limited use cases. We love that these other projects help advance the modern web, and we believe there will always be a place for them in the JAMstack ecosystem.
With Netlify CMS, we hope to carve a different niche. We aim to do for the JAMstack what WordPress did for dynamic sites back in the day. In other words, we want to build a CMS that is open-source but fully-featured and production-ready, that’s as easy to customize as it is to use, and that developers and content editors can build a community around.
[Help us make it happen!](/docs/contributor-guide)
---
16 changes: 16 additions & 0 deletions website/site/data/notifications.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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: true
title: Gitter shoutout
url: 'https://gitter.im/netlify/netlifycms'
Loading

0 comments on commit bfb8fc3

Please sign in to comment.