Commit 6d228bd6 authored by Denis Salem's avatar Denis Salem
Browse files

Done with Pelican benchmark

parent b638637b
......@@ -178,6 +178,7 @@
DONE | Fix chapters rendering (only first level sub-chapter were rendered)
# version 2.1.x
TODO | Replace aside element by nav
TODO | Improve context / ressource naming for error management
TODO | Because of fully recursive pattern, some contextual variable are now useless, like {relative_origin}
TODO | SetBackgroundColor for text
......
{% extends "base.html" %}
{% block title %}{{ SITENAME }} - Archives{% endblock %}
{% block content %}
<h1>Archives for {{ SITENAME }}</h1>
<dl>
{% for article in dates %}
<dt>{{ article.locale_date }}</dt>
<dd><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd>
{% endfor %}
</dl>
{% endblock %}
{% extends "base.html" %}
{% block html_lang %}{{ article.lang }}{% endblock %}
{% block title %}{{ SITENAME }} - {{ article.title|striptags }}{% endblock %}
{% block head %}
{{ super() }}
{% import 'translations.html' as translations with context %}
{% if translations.entry_hreflang(article) %}
{{ translations.entry_hreflang(article) }}
{% endif %}
{% if article.description %}
<meta name="description" content="{{article.description}}" />
{% endif %}
{% for tag in article.tags %}
<meta name="tags" content="{{tag}}" />
{% endfor %}
{% endblock %}
{% block content %}
<section id="content" class="body">
<header>
<h2 class="entry-title">
<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark"
title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h2>
{% import 'translations.html' as translations with context %}
{{ translations.translations_for(article) }}
</header>
<footer class="post-info">
<time class="published" datetime="{{ article.date.isoformat() }}">
{{ article.locale_date }}
</time>
{% if article.modified %}
<time class="modified" datetime="{{ article.modified.isoformat() }}">
{{ article.locale_modified }}
</time>
{% endif %}
{% if article.authors %}
<address class="vcard author">
By {% for author in article.authors %}
<a class="url fn" href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a>
{% endfor %}
</address>
{% endif %}
{% if article.category %}
<div class="category">
Category: <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>
</div>
{% endif %}
{% if article.tags %}
<div class="tags">
Tags:
{% for tag in article.tags %}
<a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a>
{% endfor %}
</div>
{% endif %}
</footer><!-- /.post-info -->
<div class="entry-content">
{{ article.content }}
</div><!-- /.entry-content -->
</section>
{% endblock %}
{% extends "index.html" %}
{% block title %}{{ SITENAME }} - Articles by {{ author }}{% endblock %}
{% block content_title %}
<h2>Articles by {{ author }}</h2>
{% endblock %}
{% extends "base.html" %}
{% block title %}{{ SITENAME }} - Authors{% endblock %}
{% block content %}
<h1>Authors on {{ SITENAME }}</h1>
<ul>
{% for author, articles in authors|sort %}
<li><a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a> ({{ articles|count }})</li>
{% endfor %}
</ul>
{% endblock %}
<!DOCTYPE html>
<html>
<head>
{% block head %}
<title>{% block title %}{{ SITENAME }}{% endblock title %}</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
{% if FEED_ALL_ATOM %}
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Full Atom Feed" />
{% endif %}
{% if FEED_ALL_RSS %}
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Full RSS Feed" />
{% endif %}
{% if FEED_ATOM %}
<link href="{{ FEED_DOMAIN }}/{%if FEED_ATOM_URL %}{{ FEED_ATOM_URL }}{% else %}{{ FEED_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Atom Feed" />
{% endif %}
{% if FEED_RSS %}
<link href="{{ FEED_DOMAIN }}/{% if FEED_RSS_URL %}{{ FEED_RSS_URL }}{% else %}{{ FEED_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
{% endif %}
{% if CATEGORY_FEED_ATOM and category %}
<link href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_ATOM_URL %}{{ CATEGORY_FEED_ATOM_URL.format(slug=category.slug) }}{% else %}{{ CATEGORY_FEED_ATOM.format(slug=category.slug) }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Categories Atom Feed" />
{% endif %}
{% if CATEGORY_FEED_RSS and category %}
<link href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_RSS_URL %}{{ CATEGORY_FEED_RSS_URL.format(slug=category.slug) }}{% else %}{{ CATEGORY_FEED_RSS.format(slug=category.slug) }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Categories RSS Feed" />
{% endif %}
{% endblock head %}
</head>
<body id="index" class="home">
<header id="banner" class="body">
<h1>{{ SITENAME }}</h1>
</header><!-- /#banner -->
<nav>
<ul>
{% if DISPLAY_CATEGORIES_ON_MENU %}
{% for cat, null in categories %}
<li{% if cat == category %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat }}</a></li>
{% endfor %}
{% endif %}
</ul>
</nav><!-- /#menu -->
{% block content %}
{% endblock %}
<footer id="contentinfo" class="body">
{% block footer %}
{% endblock %}
</footer><!-- /#contentinfo -->
</body>
</html>
{% extends "base.html" %}
{% block title %}{{ SITENAME }} - Categories{% endblock %}
{% block content %}
<h1>Categories on {{ SITENAME }}</h1>
<ul>
{% for category, articles in categories|sort %}
<li><a href="{{ SITEURL }}/{{ category.url }}">{{ category }}</a> ({{ articles|count }})</li>
{% endfor %}
</ul>
{% endblock %}
{% extends "index.html" %}
{% block title %}{{ SITENAME }} - {{ category }} category{% endblock %}
{% block content_title %}
<h2>Articles in the {{ category }} category</h2>
{% endblock %}
{% if GOSQUARED_SITENAME %}
<script type="text/javascript">
var GoSquared={};
GoSquared.acct = "{{ GOSQUARED_SITENAME }}";
(function(w){
function gs(){
w._gstc_lt=+(new Date); var d=document;
var g = d.createElement("script"); g.type = "text/javascript"; g.async = true; g.src = "https://d1l6p2sc9645hc.cloudfront.net/tracker.js";
var s = d.getElementsByTagName("script")[0]; s.parentNode.insertBefore(g, s);
}
w.addEventListener?w.addEventListener("load",gs,false):w.attachEvent("onload",gs);
})(window);
</script>
{% endif %}
{% extends "base.html" %}
{% block content %}
<section id="content">
{% block content_title %}
{% endblock %}
{% for article in articles_page.object_list %}
<div class="hentry">
<h2 class="entry-title"><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></h2>
{{ article.content }} </div>
</div>
{% endfor %}
</section><!-- /#content -->
{% endblock content %}
{% block footer %}
{% if articles_page.has_other_pages() %}
{% include 'pagination.html' %}
{% endif %}
{%endblock footer %}
{% extends "base.html" %}
{% block html_lang %}{{ page.lang }}{% endblock %}
{% block title %}{{ SITENAME }} - {{ page.title|striptags }}{%endblock%}
{% block head %}
{{ super() }}
{% import 'translations.html' as translations with context %}
{% if translations.entry_hreflang(page) %}
{{ translations.entry_hreflang(page) }}
{% endif %}
{% endblock %}
{% block content %}
<h1>{{ page.title }}</h1>
{% import 'translations.html' as translations with context %}
{{ translations.translations_for(page) }}
{{ page.content }}
{% if page.modified %}
<p>
Last updated: {{ page.locale_modified }}
</p>
{% endif %}
{% endblock %}
{% if DEFAULT_PAGINATION %}
{% set first_page = articles_paginator.page(1) %}
{% set last_page = articles_paginator.page(articles_paginator.num_pages) %}
<p class="paginator">
{% if articles_page.has_previous() %}
<a href="{{ SITEURL }}/{{ first_page.url }}">&#8647;</a>
<a href="{{ SITEURL }}/{{ articles_previous_page.url }}">&laquo;</a>
{% endif %}
Page {{ articles_page.number }} / {{ articles_paginator.num_pages }}
{% if articles_page.has_next() %}
<a href="{{ SITEURL }}/{{ articles_next_page.url }}">&raquo;</a>
<a href="{{ SITEURL }}/{{ last_page.url }}">&#8649;</a>
{% endif %}
</p>
{% endif %}
{% extends "base.html" %}
{% block title %}{{ SITENAME }} - {{ period | reverse | join(' ') }} archives{% endblock %}
{% block content %}
<h1>Archives for {{ period | reverse | join(' ') }}</h1>
<dl>
{% for article in dates %}
<dt>{{ article.locale_date }}</dt>
<dd><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd>
{% endfor %}
</dl>
{% endblock %}
{% extends "index.html" %}
{% block title %}{{ SITENAME }} - {{ tag }} tag{% endblock %}
{% block content_title %}
<h2>Articles tagged with {{ tag }}</h2>
{% endblock %}
{% extends "base.html" %}
{% block title %}{{ SITENAME }} - Tags{% endblock %}
{% block content %}
<h1>Tags for {{ SITENAME }}</h1>
<ul>
{% for tag, articles in tags|sort %}
<li><a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a> ({{ articles|count }})</li>
{% endfor %}
</ul>
{% endblock %}
{% macro translations_for(article) %}
{% if article.translations %}
Translations:
{% for translation in article.translations %}
<a href="{{ SITEURL }}/{{ translation.url }}" hreflang="{{ translation.lang }}">{{ translation.lang }}</a>
{% endfor %}
{% endif %}
{% endmacro %}
{% macro entry_hreflang(entry) %}
{% if entry.translations %}
{% for translation in entry.translations %}
<link rel="alternate" hreflang="{{ translation.lang }}" href="{{ SITEURL }}/{{ translation.url }}">
{% endfor %}
{% endif %}
{% endmacro %}
......@@ -2,21 +2,23 @@
# -*- coding: utf-8 -*- #
AUTHOR = 'Denis Salem'
SITENAME = 'pelican-benchmark'
SITENAME = 'Pelican-benchmark'
SITEURL = ''
PATH = 'content'
TIMEZONE = 'Europe/Paris'
DEFAULT_LANG = 'la'
DEFAULT_LANG = 'fr'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None
FEED_ALL_ATOM = 'feeds/all.atom.xml'
FEED_ALL_RSS = 'feeds/all.rss.xml'
CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml'
CATEGORY_FEED_RSS = 'feeds/{slug}.rss.xml'
AUTHOR_SAVE_AS = ''
TAG_SAVE_AS = ''
# Blogroll
LINKS = (('Pelican', 'https://getpelican.com/'),
......@@ -30,5 +32,9 @@ SOCIAL = (('You can add links in your config file', '#'),
DEFAULT_PAGINATION = 10
DIRECT_TEMPLATES = ['index']
# Uncomment following line if you want document-relative URLs when developing
#RELATIVE_URLS = True
\ No newline at end of file
RELATIVE_URLS = True
THEME = "benchmark"
......@@ -36,33 +36,44 @@ Nature of the benchmark:
# Comment items you want to ignore
WILL_TESTS = [
"VenC"
"VenC",
"Pelican"
]
########################################################################
import datetime
import time
import vencbenchmark
from vencbenchmark.pelican import init_pelican_blog
from vencbenchmark.pelican import gen_pelican_entry
from vencbenchmark.pelican import benchmark_pelican
from vencbenchmark.pelican import clear_pelican_blog
from vencbenchmark.venc import init_venc_blog
from vencbenchmark.venc import gen_venc_entry
from vencbenchmark.venc import benchmark_venc
from vencbenchmark.venc import clear_venc_blog
import json
stages = {
"init": {
"VenC" : init_venc_blog
"VenC" : init_venc_blog,
"Pelican" : init_pelican_blog
},
"gen_entries" : {
"VenC" : gen_venc_entry
"VenC" : gen_venc_entry,
"Pelican" : gen_pelican_entry
},
"benchmark": {
"VenC": benchmark_venc
"VenC": benchmark_venc,
"Pelican": benchmark_pelican
},
"clear" : {
"VenC" : clear_venc_blog
"VenC" : clear_venc_blog,
"Pelican" : clear_pelican_blog
}
}
......@@ -95,13 +106,20 @@ def init():
stages["init"][item]()
print("VenC Comparative Benchmark v"+vencbenchmark.BENCHMARCH_VERSION)
clear()
init()
benchmark()
output = json.dumps(benchmark_data)
f = open(str(time.time())+".json","w")
f.write(output)
f.close()
try:
clear()
init()
benchmark()
clear()
output = json.dumps(benchmark_data)
f = open(str(time.time())+".json","w")
f.write(output)
f.close()
except KeyboardInterrupt:
pass
print("Done.")
......@@ -9,7 +9,7 @@ blog_url: ''
code_highlight_css_override: false
columns: 1
date_format: '%A %d. %B %Y'
disable_archives: false
disable_archives: true
disable_atom_feed: false
disable_categories: false
disable_chapters: true
......
......@@ -20,6 +20,7 @@
import datetime
import os
import random
import subprocess
import sys
stdout = sys.stdout
......@@ -56,6 +57,10 @@ Vivamus posuere sollicitudin odio at pulvinar. Aenean a ornare sapien. Mauris co
Sed a magna non magna blandit tristique sed quis augue. Donec lobortis tempus dui vel aliquam. Aliquam leo metus, malesuada in interdum sed, ultricies sit amet eros. Integer luctus ante vel arcu volutpat, vel rhoncus quam commodo. Morbi dapibus eleifend nisl, a vehicula lacus tincidunt vel. Ut molestie fermentum orci, eget eleifend nisi aliquet imperdiet. Vivamus aliquet blandit lectus vitae tincidunt. Donec maximus augue sed ex euismod convallis.
Cras ultrices orci erat, lobortis mollis est pellentesque ut. Morbi convallis consequat massa, vitae interdum lorem. Sed libero velit, commodo a varius eu, convallis in leo. Phasellus quis justo venenatis, semper mi sit amet, gravida mi. In pharetra ipsum a dolor rhoncus accumsan. Sed diam velit, tempus non massa ut, semper pellentesque sem. Suspendisse sagittis, nulla sed sagittis blandit, dolor erat lobortis sem, et elementum mi urna at dui. Duis felis lacus, malesuada sit amet enim ac, egestas malesuada orci. Duis iaculis erat quam, vel fermentum dui pretium quis. Praesent a lectus sem. Nullam est nulla, convallis at sodales et, sodales at nisi."""
def set_python_version():
if not "Python" in ENVIRONMENT.keys():
ENVIRONMENT["Python"] = sys.version.replace('\n', '')
def be_quiet(fun, args):
quiet = not "-v" in sys.argv
if quiet:
......@@ -65,6 +70,11 @@ def be_quiet(fun, args):
if quiet:
sys.stdout = stdout
def get_command_output(argv):
output = subprocess.Popen(argv, stdout=subprocess.PIPE, stderr= devnull if not "-v" in sys.argv else sys.stderr)
output.wait()
return output.stdout.read().decode("utf-8").strip()
def update_context():
global CONTEXT
......
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