Author: Matti Picus <[email protected]>
Branch: nikola
Changeset: r965:eb97b937d6e8
Date: 2019-12-29 08:25 +0200
http://bitbucket.org/pypy/pypy.org/changeset/eb97b937d6e8/

Log:    add pypy theme, without baguetteBox image gallery

diff --git a/conf.py b/conf.py
--- a/conf.py
+++ b/conf.py
@@ -160,7 +160,7 @@
 }
 
 # Name of the theme to use.
-THEME = 'base-jinja'
+THEME = 'pypy'
 
 # Primary color of your theme. This will be used to customize your theme.
 # Must be a HEX value.
@@ -355,6 +355,7 @@
 # If you want to hide the title of your website (for example, if your logo
 # already contains the text), set this to False.
 # SHOW_BLOG_TITLE = True
+SHOW_BLOG_TITLE = False
 
 # Paths for different autogenerated bits. These are combined with the
 # translation paths.
@@ -895,10 +896,11 @@
 # FAVICONS contains (name, file, size) tuples.
 # Used to create favicon link like this:
 # <link rel="name" href="file" sizes="size"/>
-# FAVICONS = (
+#FAVICONS = (
 #     ("icon", "/favicon.ico", "16x16"),
 #     ("icon", "/icon_128x128.png", "128x128"),
-# )
+#      ("shortcut icon", "/favicon.ico", "16x16"),
+#)
 
 # Show teasers (instead of full posts) in indexes? Defaults to False.
 # INDEX_TEASERS = False
@@ -1020,7 +1022,8 @@
 # This can be disabled on a per-page/post basis by adding
 #    .. pretty_url: False
 # to the metadata.
-PRETTY_URLS = True
+#PRETTY_URLS = False
+PRETTY_URLS = False
 
 # If True, publish future dated posts right away instead of scheduling them.
 # Defaults to False.
diff --git a/themes/pypy/bundles b/themes/pypy/bundles
new file mode 100644
--- /dev/null
+++ b/themes/pypy/bundles
@@ -0,0 +1,17 @@
+; css bundles
+assets/css/all.css=
+    rst_base.css,
+    nikola_rst.css,
+    code.css,
+    theme.css,
+assets/css/all-nocdn.css=
+    rst_base.css,
+    nikola_rst.css,
+    code.css,
+    theme.css,
+
+; javascript bundles
+assets/js/all.js=
+    fancydates.js,
+assets/js/all-nocdn.js=
+    fancydates.js,
diff --git a/themes/pypy/pypy.theme b/themes/pypy/pypy.theme
new file mode 100644
--- /dev/null
+++ b/themes/pypy/pypy.theme
@@ -0,0 +1,7 @@
+[Theme]
+engine = jinja
+parent = base-jinja
+
+[Nikola]
+ignored_assets = js/baguetteBox.min.js, css/baguetteBox.min.css, 
+
diff --git a/themes/pypy/templates/base_helper.tmpl 
b/themes/pypy/templates/base_helper.tmpl
new file mode 100644
--- /dev/null
+++ b/themes/pypy/templates/base_helper.tmpl
@@ -0,0 +1,121 @@
+{#  -*- coding: utf-8 -*- #}
+{% import 'feeds_translations_helper.tmpl' as feeds_translations with context 
%}
+
+{% macro html_headstart() %}
+<!DOCTYPE html>
+<html \
+    prefix='
+        og: http://ogp.me/ns# article: http://ogp.me/ns/article#
+        {% if comment_system == 'facebook' %}
+            fb: http://ogp.me/ns/fb#
+        {% endif %}
+    ' \
+    vocab="http://ogp.me/ns"; \
+{% if is_rtl %}
+    dir="rtl"
+{% endif %}
+
+lang="{{ lang }}">
+<head>
+    <meta charset="utf-8">
+    {% if description %}
+        <meta name="description" content="{{ description|e }}">
+    {% endif %}
+    <meta name="viewport" content="width=device-width">
+    {% if title == blog_title %}
+        <title>{{ blog_title|e }}</title>
+    {% else %}
+        <title>{{ title|e }} | {{ blog_title|e }}</title>
+    {% endif %}
+
+    {{ html_stylesheets() }}
+    <meta name="theme-color" content="{{ theme_color }}">
+    {% if meta_generator_tag %}
+        <meta name="generator" content="Nikola (getnikola.com)">
+    {% endif %}
+    {{ feeds_translations.head(classification=None, kind='index', other=False) 
}}
+    <link rel="canonical" href="{{ abs_link(permalink) }}">
+
+    {% if favicons %}
+        {% for name, file, size in favicons %}
+            <link rel="{{ name }}" href="{{ file }}" sizes="{{ size }}"/>
+        {% endfor %}
+    {% endif %}
+
+    {% if comment_system == 'facebook' %}
+        <meta property="fb:app_id" content="{{ comment_system_id }}">
+    {% endif %}
+
+    {% if prevlink %}
+        <link rel="prev" href="{{ prevlink }}" type="text/html">
+    {% endif %}
+    {% if nextlink %}
+        <link rel="next" href="{{ nextlink }}" type="text/html">
+    {% endif %}
+
+    {% if use_cdn %}
+        <!--[if lt IE 9]><script 
src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js";></script><![endif]-->
+    {% else %}
+        <!--[if lt IE 9]><script src="{{ url_replacer(permalink, 
'/assets/js/html5shiv-printshiv.min.js', lang, url_type) 
}}"></script><![endif]-->
+    {% endif %}
+
+    {{ extra_head_data }}
+{% endmacro %}
+
+{% macro late_load_js() %}
+    {% if use_bundles %}
+        {% if use_cdn %}
+            <script src="/assets/js/all.js"></script>
+        {% else %}
+            <script src="/assets/js/all-nocdn.js"></script>
+        {% endif %}
+    {% endif %}
+    {% if date_fanciness != 0 %}
+        {% if use_cdn %}
+            <script 
src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment-with-locales.min.js";
 crossorigin="anonymous"></script>
+        {% else %}
+            <script src="/assets/js/moment-with-locales.min.js"></script>
+        {% endif %}
+        {% if not use_bundles %}
+            <script src="/assets/js/fancydates.js"></script>
+        {% endif %}
+    {% endif %}
+    {{ social_buttons_code }}
+{% endmacro %}
+
+{% macro html_stylesheets() %}
+    {% if use_bundles %}
+        {% if use_cdn %}
+            <link href="/assets/css/all.css" rel="stylesheet" type="text/css">
+        {% else %}
+            <link href="/assets/css/all-nocdn.css" rel="stylesheet" 
type="text/css">
+        {% endif %}
+    {% else %}
+        <link href="/assets/css/rst_base.css" rel="stylesheet" type="text/css">
+        <link href="/assets/css/nikola_rst.css" rel="stylesheet" 
type="text/css">
+        <link href="/assets/css/code.css" rel="stylesheet" type="text/css">
+        <link href="/assets/css/theme.css" rel="stylesheet" type="text/css">
+        {% if has_custom_css %}
+            <link href="/assets/css/custom.css" rel="stylesheet" 
type="text/css">
+        {% endif %}
+    {% endif %}
+    {% if needs_ipython_css %}
+        <link href="/assets/css/ipython.min.css" rel="stylesheet" 
type="text/css">
+        <link href="/assets/css/nikola_ipython.css" rel="stylesheet" 
type="text/css">
+    {% endif %}
+{% endmacro %}
+
+{#  This function is deprecated; use feed_helper directly. #}
+{% macro html_feedlinks() %}
+    {{ feeds_translations.head(classification=None, kind='index', other=False) 
}}
+{% endmacro %}
+
+{% macro html_translations() %}
+    <ul class="translations">
+    {% for langname in translations|sort %}
+        {% if langname != lang %}
+            <li><a href="{{ abs_link(_link("root", None, langname)) }}" 
rel="alternate" hreflang="{{ langname }}">{{ messages("LANGUAGE", langname) 
}}</a></li>
+        {% endif %}
+    {% endfor %}
+    </ul>
+{% endmacro %}
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to