Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of sidebar.html Pelican template with DDG search
<aside class="sidebar">
{% if SIDEBAR_IMAGE %}
<section>
<img src="{{ SITEURL }}/{{ SIDEBAR_IMAGE }}" alt="{{ SIDEBAR_IMAGE_ALT}}" width="{{SIDEBAR_IMAGE_WIDTH}}"/>
</section>
{% endif %}
<section>
<h1>Search</h1>
<form method="get" id="search" action="http://duckduckgo.com/">
<input type="hidden" name="sites"value="mygeekdaddy.net"/>
<input type="hidden" name="ka" value="h"/>
<input type="hidden" name="k7" value="w"/>
<input type="hidden" name="kj" value="#434843"/>
<input type="hidden" name="ky" value="#F3FEF3"/>
<input type="hidden" name="kx" value="#384338"/>
<input type="hidden" name="kt" value="Helvetica"/>
<input type="text" name="q" maxlength="255" placeholder="via DuckDuckGo"/>
<input type="submit" value="Go!" />
</form>
</section>
<section><span>
<a title="RSS Feed" href="http://feeds.feedburner.com/mygeekdaddy_v2"><img style="border: 0;
border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;" src="http://share.mygeekdaddy.net/rss_dark.png" alt="RSS" onmouseover="this.src='http://share.mygeekdaddy.net/rss_active.png'" onmouseout="this.src='http://share.mygeekdaddy.net/rss_dark.png'"/></a>
<a title="Twitter" href="https://twitter.com/mygeekdaddy"><img style="border: 0; border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;" src="http://share.mygeekdaddy.net/twitter_dark.png" alt="Twitter" onmouseover="this.src='http://share.mygeekdaddy.net/twitter_active.png'" onmouseout="this.src='http://share.mygeekdaddy.net/twitter_dark.png'"/></a>
<a title="Github" href="https://github.com/mygeekdaddy" alt="Github"><img style="border: 0; border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;" src="http://share.mygeekdaddy.net/github-9-32.png" alt="Github" onmouseover="this.src='http://share.mygeekdaddy.net/github-9-32-1.png'" onmouseout="this.src='http://share.mygeekdaddy.net/github-9-32.png'"/></a>
</span></section>
<section>
<h1>Recent Posts</h1>
<ul id="recent_posts">
{% for article in articles[:5] %}
<li class="post">
<a href="{{ SITEURL }}/{{ article.url }}">{{ article.title|striptags }}</a>
</li>
{% endfor %}
</ul>
</section>
{% if categories %}
<section>
<h1>Categories</h1>
<ul id="recent_posts">
{% for category, articles in categories %}
<li><a href="{{ SITEURL }}/{{ category.url }}">{{ category }}</a></li>
{% endfor %}
</ul>
</section>
{% endif %}
{% include '_includes/links.html' %}
</aside>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.