Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace custom gulp build script with Jekyll #38

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Move to jekyll build WIP
keanulee committed Dec 14, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 2eedfbffd3e23b4ae63b369688800e1845a7d949
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.DS_STORE
/app/_site/
*.pyc

# Generated files/folders
*.pyc
52 changes: 18 additions & 34 deletions app/404.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,19 @@
<!--
@license
Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<!DOCTYPE html>
<html itemscope itemtype="http://schema.org/Organization" lang="en">
<head>
<title>404 - Polymer Project</title>
{% include 'templates/head-meta.html' %}
</head>
<body>
{% include 'templates/topnav.html' %}
---
layout: default
title: 404
permalink: /404.html
---
{% include topnav.html %}

<main class="wrapper">
<article>
<h1>Page not found</h1>
<p>Can't find the page you're looking for.
<ul>
<li><a href="https://github.com/Polymer/polymer-project.org/issues/new">Report an issue.</a></li>
<li><a href="/">Return to the home page.</a></li>
<li><a href="/blog/">Read the blog.</a></li>
</ul>
</p>
</article>
</main>

{% include 'templates/footer.html' %}
<script src="/js/app.js"></script>
</body>
</html>
<main class="wrapper">
<article>
<h1>Page not found</h1>
<p>Can't find the page you're looking for.
<ul>
<li><a href="https://github.com/Polymer/polymer-project.org/issues/new">Report an issue.</a></li>
<li><a href="/">Return to the home page.</a></li>
<li><a href="/blog/">Read the blog.</a></li>
</ul>
</p>
</article>
</main>
38 changes: 11 additions & 27 deletions app/500.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,12 @@
<!--
@license
Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<!DOCTYPE html>
<html itemscope itemtype="http://schema.org/Organization" lang="en">
<head>
<title>500 - Polymer Project</title>
{% include 'templates/head-meta.html' %}
</head>
<body>
{% include 'templates/topnav.html' %}
---
layout: default
title: 500
permalink: /500.html
---
{% include topnav.html %}

<main class="wrapper">
<article>
<h1>Server error</h1>
</article>
</main>

{% include 'templates/footer.html' %}
<script src="/js/app.js"></script>
</body>
</html>
<main class="wrapper">
<article>
<h1>Server error</h1>
</article>
</main>
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.
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Polymer Summit 2017 Speaker Spotlight: Chad Killingsworth, Jack Henry & Associates
title: "Polymer Summit 2017 Speaker Spotlight: Chad Killingsworth, Jack Henry & Associates"
---

Chad builds modern online banking experiences with Polymer. We chatted about componentized web app development and the importance of powerful theming capabilities.
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.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
layout: post
title: "Polymer @ Google I/O 2018"
---

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
layout: post
title: "Polymer Elements 3.0 FAQ"
---
If you've started updating your application to use the recently released 3.0 version
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
layout: post
title: "Web Components v0 deprecations"
---

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
layout: post
title: "Latest releases from the Polymer Project"
---

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
layout: post
title: "lit-html 1.0 release candidate"
---

File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions app/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
permalink: /:title/
name: Polymer Project
description: Open-source libraries, tools, and patterns to help developers build modern web applications
markdown: kramdown
kramdown:
parse_block_html: true
google_analytics: UA-39334307-1
collections:
blog:
output: true
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions app/_includes/analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script async src="https://www.googletagmanager.com/gtag/js?id={{site.google_analytics}}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{site.google_analytics}}');
</script>
10 changes: 10 additions & 0 deletions app/_includes/topnav.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<nav class="main-nav" markdown="0">
<a class="nav-title" href="{{ site.baseurl }}/">{{ site.name }}</a>
<div class="flex"></div>
<a class="nav-item" href="{{ site.baseurl }}/blog/">Blog</a>
<a class="icon-github" href="https://github.com/polymer" title="GitHub">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentcolor">
<path d="M12,2C6.48,2,2,6.59,2,12.25c0,4.53,2.87,8.37,6.84,9.73c0.5,0.09,0.68-0.22,0.68-0.49c0-0.24-0.01-0.89-0.01-1.74c-2.78,0.62-3.37-1.37-3.37-1.37c-0.45-1.18-1.11-1.5-1.11-1.5c-0.91-0.64,0.07-0.62,0.07-0.62c1,0.07,1.53,1.06,1.53,1.06c0.89,1.57,2.34,1.11,2.91,0.85c0.09-0.66,0.35-1.11,0.63-1.37c-2.22-0.26-4.56-1.14-4.56-5.07c0-1.12,0.39-2.03,1.03-2.75c-0.1-0.26-0.45-1.3,0.1-2.71c0,0,0.84-0.28,2.75,1.05c0.8-0.23,1.65-0.34,2.5-0.34c0.85,0,1.7,0.12,2.5,0.34c1.91-1.33,2.75-1.05,2.75-1.05c0.55,1.41,0.2,2.45,0.1,2.71c0.64,0.72,1.03,1.63,1.03,2.75c0,3.94-2.34,4.81-4.57,5.06c0.36,0.32,0.68,0.94,0.68,1.9c0,1.37-0.01,2.48-0.01,2.81c0,0.27,0.18,0.59,0.69,0.49c3.97-1.36,6.83-5.2,6.83-9.73C22,6.59,17.52,2,12,2"/>
</svg>
</a>
</nav>
40 changes: 40 additions & 0 deletions app/_layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<meta name="description" content="{{ site.description }}">
<title>{% if page.title %}{{ page.title }} &ndash;{% endif %} {{ site.name }}</title>
<meta name="theme-color" content="#FFFFFF">
<link rel="shortcut icon" href="{{site.baseurl}}/images/logos/p-logo-32.png">
<link rel="stylesheet" href="{{site.baseurl}}/css/main.css">
<link rel="stylesheet" href="{{site.baseurl}}/css/theme.css">
<link rel="stylesheet" href="{{site.baseurl}}/css/pygments.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Google+Sans:400,500">
{% if site.google_analytics %}
{% include analytics.html %}
{% endif %}
</head>
<body>
{{ content }}

<footer>
<div class="wrapper">
<div class="social-links">
<a target="_blank" href="https://github.com/Polymer" rel="noopener" aria-label="Github"><img src="/images/logos/logo_github.svg" /></a>
<a target="_blank" href="https://twitter.com/polymer" rel="noopener" aria-label="Twitter"><img src="/images/logos/logo_twitter.svg" /></a>
<a target="_blank" href="https://groups.google.com//forum/#!forum/polymer-dev" rel="noopener" aria-label="Email"><img src="/images/logos/logo_email.svg" /></a>
<a target="_blank" href="https://join.slack.com/t/polymer/shared_invite/enQtNTAzNzg3NjU4ODM4LTkzZGVlOGIxMmNiMjMzZDM1YzYyMzdiYTk0YjQyOWZhZTMwN2RlNjM5ZDFmZjMxZWRjMWViMDA1MjNiYWFhZWM" rel="noopener" aria-label="Slack"><img src="/images/logos/logo_slack.svg" /></a>
</div>
<div class="attribution">
Brought to you by <a href="https://www.polymer-project.org">The Polymer Project</a>.<br>
Copyright 2018 The Polymer Project Authors. Code licensed under the
<a target="_blank" href="http://polymer.github.io/LICENSE.txt">BSD License</a>.
Documentation licensed under CC BY 3.0.
</div>
</div>
</footer>


</body>
</html>
49 changes: 49 additions & 0 deletions app/_layouts/post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
layout: default
---
{% include topnav.html %}

<style>
#author {
text-align: center;
display: block;
}
time {
text-align: center;
margin-top: -24px;
margin-bottom: 40px;
}
#table-of-contents,
#table-of-contents + ul {
display: none;
}
#blog-content > * {
margin-left: auto;
margin-right: auto;
max-width: 720px;
}
iframe {
display: block;
}
h2 {
margin-top: 60px;
}
</style>

<main class="wrapper">
<article>

<a id="author" href="https://twitter.com/{{page.author.twitter}}" target="blank_">
<img class="author-img" src="{{page.author.profile_pic}}" alt="{{page.author.full_name}} profile pic" title="{{page.author.full_name}}">
</a>
<h1 class="center title">{{page.title}}</h1>
<h2 class="center description">{{page.description}}</h2>

<!-- <a id="author" href="{{page.author.web}}" target="blank_">by {{page.author.full_name}}</a> -->
<time pubdate="" datetime="{{page.published}}">{{page.published}}</time>

<div id="blog-content">
{{ content }}
</div>
</article>
</main>
92 changes: 92 additions & 0 deletions app/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
runtime: python27
api_version: 1
threadsafe: yes

libraries:
- name: jinja2
version: "2.6"
- name: webapp2
version: "2.5.2"

default_expiration: "1m"

handlers:
- url: /css
static_dir: css
secure: always

- url: /images
static_dir: images
secure: always

- url: /service-worker.js
static_files: service-worker.js
upload: service-worker.js
secure: always
expiration: "1s" # "0s" doesn't work

# Special exception for the summit site so it doesn't require
# a trailing slash
- url: /summit-2015
static_files: summit-2015/index.html
upload: summit-2015/index.html
secure: always

- url: /summit-2015/$
static_files: summit-2015/index.html
upload: summit-2015/index.html
secure: always

- url: /summit-2015/(schedule|speakers)
static_files: summit-2015/index.html
upload: summit-2015/index.html
secure: always

- url: /summit-2015/codelabs/$
static_files: summit-2015/codelabs.html
upload: summit-2015/codelabs.html
secure: always

- url: /summit-2015/codelabs$
static_files: summit-2015/codelabs.html
upload: summit-2015/codelabs.html
secure: always

- url: /summit-2015/(.*)
static_files: summit-2015/\1
upload: summit-2015/(.*)
secure: always

- url: /summit-2016
static_files: summit-2016/index.html
upload: summit-2016/index.html
secure: always

- url: /summit-2016/$
static_files: summit-2016/index.html
upload: summit-2016/index.html
secure: always

- url: /summit-2016/(schedule|speakers)
static_files: summit-2016/index.html
upload: summit-2016/index.html
secure: always

- url: /summit-2016/codelabs/$
static_files: summit-2016/codelabs.html
upload: summit-2016/codelabs.html
secure: always

- url: /summit-2016/codelabs$
static_files: summit-2016/codelabs.html
upload: summit-2016/codelabs.html
secure: always

- url: /summit-2016/(.*)
static_files: summit-2016/\1
upload: summit-2016/(.*)
secure: always

- url: /.*
script: main.app
secure: always
37 changes: 37 additions & 0 deletions app/blog.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
layout: default
---

{% include topnav.html %}

<header class="hero">
<div class="wrapper">
<div id="logo-lockup" class="hero-title">Blog</div>
<p class="hero-caption">The latest goings-on with the Polymer project and in the community.
We'll update this page to announce major releases and showcase cool stuff
being built with Polymer. Have an idea for an article?
<a href="https://github.com/Polymer/polymer-project.org/issues/new?labels=article">Suggest it!</a>
</p>
</div>
</header>

<div class="wrapper" style="margin-bottom: 80px;">
{% for item in site.data.blog %}
<div style="display: block; border-top: 1px solid #FF4470; margin-bottom: 16px;">
<div class="responsive-row" style="padding-top: 12px;">
<time pubdate="" datetime="{{item.published}}" style="flex: 1; margin-bottom: 4px;">{{item.published}}</time>
<div style="flex: 2;">
<h3 style="margin-bottom: 0px; margin-top: 0px;"><a href="{{item.path}}">{{item.title}}</a></h3>
<p style="margin: 0 0 10px 0; max-width: 560px;">{{item.description}}</p>
<a id="author" style="color: #999; font-weight: 500;" href="https://twitter.com/{{site.data.authors[item.author].twitter}}" target="blank_">
<img class="author-img small" src="{{site.data.authors[item.author].profile_pic}}" alt="{{site.data.authors[item.author].full_name}} profile pic" title="{{site.data.authors[item.author].full_name}}" />
{{site.data.authors[item.author].full_name}}
</a>
</div>
<div class="byline author">
</div>
</div>

</div>
{% endfor %}
</div>
57 changes: 0 additions & 57 deletions app/blog/index.html

This file was deleted.

61 changes: 61 additions & 0 deletions app/css/pygments.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #0099FF; font-style: italic } /* Comment */
.xhighlight .err { color: #AA0000; background-color: #FFAAAA } /* Error */
.highlight .k { color: #006699; font-weight: bold } /* Keyword */
.highlight .o { color: #555555 } /* Operator */
.highlight .cm { color: #0099FF; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #009999 } /* Comment.Preproc */
.highlight .c1 { color: #0099FF; font-style: italic } /* Comment.Single */
.highlight .cs { color: #0099FF; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { background-color: #FFCCCC; border: 1px solid #CC0000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #003300; font-weight: bold } /* Generic.Heading */
.highlight .gi { background-color: #CCFFCC; border: 1px solid #00CC00 } /* Generic.Inserted */
.highlight .go { color: #AAAAAA } /* Generic.Output */
.highlight .gp { color: #000099; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #003300; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #99CC66 } /* Generic.Traceback */
.highlight .kc { color: #006699; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #006699; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #006699; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #006699 } /* Keyword.Pseudo */
.highlight .kr { color: #006699; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #007788; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #FF6600 } /* Literal.Number */
.highlight .s { color: #CC3300 } /* Literal.String */
.highlight .na { color: #330099 } /* Name.Attribute */
.highlight .nb { color: #336666 } /* Name.Builtin */
.highlight .nc { color: #00AA88; font-weight: bold } /* Name.Class */
.highlight .no { color: #336600 } /* Name.Constant */
.highlight .nd { color: #9999FF } /* Name.Decorator */
.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #CC0000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #CC00FF } /* Name.Function */
.highlight .nl { color: #9999FF } /* Name.Label */
.highlight .nn { color: #00CCFF; font-weight: bold } /* Name.Namespace */
.highlight .nt { color: #330099; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #003333 } /* Name.Variable */
.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #FF6600 } /* Literal.Number.Float */
.highlight .mh { color: #FF6600 } /* Literal.Number.Hex */
.highlight .mi { color: #FF6600 } /* Literal.Number.Integer */
.highlight .mo { color: #FF6600 } /* Literal.Number.Oct */
.highlight .sb { color: #CC3300 } /* Literal.String.Backtick */
.highlight .sc { color: #CC3300 } /* Literal.String.Char */
.highlight .sd { color: #CC3300; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #CC3300 } /* Literal.String.Double */
.highlight .se { color: #CC3300; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #CC3300 } /* Literal.String.Heredoc */
.highlight .si { color: #AA0000 } /* Literal.String.Interpol */
.highlight .sx { color: #CC3300 } /* Literal.String.Other */
.highlight .sr { color: #33AAAA } /* Literal.String.Regex */
.highlight .s1 { color: #CC3300 } /* Literal.String.Single */
.highlight .ss { color: #FFCC33 } /* Literal.String.Symbol */
.highlight .bp { color: #336666 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #003333 } /* Name.Variable.Class */
.highlight .vg { color: #003333 } /* Name.Variable.Global */
.highlight .vi { color: #003333 } /* Name.Variable.Instance */
.highlight .il { color: #FF6600 } /* Literal.Number.Integer.Long */
430 changes: 206 additions & 224 deletions app/index.html

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import os
import jinja2
import webapp2

JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
extensions=['jinja2.ext.autoescape'],
autoescape=True)

# Match HTML pages from path; similar to behavior of Jekyll on GitHub Pages.
def find_template(path):
if path.endswith('/'):
# / -> /index.html, /try/ -> /try/index.html
return JINJA_ENVIRONMENT.get_template(path + 'index.html')
elif path.endswith('.html'):
# /index.html, /try/create.html
return JINJA_ENVIRONMENT.get_template(path)
try:
# /try/create -> /try/create.html
return JINJA_ENVIRONMENT.get_template(path + '.html')
except jinja2.exceptions.TemplateNotFound:
pass
# /try -> /try/index.html
return JINJA_ENVIRONMENT.get_template(path + '/index.html')

class MainPage(webapp2.RequestHandler):
def get(self):
try:
template = find_template(self.request.path)
self.response.headers['Cache-Control'] = 'public, max-age=60'
except jinja2.exceptions.TemplateNotFound:
template = find_template('/404.html')
self.response.set_status(404)
except Exception:
template = find_template('/500.html')
self.response.set_status(500)
self.response.write(template.render({}))

app = webapp2.WSGIApplication([
('/.*', MainPage),
])
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"private": true,
"scripts": {
"build": "gulp",
"serve": "dev_appserver.py dist/app.yaml",
"build": "cd app && jekyll build",
"serve": "dev_appserver.py app/_site/app.yaml",
"deploy": "npm run build && gcloud app deploy dist/app.yaml --project polymer-project --no-promote"
},
"devDependencies": {