Commit 986e558a authored by Felix Delattre's avatar Felix Delattre
Browse files

start website with pelican stack

parents
*~
output/*
*.py[cod]
cache/
pelican.pid
node_modules/
yarn.lock
Pipfile
Pipfile.lock
package-lock.json
\ No newline at end of file
This diff is collapsed.
PY?=python3
PELICAN?=pelican
PELICANOPTS=
BASEDIR=$(CURDIR)
INPUTDIR=$(BASEDIR)/content
OUTPUTDIR=$(BASEDIR)/output
CONFFILE=$(BASEDIR)/pelicanconf.py
PUBLISHCONF=$(BASEDIR)/publishconf.py
DEBUG ?= 0
ifeq ($(DEBUG), 1)
PELICANOPTS += -D
endif
RELATIVE ?= 0
ifeq ($(RELATIVE), 1)
PELICANOPTS += --relative-urls
endif
help:
@echo 'Makefile for a pelican Web site '
@echo ' '
@echo 'Usage: '
@echo ' make html (re)generate the web site '
@echo ' make clean remove the generated files '
@echo ' make regenerate regenerate files upon modification '
@echo ' make publish generate using production settings '
@echo ' make serve [PORT=8000] serve site at http://localhost:8000'
@echo ' make serve-global [SERVER=0.0.0.0] serve (as root) to $(SERVER):80 '
@echo ' make devserver [PORT=8000] serve and regenerate together '
@echo ' make ssh_upload upload the web site via SSH '
@echo ' make rsync_upload upload the web site via rsync+ssh '
@echo ' '
@echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html '
@echo 'Set the RELATIVE variable to 1 to enable relative urls '
@echo ' '
html:
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
clean:
[ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
regenerate:
$(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
serve:
ifdef PORT
$(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT)
else
$(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
endif
serve-global:
ifdef SERVER
$(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT) -b $(SERVER)
else
$(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT) -b 0.0.0.0
endif
devserver:
ifdef PORT
$(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT)
else
$(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
endif
publish:
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
.PHONY: html help clean regenerate serve serve-global devserver stopserver publish
install:
@echo "Installing global Node dependencies..."
@yarn global add postcss-cli
@echo "Installing Node dependencies..."
@yarn install
@echo "Installing Python dependencies..."
@pipenv install -r requirements.txt
\ No newline at end of file
===========================
Website openbuildingmap.org
===========================
Web interface to visualize contents and data of the OpenBuildingMap system.
Requirements
------------
This is a `pelican <https://getpelican.com>`__ based website for the `openbuildingmap <https://salsa.debian.org/openbuildingmap-team>`__.
Copyright and copyleft
----------------------
Copyright (C) 2020
* Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
See the `LICENSE <./LICENSE>`__ for the full license text.
Impressum & Contact
###################
:save_as: impressum.html
Contakt
----------
Email: contact@dynamicexposure.org
V.i.S.d.P.
----------
|
| Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ
|
| Dr. Danijel Schorlemmer
| Helmholtzstraße 6
| 14467 Potsdam
|
| Phone: +49 331 288-1207
| Email: danijel.schorlemmer@gfz-potsdam.de
\ No newline at end of file
index
#####
a big data exposure model for the world
---------------------------------------
.. raw:: html
<div class="title-background"></div>
Global Dynamic Exposure is a building exposure model with the objective to rethink effective risk and post-disaster assessments of people and the built environments.
We combine traditional building stock exposure models with crowd-sourced and worldwide building information to produce a new state of the art high-resolution model. The data set is being updated and improved continuously.
Stay tuned! This is work in progress and we are going to publish maps and data here, soon.
credits
------------
.. raw:: html
<div class="title-background"></div>
The Global Dynamic Exposure is developed by the German Research Centre for Geosciences (GFZ Potsdam) and is supported by the Horizon 2020 project.
{
"name": "openbuildingmap-website",
"version": "0.0.1",
"description": "Website for the OpenBuildingMap.org",
"repository": {
"type": "git",
"url": "git+https://salsa.debian.org/openbuildingmap-team/website.git"
},
"author": "Felix Delattre",
"license": "AGPL-3.0",
"bugs": {
"url": "https://salsa.debian.org/openbuildingmap-team/website/-/issues"
},
"homepage": "http://openbuildingmap.org",
"dependencies": {
"cssnano": "^4.1.10",
"postcss": "^7.0.32",
"postcss-cssnext": "^3.1.0",
"postcss-import": "^12.0.1",
"postcss-preset-env": "^6.7.0"
},
"scripts": {
"build": "cp -r ./node_modules/foo ./static/vendor/"
}
}
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = 'Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ'
SITENAME = 'Global Dynamic Exposure'
SITEDESCRIPTION = 'a big data exposure model for the world'
SITEURL = 'http://global.dynamicexposure.org'
TIMEZONE = 'Europe/Berlin'
DEFAULT_LANG = 'en'
PATH = 'content'
THEME = 'theme'
# Suppress standard html files and feed generation; we keep it slick.
DIRECT_TEMPLATES = ['index']
FEED_ATOM = None
FEED_ALL_ATOM = None
PLUGINS = [
'pelican_webassets',
]
\ No newline at end of file
module.exports = {
plugins: [
require("postcss-import"),
require("postcss-cssnext"),
require("cssnano")({
preset: "default"
})
]
};
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
# If your site is available via HTTPS, make sure SITEURL begins with https://
SITEURL = ''
RELATIVE_URLS = False
DELETE_OUTPUT_DIRECTORY = True
# -*- coding: utf-8 -*-
import os
import shutil
import sys
import datetime
from invoke import task
from invoke.util import cd
from pelican.server import ComplexHTTPRequestHandler, RootedHTTPServer
CONFIG = {
# Local path configuration (can be absolute or relative to tasks.py)
'deploy_path': 'output',
# Port for `serve`
'port': 8000,
}
@task
def clean(c):
"""Remove generated files"""
if os.path.isdir(CONFIG['deploy_path']):
shutil.rmtree(CONFIG['deploy_path'])
os.makedirs(CONFIG['deploy_path'])
@task
def build(c):
"""Build local version of site"""
c.run('pelican -s pelicanconf.py')
@task
def rebuild(c):
"""`build` with the delete switch"""
c.run('pelican -d -s pelicanconf.py')
@task
def regenerate(c):
"""Automatically regenerate site upon file modification"""
c.run('pelican -r -s pelicanconf.py')
@task
def serve(c):
"""Serve site at http://localhost:8000/"""
class AddressReuseTCPServer(RootedHTTPServer):
allow_reuse_address = True
server = AddressReuseTCPServer(
CONFIG['deploy_path'],
('', CONFIG['port']),
ComplexHTTPRequestHandler)
sys.stderr.write('Serving on port {port} ...\n'.format(**CONFIG))
server.serve_forever()
@task
def reserve(c):
"""`build`, then `serve`"""
build(c)
serve(c)
@task
def preview(c):
"""Build production version of site"""
c.run('pelican -s publishconf.py')
@task
def publish(c):
"""Publish to production via rsync"""
c.run('pelican -s publishconf.py')
c.run(
'rsync --delete --exclude ".DS_Store" -pthrvz -c '
'{} {production}:{dest_path}'.format(
CONFIG['deploy_path'].rstrip('/') + '/',
**CONFIG))
/* quicksand-regular - latin */
@font-face {
font-family: 'Quicksand';
font-style: normal;
font-weight: 400;
src: local(''),
url('./fonts/quicksand-v21-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./fonts/quicksand-v21-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* quicksand-700 - latin */
@font-face {
font-family: 'Quicksand';
font-style: normal;
font-weight: 700;
src: local(''),
url('./fonts/quicksand-v21-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('../fonts/quicksand-v21-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* open-sans-regular - latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans Regular'), local('OpenSans-Regular'),
url('./fonts/open-sans-v17-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('../fonts/open-sans-v17-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* open-sans-700 - latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'),
url('./fonts/open-sans-v17-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('../fonts/open-sans-v17-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
\ No newline at end of file
html, body {
overflow-x: hidden;
}
body {
background-color: var(--base-color);
color: var(--font-color);
font-family: var(--font-family-common);
margin: 0;
}
a {
color: var(--link-color);
text-decoration: none;
}
.wrapper, main h2 {
max-width: var(--max-width);
margin: 0 auto;
}
main p {
max-width: var(--max-width);
margin: 15px auto;
}
.title-background {
background-color: var(--main-color);
height: 55px;
position: relative;
margin-top: -55px;
z-index: -1;
}
:root {
--font-family-common: 'Quicksand', sans-serif;
--font-family-content: 'Open Sans', sans-serif;
--main-color: #ab0000;
--secondary-color: #31363b;
--base-color: #fff;
--font-color: #000;
--font-color-secondary: #fff;
--link-color: #ab0000;
--max-width: 960px;
}
\ No newline at end of file
h2 {
background-color: var(--main-color);
color: var(--font-color-secondary);
padding: 1rem 5px;
font-size: 14px;
margin-top: 0;
}
#jumbotron {
height: 32rem;
}
.truncate {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
height: 100%;
}
main .section {
margin-bottom: 50px;
}
\ No newline at end of file
footer {
background-color: var(--secondary-color);
margin: 0;
}
footer, footer a {
color: var(--font-color-secondary);
}
footer ul {
list-style-type: none;
bottom: 10px;
right: 10px;
text-align: right;
padding-top: 120px;
padding-bottom: 30px;
margin: 0;
}
\ No newline at end of file
header {
height: 80px;
}
header #logo {
float: left;
margin-top: 10px;
}
header #logo img {
float: left;
height: 48px;
width: 48px;
}
header nav {
float: right;
margin-top: 18px;
}
header nav ul {
list-style-type: none;
}
header nav ul li {
float: left;
padding: 0 10px;
}
header a {
color: var(--font-color);
font-weight: bold;
}
header nav ul li {
border-right: 1px solid #bbb;
}
header nav ul li:last-child {
border-right: none;
}
header #logo h1 {
margin-left: 55px;
margin-top: 13px;
font-size: 24px;
}
\ No newline at end of file
@import "./_fonts.css";
@import "./_settings.css";
@import "./_reset.css";
@import "./components/_header.css";
@import "./components/_content.css";
@import "./components/_footer.css";
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment