- Create a new hyde site
hyde -s test create
- Overwrite the generated site.yaml with the one in the gist
- Add site_plugins.py to the root folder
- Rename *.html under content to *.md
- Run hyde
hyde gen -r
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "skeleton/_base.html" %} | |
{# Note that context variables here are meaningless since they are not evaluated in base templates #} | |
{# So we create the variable in the CONTEXT #} | |
{% block content %} | |
{% block content_header %} | |
<div id="content-header"><h1>{{ page.title }}</h1></div> | |
{% endblock %} | |
{% block content_body %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python -S | |
# coding: utf-8 | |
""" | |
Textmate Command to extract the link references from a | |
markdown file and insert it as a snippet at cursor. | |
Screenshot: http://embr.it/Bp9 | |
""" | |
import re | |
from sys import stdin, stdout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: An Angry Post | |
description: > | |
Temper. Temper. Temper. | |
created: !!timestamp '2011-01-01 10:00:00' | |
tags: | |
- angry | |
- thoughts | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
extends: base.j2 | |
title: About BASIC | |
description: The default hyde template | |
events: | |
y2011: | |
- | |
title: "one event" | |
location: "a city" | |
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- nsterm.m.patched 2011-07-17 21:25:41.000000000 +0530 | |
+++ nsterm.m 2011-07-17 21:25:44.000000000 +0530 | |
@@ -5881,6 +5881,13 @@ | |
-(NSWindow *)toggleFullscreen { | |
+ | |
+ if ([super respondsToSelector: @selector(toggleFullScreen:)]) { | |
+ [super toggleFullScreen:self]; | |
+ return self; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_nav_with_grouper(self): | |
text =""" | |
{% for group, resources in site.content.walk_section_groups() %} | |
<ul> | |
<li> | |
<h2>{{ group.name|title }}</h2> | |
<h3>{{ group.description }}</h3> | |
<ul class="links"> | |
{% for resource in resources %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#<site_root>/functions.py | |
from hyde.plugin import Plugin | |
def quoted(var): | |
return '"%s"' % var | |
class MyJinjaLoader(Plugin): | |
def template_loaded(self, template): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from hyde.plugin import Plugin | |
from jinja2 import contextfunction, Markup | |
@contextfunction | |
def localtime(context, val, lc): | |
import locale, datetime | |
current = locale.getlocale() | |
locale.setlocale(locale.LC_ALL, lc) | |
result = val.strftime(locale.nl_langinfo(locale.D_T_FMT)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file should be placed in the root directory for french language files | |
# ... | |
language: fr | |
lc: fr_CA | |
# ... |