diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-11-26 15:50:41 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-11-26 15:50:41 +0100 |
| commit | 1ced465bf5275edcb3cea019e9f8605f274851d3 (patch) | |
| tree | bd7d49d8ee3f4eb106d2f149b61891dc4676c928 | |
| parent | 29f2105baa16a122211e58bd09e31077be4b610a (diff) | |
stub builder
| -rw-r--r-- | scraper/builder.py | 7 | ||||
| -rw-r--r-- | scraper/s2-citation-report.py | 2 | ||||
| -rw-r--r-- | templates/about.html | 4 | ||||
| -rw-r--r-- | templates/layout.html | 27 | ||||
| -rw-r--r-- | templates/paper.html | 4 | ||||
| -rw-r--r-- | templates/terms.html | 4 |
6 files changed, 48 insertions, 0 deletions
diff --git a/scraper/builder.py b/scraper/builder.py new file mode 100644 index 00000000..be8c35f8 --- /dev/null +++ b/scraper/builder.py @@ -0,0 +1,7 @@ +#!/usr/bin/python + +from jinja2 import Environment, PackageLoader, select_autoescape +env = Environment( + loader=FileSystemLoader('../templates'), + autoescape=select_autoescape(['html', 'xml']) +) diff --git a/scraper/s2-citation-report.py b/scraper/s2-citation-report.py index 3f8d2b52..526cf778 100644 --- a/scraper/s2-citation-report.py +++ b/scraper/s2-citation-report.py @@ -5,6 +5,7 @@ import simplejson as json import math import operator import click +import builder from util import * @click.command() @@ -253,6 +254,7 @@ def process_paper(fn, addresses, megapixels, success): f.write('</script>') f.write('<script src="../map.js"></script>') f.write("</html>") + # template = env.get_template('paper.html') return res def load_megapixels_queries(): diff --git a/templates/about.html b/templates/about.html new file mode 100644 index 00000000..6699bd0f --- /dev/null +++ b/templates/about.html @@ -0,0 +1,4 @@ +{% extends 'layout.html' %} + +{% block content %} +{% endblock %} diff --git a/templates/layout.html b/templates/layout.html new file mode 100644 index 00000000..67502257 --- /dev/null +++ b/templates/layout.html @@ -0,0 +1,27 @@ +<!doctype html> +<html> +<head> + <title>Megapixels</title> + <link rel='stylesheet' href='/assets/css/css.css' /> +</head> +<body> + <header> + <h1> + <div id="logo"></div> + Megapixels + <span class='sub'>The Darkside of Datasets</span> + </h1> + <div class='links'> + <a href="/search">Face Search</a> + <a href="/datasets">Datasets</a> + <a href="/blog">Blog</a> + <a href="/about">About</a> + </div> + </header> + {% block content %}{% endblock %} + <footer> + <a href="/about">How to use MegaPixels</a> + <a href="/pages/terms">Terms of Use & Privacy</a> + </footer> +</body> +</html>
\ No newline at end of file diff --git a/templates/paper.html b/templates/paper.html new file mode 100644 index 00000000..6699bd0f --- /dev/null +++ b/templates/paper.html @@ -0,0 +1,4 @@ +{% extends 'layout.html' %} + +{% block content %} +{% endblock %} diff --git a/templates/terms.html b/templates/terms.html new file mode 100644 index 00000000..6699bd0f --- /dev/null +++ b/templates/terms.html @@ -0,0 +1,4 @@ +{% extends 'layout.html' %} + +{% block content %} +{% endblock %} |
