You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@petri.apache.org by gs...@apache.org on 2019/12/08 15:09:20 UTC
[petri-site] branch master updated: Add a simple bootstrap-based
theme.
This is an automated email from the ASF dual-hosted git repository.
gstein pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/petri-site.git
The following commit(s) were added to refs/heads/master by this push:
new 9b30a5a Add a simple bootstrap-based theme.
new 39e8347 Merge branch 'master' of https://github.com/apache/petri-site
9b30a5a is described below
commit 9b30a5a71b2a09ee2e47baa1a1ebbebc76a5184c
Author: Greg Stein <gs...@gmail.com>
AuthorDate: Sun Dec 8 09:03:35 2019 -0600
Add a simple bootstrap-based theme.
* use bootstrap, jquery, popper, and github-markdown-css
* add a draft top-navbar, and footer/copyright, based on the branding
guidelines for apache sites
* disable most skeleton pages: we don't use tags, categories, author
lists, a managed index, articles, or archives
* disable paths on the pages; stick to flat
* apache.css is loaded with recommendations from github-markdown-css
* use the feather for favicon and navbar icon, until petri decides on
its own logo
---
pelicanconf.py | 36 +++++++-----
theme/apache/static/css/apache.css | 17 ++++++
theme/apache/templates/base.html | 117 +++++++++++++++++++++++++++++++++++++
3 files changed, 155 insertions(+), 15 deletions(-)
diff --git a/pelicanconf.py b/pelicanconf.py
index ebf2604..4dd3864 100644
--- a/pelicanconf.py
+++ b/pelicanconf.py
@@ -20,20 +20,26 @@ DEFAULT_LANG = u'en'
SITEURL = 'https://petri.apache.org'
# Save pages using full directory preservation
-PATH_METADATA= '(?P<path_no_ext>.*)\..*'
-PAGE_SAVE_AS= '{path_no_ext}.html'
-PAGE_URL= '{path_no_ext}.html'
-
-# Standard behavior:
-#PAGE_SAVE_AS = './{slug}.html'
-
-ARTICLE_SAVE_AS = 'news/{slug}.html'
-ARTICLE_URL = 'news/{slug}.html'
-
-# Sort news by date, descending, latest article first
-ARTICLE_ORDER_BY = 'reversed-date'
-
-# Feed generation is usually not desired when developing
+PAGES_PATHS = [ 'content' ]
+#PATH_METADATA= '(?P<path_no_ext>.*)\..*'
+#PAGE_SAVE_AS= '{path_no_ext}.html'
+#PAGE_URL= '{path_no_ext}.html'
+SLUGIFY_SOURCE = 'basename'
+PAGE_SAVE_AS = '{slug}.html'
+
+# We don't use articles, but we don't want pelican to think
+# that content/ contains articles.
+ARTICLE_PATHS = [ 'articles' ]
+
+# Disable these pages
+ARCHIVES_SAVE_AS = ''
+ARTICLE_SAVE_AS = ''
+AUTHORS_SAVE_AS = ''
+CATEGORIES_SAVE_AS = ''
+INDEX_SAVE_AS = ''
+TAGS_SAVE_AS = ''
+
+# Disable feeds
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
@@ -42,7 +48,7 @@ AUTHOR_FEED_RSS = None
# TOC Generator
PLUGIN_PATHS = ['./theme/plugins']
-PLUGINS = ['toc']
+#PLUGINS = ['toc']
TOC_HEADERS = r"h[1-6]"
# Unused links
diff --git a/theme/apache/static/css/apache.css b/theme/apache/static/css/apache.css
new file mode 100644
index 0000000..e001070
--- /dev/null
+++ b/theme/apache/static/css/apache.css
@@ -0,0 +1,17 @@
+.markdown-body {
+ box-sizing: border-box;
+ min-width: 200px;
+ max-width: 980px;
+ margin: 0 auto;
+ padding: 45px;
+}
+
+@media (max-width: 767px) {
+ .markdown-body {
+ padding: 15px;
+ }
+}
+
+.footer {
+ border-top: 1px solid black;
+}
diff --git a/theme/apache/templates/base.html b/theme/apache/templates/base.html
new file mode 100644
index 0000000..f977df1
--- /dev/null
+++ b/theme/apache/templates/base.html
@@ -0,0 +1,117 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ {% block head %}
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width,
+ initial-scale=1, shrink-to-fit=no">
+ <link rel="shortcut icon" href="https://www.apache.org/favicons/favicon.ico">
+
+ <link rel="stylesheet"
+ href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
+ integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
+ crossorigin="anonymous">
+ <link rel="stylesheet"
+ href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/3.0.1/github-markdown.min.css"
+ >
+ <link rel="stylesheet" href="theme/css/apache.css">
+
+ {% endblock %}
+ </head>
+
+ <body id="index" class="home">
+ <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
+ <img src="https://www.apache.org/foundation/press/kit/feather.svg"
+ width="30" height="30" class="d-inline-block align-top"
+ alt="Apache">
+ <a class="navbar-brand" href="/">Apache Petri</a>
+ <button class="navbar-toggler" type="button"
+ data-toggle="collapse" data-target="#navbarSupportedContent"
+ aria-controls="navbarSupportedContent" aria-expanded="false"
+ aria-label="Toggle navigation">
+ <span class="navbar-toggler-icon"></span>
+ </button>
+
+ <div class="collapse navbar-collapse" id="navbarSupportedContent">
+ <ul class="navbar-nav mr-auto">
+ <li class="nav-item active">
+ <a class="nav-link" href="/">Home</a>
+ </li>
+ <li class="nav-item active">
+ <a class="nav-link" href="#">tbd-links</a>
+ </li>
+ </ul>
+ <div class="navbar-nav">
+ <div class="nav-item dropdown dropdown-menu-right active">
+ <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown"
+ role="button" data-toggle="dropdown" aria-haspopup="true"
+ aria-expanded="false">About</a>
+ <div class="dropdown-menu" aria-labelledby="navbarDropdown">
+ <a class="dropdown-item" href="https://www.apache.org/">Foundation</a>
+ <div class="dropdown-divider"></div>
+ <a class="dropdown-item"
+ href="https://www.apache.org/licenses/">License</a>
+ <a class="dropdown-item"
+ href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a>
+ <a class="dropdown-item"
+ href="https://www.apache.org/foundation/thanks.html">Thanks</a>
+ <div class="dropdown-divider"></div>
+ <a class="dropdown-item"
+ href="https://www.apache.org/security/">Security</a>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ </nav>
+
+ {% block content %}
+ {% endblock %}
+
+ <footer class="navbar-expand-lg navbar-light bg-light">
+ <div class="footer" id="footer">
+ <div class="row">
+ <div class="col-sm">
+ Apache info
+ <address id="about" class="vcard body">ASF</address>
+ </div>
+ <div class="col-sm">
+ <ul>
+ <li>link 1</li>
+ <li>link 2</li>
+ </ul>
+ </div>
+ <div class="col-sm">
+ <ul>
+ <li>link 3</li>
+ <li>link 4</li>
+ </ul>
+ </div>
+ </div>
+
+ <div class="container-fluid">
+ Copyright © 2019 The Apache Software Foundation,
+ Licensed under the
+ <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache
+ License, Version 2.0.</a>
+ <br/>
+ Apache and the Apache feather logo are trademarks of
+ <a href="https://www.apache.org/">The Apache Software Foundation.</a>
+ </div><!-- #container-fluid -->
+
+ </div>
+ </footer>
+
+ <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
+ integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
+ crossorigin="anonymous"></script>
+ <script
+ src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
+ integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
+ crossorigin="anonymous"></script>
+ <script
+ src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
+ integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
+ crossorigin="anonymous"></script>
+ </body>
+</html>