diff --git a/_layouts/atom.html b/_layouts/atom.html new file mode 100644 index 0000000..a0282ac --- /dev/null +++ b/_layouts/atom.html @@ -0,0 +1,82 @@ + + + Jekyll + + + {{ site.time | date_to_xmlschema }} + {{ '/' | absolute_url | xml_escape }} + + {% if site.title %} + {{ site.title | smartify | xml_escape }} + {% elsif site.name %} + {{ site.name | smartify | xml_escape }} + {% endif %} + + {% if site.description %} + {{ site.description | xml_escape }} + {% endif %} + + {% if site.author %} + + {{ site.author.name | default: site.author | xml_escape }} + {% if site.author.email %} + {{ site.author.email | xml_escape }} + {% endif %} + {% if site.author.uri %} + {{ site.author.uri | xml_escape }} + {% endif %} + + {% 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 %} + + {{ post.title | smartify | strip_html | normalize_whitespace | xml_escape }} + + {{ post.date | date_to_xmlschema }} + {{ post.last_modified_at | default: post.date | date_to_xmlschema }} + {{ post.id | absolute_url | xml_escape }} + {{ post.content | strip | xml_escape }} + + {% 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 %} + + + {{ post_author_name | default: "" | xml_escape }} + {% if post_author_email %} + {{ post_author_email | xml_escape }} + {% endif %} + {% if post_author_uri %} + {{ post_author_uri | xml_escape }} + {% endif %} + + + {% if post.category %} + + {% endif %} + + {% for tag in post.tags %} + + {% endfor %} + + {% if post.excerpt and post.excerpt != empty %} + {{ post.excerpt | strip_html | normalize_whitespace | xml_escape }} + {% 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 %} + + {% endif %} + + {% endif %} + {% endfor %} + {% endfor %} + diff --git a/_layouts/tag_index.html b/_layouts/tag_index.html new file mode 100644 index 0000000..954b047 --- /dev/null +++ b/_layouts/tag_index.html @@ -0,0 +1,29 @@ +--- +layout: default +--- +
+ +

Posts

+ + {{ content }} + + + +

subscribe via RSS

+ +
diff --git a/_layouts/tags_folder_index.html b/_layouts/tags_folder_index.html new file mode 100644 index 0000000..7be9c40 --- /dev/null +++ b/_layouts/tags_folder_index.html @@ -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 %} + +{% endfor %} diff --git a/_plugins/rss_tag.rb b/_plugins/rss_tag.rb new file mode 100644 index 0000000..eb5beaa --- /dev/null +++ b/_plugins/rss_tag.rb @@ -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 diff --git a/_plugins/tag_gen.rb b/_plugins/tag_gen.rb new file mode 100644 index 0000000..a0c2e50 --- /dev/null +++ b/_plugins/tag_gen.rb @@ -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 diff --git a/_plugins/tags_folder.rb b/_plugins/tags_folder.rb new file mode 100644 index 0000000..704f1b5 --- /dev/null +++ b/_plugins/tags_folder.rb @@ -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 diff --git a/_posts/2017-01-08-2016-a-year-dedicated-to-python-workshops.md b/_posts/2017-01-08-2016-a-year-dedicated-to-python-workshops.md index 3b52982..ee9eb4f 100644 --- a/_posts/2017-01-08-2016-a-year-dedicated-to-python-workshops.md +++ b/_posts/2017-01-08-2016-a-year-dedicated-to-python-workshops.md @@ -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 diff --git a/_posts/2017-02-28-book-review-introduction-to-the-commandline.md b/_posts/2017-02-28-book-review-introduction-to-the-commandline.md index b2d6007..a2c9a15 100644 --- a/_posts/2017-02-28-book-review-introduction-to-the-commandline.md +++ b/_posts/2017-02-28-book-review-introduction-to-the-commandline.md @@ -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 diff --git a/_posts/2017-03-14-pycon-pune-2017-a-wonderful-python-conference.md b/_posts/2017-03-14-pycon-pune-2017-a-wonderful-python-conference.md index 275480c..967d290 100644 --- a/_posts/2017-03-14-pycon-pune-2017-a-wonderful-python-conference.md +++ b/_posts/2017-03-14-pycon-pune-2017-a-wonderful-python-conference.md @@ -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 diff --git a/_posts/2017-04-10-goyo-doc-vim-helpfile-for-goyo-plugin.md b/_posts/2017-04-10-goyo-doc-vim-helpfile-for-goyo-plugin.md index d72af7a..1bcabcf 100644 --- a/_posts/2017-04-10-goyo-doc-vim-helpfile-for-goyo-plugin.md +++ b/_posts/2017-04-10-goyo-doc-vim-helpfile-for-goyo-plugin.md @@ -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