Skip to content

Commit b0392fd

Browse files
committed
Setup build process for summit site
1 parent 8c8d615 commit b0392fd

19 files changed

+193
-12
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ _site
1212
*.sublime-*
1313
_data/versions
1414
.bundle
15+
summit/dist

_config.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ safe: false
66
#permalink: /news/:year/:month/:day/:title.html
77

88
exclude: ["node_modules", "scripts", "sass", "app.yaml", "README.md",
9-
"CONTRIBUTING.md", "Gruntfile.js", "package.json", "config.rb"]
9+
"CONTRIBUTING.md", "Gruntfile.js", "package.json", "config.rb",
10+
"summit/app", "summit/node_modules", "summit/bower.json", "summit/gulpfile.js", "summit/package.json", "summit/README.md"]
1011

1112
kramdown:
1213
toc_levels: 2..3
@@ -23,7 +24,7 @@ project_title: Polymer
2324
project_status: 'Dev preview'
2425
# TODO: add version global for new, 1.0 docs.
2526
latest_version: 0.5.6 # version global used in 0.5 docs.
26-
default_version: 1.0 # default homepage version the docs should serve
27+
default_version: 1.0 # default homepage version the docs should serve
2728
legacy_version: 0.5 # version for legacy versionless URLs
2829

2930
versions:

app.yaml

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
application: polymer-project
2-
version: summit-rc2
2+
version: summit-rc4
33
runtime: python27
44
api_version: 1
55
threadsafe: yes
@@ -121,8 +121,13 @@ handlers:
121121
# Special exception for the summit site so it doesn't require
122122
# a trailing slash
123123
- url: /summit
124-
static_files: _site/summit/index.html
125-
upload: _site/summit/index.html
124+
static_files: _site/summit/dist/index.html
125+
upload: _site/summit/dist/index.html
126+
secure: always
127+
128+
- url: /summit/(.*)
129+
static_files: _site/summit/dist/\1
130+
upload: _site/summit/dist/(.*)
126131
secure: always
127132

128133
# All other URLs map directly to their path in _site/.
@@ -158,6 +163,9 @@ skip_files:
158163
- ^sass$
159164
- ^scripts$
160165

166+
# Summit source
167+
- ^summit\/app$
168+
161169
- ^(\d.\d(.\d)?)$ # Exclude version dirs. They're in _site/.
162170

163171
# few extras to reduce number of files uploaded.

summit/.bowerrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "app/bower_components"
3+
}

summit/README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Summit
2+
3+
## Setup
4+
5+
Build the summit site
6+
7+
```
8+
cd summit
9+
npm install && bower install
10+
gulp
11+
```
12+
13+
Then start the local server
14+
15+
```
16+
cd ..
17+
grunt docs
18+
grunt
19+
```
20+
21+
Then preview at localhost:3000/summit
22+
23+
## Deploying
24+
25+
Follow the above steps to build the summit site.
26+
Update the version in `app.yaml` and deploy the entire Polymer site
27+
as usual.

summit/app/elements.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<link rel="import" href="bower_components/paper-button/paper-button.html">
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

summit/index.html summit/app/index.html

+39-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838

3939
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto+Mono:400,400italic,500,500italic,700,700italic|Roboto:400,400italic,500,500italic,700,700italic">
4040
<link rel="stylesheet" href="/summit/styles/main.css">
41-
41+
<script src="/summit/scripts/webcomponents-lite.min.js" charset="utf-8"></script>
42+
<link rel="import" href="/summit/elements.html">
4243
</head>
4344
<body>
4445

@@ -58,10 +59,15 @@
5859
<section class="main center">
5960
<div class="main-desc">Join us for an evening of breakout sessions and code labs, followed by an all-day summit of Polymer tech talks and an after hours event.</div>
6061
<div class="main-desc2"><span class="strong">Tickets are free</span>. Sign up to secure your spot!</div>
61-
<a class="register-btn" href="">Register</a>
62+
<a href="https://polymer.eventfarm.com/tokens/sessionAllocate?tr=3YVJybmZPZgxcU3ID2X7srlqBBaJUDso2Nx0pjqEJ7Bmr4vvwS2pJN" target="_blank" data-outbound="register">
63+
<paper-button raised noink class="register-btn" tabindex="-1">
64+
Register
65+
</paper-button>
66+
</a>
6267
</section>
6368

64-
<a class="amsterdam center middle" target="_blank" href="https://www.google.com/maps/place/Muziekgebouw+aan+'t+IJ/@52.3783041,4.9131203,15z/data=!4m2!3m1!1s0x0:0x84b02f41a342e459">
69+
<a class="amsterdam center middle" target="_blank" href="https://www.google.com/maps/place/Muziekgebouw+aan+'t+IJ/@52.3783041,4.9131203,15z/data=!4m2!3m1!1s0x0:0x84b02f41a342e459"
70+
data-outbound="image-map">
6571
<div class="parallax">
6672
<div class="bg"></div>
6773
<div class="scrim"></div>
@@ -77,9 +83,37 @@
7783
</a>
7884

7985
<footer class="center-horiz middle">
80-
<a href="https://www.polymer-project.org" target="_blank">About Polymer</a>
81-
<a href="http://polymer.github.io/LICENSE.txt" target="_blank">&copy; 2015 Polymer Authors</a>
86+
<a href="https://www.polymer-project.org" target="_blank" data-outbound="about-polymer">About Polymer</a>
87+
<a href="http://polymer.github.io/LICENSE.txt" target="_blank" data-outbound="license-txt">&copy; 2015 Polymer Authors</a>
8288
</footer>
8389

90+
<script>
91+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
92+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
93+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
94+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
95+
96+
ga('create', 'UA-39334307-11', 'auto');
97+
ga('send', 'pageview');
98+
99+
// Track outbound links
100+
var anchors = Array.prototype.slice.call(
101+
document.querySelectorAll('a[data-outbound]')
102+
);
103+
anchors.forEach(function(anchor) {
104+
anchor.addEventListener('click', function(e) {
105+
e.preventDefault();
106+
var url = anchor.href;
107+
var label = anchor.getAttribute('data-outbound');
108+
label = label || '';
109+
ga('send', 'event', 'outbound', 'click', label, {'hitCallback':
110+
function () {
111+
document.location = url;
112+
}
113+
});
114+
});
115+
});
116+
</script>
117+
84118
</body>
85119
</html>

summit/styles/main.css summit/app/styles/main.css

-2
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,8 @@ a {
167167

168168
.register-btn {
169169
display: inline-block;
170-
padding: 10px 20px;
171170
margin: 0;
172171
background-color: #F9518C;
173-
border-radius: 2px;
174172
color: #fff;
175173
box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.12);
176174
-webkit-transition: box-shadow 0.18s;

summit/bower.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "summit",
3+
"version": "0.0.0",
4+
"ignore": [
5+
"**/.*",
6+
"node_modules",
7+
"bower_components",
8+
"test",
9+
"tests"
10+
],
11+
"dependencies": {
12+
"paper-elements": "PolymerElements/paper-elements#~1.0.2"
13+
}
14+
}

summit/gulpfile.js

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*
2+
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6+
Code distributed by Google as part of the polymer project is also
7+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8+
*/
9+
10+
'use strict';
11+
12+
// Include Gulp & Tools We'll Use
13+
var gulp = require('gulp');
14+
var $ = require('gulp-load-plugins')();
15+
var del = require('del');
16+
17+
var AUTOPREFIXER_BROWSERS = [
18+
'ie >= 10',
19+
'ie_mob >= 10',
20+
'ff >= 30',
21+
'chrome >= 34',
22+
'safari >= 7',
23+
'opera >= 23',
24+
'ios >= 7',
25+
'android >= 4.4',
26+
'bb >= 10'
27+
];
28+
29+
// Autoprefix and minify CSS
30+
gulp.task('styles', ['clean'], function() {
31+
return gulp.src('app/styles/**/*.css')
32+
.pipe($.autoprefixer(AUTOPREFIXER_BROWSERS))
33+
.pipe($.cssmin())
34+
.pipe(gulp.dest('dist/styles'));
35+
});
36+
37+
// Optimize Images
38+
gulp.task('images', ['clean'], function () {
39+
return gulp.src('app/images/**/*')
40+
.pipe($.imagemin({
41+
progressive: true,
42+
interlaced: true
43+
}))
44+
.pipe(gulp.dest('dist/images'));
45+
});
46+
47+
// Minify html
48+
gulp.task('html', ['clean'], function() {
49+
return gulp.src('app/index.html')
50+
.pipe($.minifyHtml({
51+
quotes: true,
52+
empty: true,
53+
spare: true
54+
}))
55+
.pipe(gulp.dest('dist'))
56+
});
57+
58+
// Vulcanize
59+
gulp.task('vulcanize', ['clean'], function () {
60+
return gulp.src('app/elements.html')
61+
.pipe($.vulcanize({
62+
stripComments: true,
63+
inlineCss: true,
64+
inlineScripts: true
65+
}))
66+
.pipe(gulp.dest('dist'));
67+
});
68+
69+
// Copy over polyfills
70+
gulp.task('copy', ['clean'], function() {
71+
return gulp.src('app/bower_components/webcomponentsjs/webcomponents-lite.min.js')
72+
.pipe(gulp.dest('dist/scripts'))
73+
});
74+
75+
// Clean Output Directory
76+
gulp.task('clean', del.bind(null, ['dist']));
77+
78+
// Default task, build dist dir
79+
gulp.task('default', ['styles', 'images', 'html', 'vulcanize', 'copy']);

summit/package.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "summit",
3+
"version": "1.0.0",
4+
"description": "",
5+
"devDependencies": {
6+
"del": "^1.2.0",
7+
"gulp": "^3.9.0",
8+
"gulp-autoprefixer": "^2.3.1",
9+
"gulp-cssmin": "^0.1.7",
10+
"gulp-imagemin": "^2.3.0",
11+
"gulp-load-plugins": "^1.0.0-rc.1",
12+
"gulp-minify-html": "^1.0.4",
13+
"gulp-vulcanize": "^6.0.1"
14+
}
15+
}

0 commit comments

Comments
 (0)