Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions _layouts/atom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" {% if site.lang %}xml:lang="{{ site.lang }}"{% endif %}>
<generator uri="https://jekyllrb.com/" version="{{ jekyll.version }}">Jekyll</generator>
<link href="{{ page.url | absolute_url }}" rel="self" type="application/atom+xml" />
<link href="{{ '/' | absolute_url }}" rel="alternate" type="text/html" {% if site.lang %}hreflang="{{ site.lang }}" {% endif %}/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ '/' | absolute_url | xml_escape }}</id>

{% if site.title %}
<title type="html">{{ site.title | smartify | xml_escape }}</title>
{% elsif site.name %}
<title type="html">{{ site.name | smartify | xml_escape }}</title>
{% endif %}

{% if site.description %}
<subtitle>{{ site.description | xml_escape }}</subtitle>
{% endif %}

{% if site.author %}
<author>
<name>{{ site.author.name | default: site.author | xml_escape }}</name>
{% if site.author.email %}
<email>{{ site.author.email | xml_escape }}</email>
{% endif %}
{% if site.author.uri %}
<uri>{{ site.author.uri | xml_escape }}</uri>
{% endif %}
</author>
{% endif %}

{% assign posts = site.posts | where_exp: "post", "post.draft != true" %}
{% for post in posts limit: 10 %}
{% for tag in post.tags %}
{% if tag == page.tag %}
<entry{% if post.lang %}{{" "}}xml:lang="{{ post.lang }}"{% endif %}>
<title type="html">{{ post.title | smartify | strip_html | normalize_whitespace | xml_escape }}</title>
<link href="{{ post.url | absolute_url }}" rel="alternate" type="text/html" title="{{ post.title | xml_escape }}" />
<published>{{ post.date | date_to_xmlschema }}</published>
<updated>{{ post.last_modified_at | default: post.date | date_to_xmlschema }}</updated>
<id>{{ post.id | absolute_url | xml_escape }}</id>
<content type="html" xml:base="{{ post.url | absolute_url | xml_escape }}">{{ post.content | strip | xml_escape }}</content>

{% assign post_author = post.author | default: post.authors[0] | default: site.author %}
{% assign post_author = site.data.authors[post_author] | default: post_author %}
{% assign post_author_email = post_author.email | default: nil %}
{% assign post_author_uri = post_author.uri | default: nil %}
{% assign post_author_name = post_author.name | default: post_author %}

<author>
<name>{{ post_author_name | default: "" | xml_escape }}</name>
{% if post_author_email %}
<email>{{ post_author_email | xml_escape }}</email>
{% endif %}
{% if post_author_uri %}
<uri>{{ post_author_uri | xml_escape }}</uri>
{% endif %}
</author>

{% if post.category %}
<category term="{{ post.category | xml_escape }}" />
{% endif %}

{% for tag in post.tags %}
<category term="{{ tag | xml_escape }}" />
{% endfor %}

{% if post.excerpt and post.excerpt != empty %}
<summary type="html">{{ post.excerpt | strip_html | normalize_whitespace | xml_escape }}</summary>
{% endif %}

{% assign post_image = post.image.path | default: post.image %}
{% if post_image %}
{% unless post_image contains "://" %}
{% assign post_image = post_image | absolute_url | xml_escape %}
{% endunless %}
<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="{{ post_image }}" />
{% endif %}
</entry>
{% endif %}
{% endfor %}
{% endfor %}
</feed>
29 changes: 29 additions & 0 deletions _layouts/tag_index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
layout: default
---
<div class="home">

<h1 class="page-heading">Posts</h1>

{{ content }}

<ul class="post-list">
{% for post in site.posts %}
{% for tag in post.tags %}
{% if tag == page.tag %}
<li>
{% assign date_format = site.minima.date_format | default: "%b %-d, %Y" %}
<span class="post-meta">{{ post.date | date: date_format }}</span>

<h2>
<a class="post-link" href="{{ post.url | relative_url }}">{{ post.title | escape }}</a>
</h2>
</li>
{% endif %}
{% endfor %}
{% endfor %}
</ul>

<p class="rss-subscribe">subscribe <a href="/tags/{{ page.tag }}/feed.xml">via RSS</a></p>

</div>
16 changes: 16 additions & 0 deletions _layouts/tags_folder_index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
layout: page
title: Tags
permalink: /tags/
---

{% assign sorted_posts = site.tags | sort %}

{% for post in sorted_posts %}
{% assign tag = post | first %}
<ul class="post-list">
<h2>
<a class="post-link" href="/tags/{{ tag }}/">{{ tag | escape }}</a>
</h2>
</ul>
{% endfor %}
27 changes: 27 additions & 0 deletions _plugins/rss_tag.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module Jekyll
class TagAtom < Page
def initialize(site, base, dir, tag)
@site = site
@base = base
@dir = dir
@name = "feed.xml"

process(@name)
read_yaml(File.join(base, '_layouts'), 'atom.html')
data['tag'] = tag
end
end

class TagPageGenerator < Generator
safe true

# Generate tag page and atom feed for each tag used in the blogs
def generate(site)
# if site.layouts.key? 'tagpage'
site.tags.each_key do |tag|
site.pages << TagAtom.new(site, site.source, File.join('tags',tag), tag)
end
# end
end
end
end
35 changes: 35 additions & 0 deletions _plugins/tag_gen.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module Jekyll

class TagIndex < Page
def initialize(site, base, dir, tag)
@site = site
@base = base
@dir = dir
@name = 'index.html'

self.process(@name)
self.read_yaml(File.join(base, '_layouts'), 'tag_index.html')
self.data['tag'] = tag
end
end

class TagGenerator < Generator
safe true

def generate(site)
if site.layouts.key? 'tag_index'
dir = 'tags'
site.tags.keys.each do |tag|
write_tag_index(site, File.join(dir, tag), tag)
end
end
end

def write_tag_index(site, dir, tag)
index = TagIndex.new(site, site.source, dir, tag)
index.render(site.layouts, site.site_payload)
index.write(site.dest)
site.pages << index
end
end
end
24 changes: 24 additions & 0 deletions _plugins/tags_folder.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module Jekyll

class TagList < Page
def initialize(site, base, dir)
@site = site
@base = base
@dir = dir
@name = 'index.html'

self.process(@name)
self.read_yaml(File.join(base, '_layouts'), 'tags_folder_index.html')
end
end

class TagListGenerator < Generator
safe true

def generate(site)
if site.layouts.key? 'tags_folder_index'
site.pages << TagList.new(site, site.source, 'tags')
end
end
end
end
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
---
layout: post
title: 2016 A year dedicated to Python Workshops
tag: pythonworkshop
tag:
- python
- workshop
- pythonexpress
excerpt: >
Beautiful 2017 has already started. While everybody is busy with preparing
resolutions for their new year I decided to look back and share my journey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
layout: post
categories: book review
title: Book review 'Introduction to the Command Line'
tag: books linux programming
tag:
- books
- linux
- programming
excerpt: >
Every chapter will introduce a bunch of comands and will point to its
respective documentation for further learning. You should expect chapters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
layout: post
title: "Pycon Pune 2017: A wonderful Python conference"
date: "2017-03-14 18:18:02 +0530"
tag: python conference
tag:
- python
- conference
excerpt: >
The conference is worth attending if you are a student, programmer or a
hobbyist. If you are a swag-hungry then don't expect much as a swag from this
Expand Down
3 changes: 3 additions & 0 deletions _posts/2017-04-10-goyo-doc-vim-helpfile-for-goyo-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
layout: post
title: "goyo-doc: Vim helpfile for goyo.vim plugin"
date: "2017-04-10 17:51:48 +0530"
tags:
- vim
- goyo_doc
excerpt: >
Goyo is the vim plugin which allows writers to focus on their writing while
they are writing. The plugin deactivates not required fancy windows which are
Expand Down