You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apex.apache.org by an...@apache.org on 2015/09/06 04:59:01 UTC

[2/4] incubator-apex-site git commit: initial gulp config, added pages, dependencies

initial gulp config, added pages, dependencies


Project: http://git-wip-us.apache.org/repos/asf/incubator-apex-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-apex-site/commit/e842cc0c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-apex-site/tree/e842cc0c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-apex-site/diff/e842cc0c

Branch: refs/heads/master
Commit: e842cc0ca449e8390574ee1c3f2580a289487e5a
Parents: 7934148
Author: Andy Perlitch <an...@gmail.com>
Authored: Fri Sep 4 18:53:05 2015 -0700
Committer: Andy Perlitch <an...@gmail.com>
Committed: Fri Sep 4 18:53:05 2015 -0700

----------------------------------------------------------------------
 .gitignore                     |  2 ++
 .jshintrc                      |  3 ++
 README.md                      | 44 ++++++++++++++++++++++++++++
 bower.json                     |  5 +++-
 gulpfile.js                    | 57 +++++++++++++++++++++++++++++++++++++
 package.json                   |  8 +++++-
 src/pages/community.html       |  5 ++++
 src/pages/docs.html            |  5 ++++
 src/pages/index.html           | 12 ++++++++
 src/partials/footer.handlebars | 17 +++++++++++
 src/partials/header.handlebars | 33 +++++++++++++++++++++
 11 files changed, 189 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-apex-site/blob/e842cc0c/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a088b6f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+node_modules
+bower_components

http://git-wip-us.apache.org/repos/asf/incubator-apex-site/blob/e842cc0c/.jshintrc
----------------------------------------------------------------------
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..6cf513e
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,3 @@
+{
+  "node": true
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-apex-site/blob/e842cc0c/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..fcc3f4b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,44 @@
+Apache Apex Incubator Website
+=============================
+
+This is the source code for the Apache Apex Incubator website, hosted at [apex.incubator.apache.org](http://apex.incubator.apache.org/).
+
+
+How it works
+------------
+The master branch of this repo contains the files that are used to generate the HTML that ultimately gets pushed to the incubator site.
+The `asf-site` branch is where the actual generated files are stored. 
+Through a [gitpubsub](http://www.apache.org/dev/gitpubsub.html) mechanism, files are taken from the `asf-branch` and pushed to the live server.
+
+Partials
+--------
+All pages on the site share the same header and footer. These are stored in the `src/partials` folder.
+
+Pages
+-----
+Pages are stored in the `src/pages` folder. Each page should look something like this:
+
+```HTML
+{{> header}}
+
+<h1>Hello World</h1>
+<p>I am a page.</p>
+
+{{> footer}}
+```
+
+## Markdown files
+
+If you have a block of content that you would like to render as markdown, you can do so by creating a `.md` file in the `src/md/` folder.
+These will be picked up, rendered has html, and passed into your page templates as partials. 
+Assuming you have a file called `src/md/example_markdown.md`, you could have this in a page template:
+
+```HTML
+{{> header}}
+
+<h1>Page with Injected Markdown</h1>
+
+{{> example_markdown}}
+
+{{> footer}}
+```
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-apex-site/blob/e842cc0c/bower.json
----------------------------------------------------------------------
diff --git a/bower.json b/bower.json
index ee37d07..14994b8 100644
--- a/bower.json
+++ b/bower.json
@@ -21,5 +21,8 @@
     "bower_components",
     "test",
     "tests"
-  ]
+  ],
+  "dependencies": {
+    "bootstrap": "~3.3.5"
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-apex-site/blob/e842cc0c/gulpfile.js
----------------------------------------------------------------------
diff --git a/gulpfile.js b/gulpfile.js
new file mode 100644
index 0000000..b7b1639
--- /dev/null
+++ b/gulpfile.js
@@ -0,0 +1,57 @@
+'use strict';
+
+// Node Modules
+var gulp = require('gulp');
+var marked = require('gulp-marked');
+var handlebars = require('gulp-compile-handlebars');
+
+// Constants
+var TEMP_PARTIAL_LOCATION = './.tmp/partials/';
+var BUILD_LOCATION = './content';
+
+// Converts files in src/md into html files in .tmp/partials
+gulp.task('md2html', function() {
+  return gulp.src('./src/md/*.md')
+    .pipe(marked())
+    .pipe(gulp.dest(TEMP_PARTIAL_LOCATION));
+});
+
+// Builds html files from src/pages
+gulp.task('html', ['md2html'], function() {
+
+  // Get partials from src and temp partials locations.
+  // Temp partials are rendered md files
+  var options = {
+    batch: ['./src/partials', TEMP_PARTIAL_LOCATION]
+  };
+
+
+  // Passed into every template for interpolation
+  var templateData = {
+
+    // Nav elements
+    nav: [
+      { id: 'index', label: 'Home', href: '/' },
+      { id: 'community', label: 'Community', href: '/community.html' },
+      { id: 'docs', label: 'Docs', href: '/docs.html' },
+      { id: 'github', label: 'Github', items: [
+        { label: 'Apex Core', href: 'https://github.com/apache/incubator-apex-core' },
+        { label: 'Apex Malhar', href: 'https://github.com/apache/incubator-apex-malhar' }
+      ] },
+      { id: 'apache', label: 'Apache', items: [
+        { label: 'Status Page', href: 'http://incubator.apache.org/projects/apex.html' },
+        { label: 'Apache Foundation', href: 'http://www.apache.org/foundation/how-it-works.html' },
+        { label: 'Apache License', href: 'http://www.apache.org/licenses/' },
+        { label: 'Sponsorship', href: 'http://www.apache.org/foundation/sponsorship.html' },
+        { label: 'Thanks', href: 'http://www.apache.org/foundation/thanks.html' }
+      ]}
+    ]
+
+  };
+
+  // Render the files in pages
+  gulp.src('./src/pages/*.html')
+    .pipe(handlebars(templateData, options))
+    .pipe(gulp.dest(BUILD_LOCATION));
+
+});

http://git-wip-us.apache.org/repos/asf/incubator-apex-site/blob/e842cc0c/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 9c14c6a..edf53fb 100644
--- a/package.json
+++ b/package.json
@@ -19,5 +19,11 @@
     "website"
   ],
   "author": "Andy Perlitch <an...@datatorrent.com>",
-  "license": "Apache-2.0"
+  "license": "Apache-2.0",
+  "dependencies": {
+    "gulp": "^3.9.0",
+    "gulp-compile-handlebars": "^0.5.0",
+    "gulp-marked": "^1.0.0",
+    "handlebars": "^4.0.2"
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-apex-site/blob/e842cc0c/src/pages/community.html
----------------------------------------------------------------------
diff --git a/src/pages/community.html b/src/pages/community.html
new file mode 100644
index 0000000..df5b817
--- /dev/null
+++ b/src/pages/community.html
@@ -0,0 +1,5 @@
+{{> header}}
+
+Community
+
+{{> footer}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-apex-site/blob/e842cc0c/src/pages/docs.html
----------------------------------------------------------------------
diff --git a/src/pages/docs.html b/src/pages/docs.html
new file mode 100644
index 0000000..ef1eead
--- /dev/null
+++ b/src/pages/docs.html
@@ -0,0 +1,5 @@
+{{> header}}
+
+Documentation coming soon!
+
+{{> footer}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-apex-site/blob/e842cc0c/src/pages/index.html
----------------------------------------------------------------------
diff --git a/src/pages/index.html b/src/pages/index.html
new file mode 100644
index 0000000..220b66b
--- /dev/null
+++ b/src/pages/index.html
@@ -0,0 +1,12 @@
+{{> header}}
+
+<!-- Main jumbotron for a primary marketing message or call to action -->
+<div class="jumbotron">
+  <div class="container">
+    <h1>Hello, world!</h1>
+    <p>This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
+    <p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more »</a></p>
+  </div>
+</div>
+
+{{> footer}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-apex-site/blob/e842cc0c/src/partials/footer.handlebars
----------------------------------------------------------------------
diff --git a/src/partials/footer.handlebars b/src/partials/footer.handlebars
new file mode 100644
index 0000000..8f4cf7a
--- /dev/null
+++ b/src/partials/footer.handlebars
@@ -0,0 +1,17 @@
+      <hr>
+
+      <footer>
+        <p>© Company 2014</p>
+      </footer>
+    </div> <!-- /container -->
+
+
+    <!-- Bootstrap core JavaScript
+    ================================================== -->
+    <!-- Placed at the end of the document so the pages load faster -->
+    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
+    <script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery.min.js"><\/script>')</script>
+    <script src="../../dist/js/bootstrap.min.js"></script>
+  
+
+</body></html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-apex-site/blob/e842cc0c/src/partials/header.handlebars
----------------------------------------------------------------------
diff --git a/src/partials/header.handlebars b/src/partials/header.handlebars
new file mode 100644
index 0000000..37f0ff9
--- /dev/null
+++ b/src/partials/header.handlebars
@@ -0,0 +1,33 @@
+<html lang="en"><head>
+    
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
+    <meta name="description" content="Apex is an enterprise grade native YARN big data-in-motion platform that unifies stream processing as well as batch processing.">
+    <meta name="author" content="Apache Software Foundation">
+    <link rel="icon" href="favicon.ico">
+
+    <title>Apache Apex (Incubating)</title>
+
+    <!-- Main Stylesheet -->
+    <link href="css/main.css" rel="stylesheet">
+
+  </head>
+
+  <body>
+
+    <nav class="navbar navbar-inverse navbar-static-top">
+      <a class="navbar-brand" href="#">Apache Apex <small>(incubating)</small></a>
+      <ul class="nav nav-pills">
+        <li class="nav-item">
+          <a class="nav-link" href="community.html">Community</a>
+        </li>
+        <li class="nav-item">
+          <a class="nav-link" href="#">About</a>
+        </li>
+        <li class="nav-item">
+          <a class="nav-link" href="#">Contact</a>
+        </li>
+      </ul>
+    </nav>
\ No newline at end of file