jekyll-author-pages 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5c90ab11afb81300c24869bb8fc1207cb352555c
4
+ data.tar.gz: 66255bc337d88dadac6d6f14c0eea50fcfd185c5
5
+ SHA512:
6
+ metadata.gz: a2211f97c89f0a42cc3fd4f4f1362ae2df85daf1d5b3b7db88cf7834bb53871df5309ed83b5c92b1a6d1312deef63fb12f11a97d6d42640c2b989d966e210912
7
+ data.tar.gz: c6024aa85b5aa5f968d9e3e69b7029cd5bd798e4d4e8f6cd6b79e048ab7aaa9d6b00f831b9610e8475774ccb91dcea80c6e63ce96e07e11825d40ade8d074fdf
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Sai Ashirwad Informatia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,76 @@
1
+ # Jekyll Author [![build status](https://gitlab.com/SaiAshirwadInformatia/Jekyll-Author-Pages/badges/master/build.svg)](https://gitlab.com/SaiAshirwadInformatia/Jekyll-Author-Pages/commits/master) [![Gem Version](https://badge.fury.io/rb/jekyll-author-pages.svg)](https://badge.fury.io/rb/jekyll-author-pages)
2
+
3
+ This plugin helps generate Author based pages for Jekyll static site.
4
+
5
+ ### Installation
6
+
7
+ This plugin is available as a [RubyGem](https://rubygems.org/gems/jekyll-author/)
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```
12
+ gem 'jekyll-author-pages'
13
+ ```
14
+
15
+ And then execute the `bundle install` command to install the gem.
16
+
17
+ Alternatively, you can also manually install the gem using the following command:
18
+
19
+ ```
20
+ $ gem install jekyll-author-pages
21
+ ```
22
+
23
+ For Jekyll Users, after the plugin has been installed successfully, add the following lines to your _config.yml in order to tell Jekyll to use the plugin:
24
+
25
+ ```yaml
26
+ gems:
27
+ - jekyll-author-pages
28
+ ```
29
+
30
+ ### Usage
31
+
32
+ Firstly you need to add data of `authors` into data directory as `data/authors.yml` or `data/authors.json`
33
+
34
+ #### Sample Data
35
+
36
+ ```yaml
37
+ rsakhale:
38
+ name: Rohan Sakhale
39
+ bio: PHP/Java/GitLab fan, Passionate Developer and Loves Teaching
40
+ website: https://rohansakhale.com
41
+ twitter: RohanSakhale
42
+ linkedin: https://in.linkedin.com/in/rsakhale
43
+ github: RohanSakhale
44
+ gitlab: rsakhale
45
+ cpatil:
46
+ name: Chaitali Patil
47
+ bio: Crispy PHP developer and UI designer, believer in re-usability
48
+ website: https://cpatil.gitlab.io
49
+ twitter: chaitaalipatil
50
+ linkedin: https://in.linkedin.com/in/chaitali-patil-155397a3
51
+ github: chaitalipatil
52
+ gitlab: cpatil
53
+ ```
54
+
55
+ Then you need to add `author.html` layout for creating the view of your author page, this page will have `page.author` variable available for displaying any contents related to this author. Additionally posts written by this author would be available over `page.author.posts`.
56
+
57
+ For identifying post author you need to mention `author: username` in your **post front matter**
58
+
59
+ ```yaml
60
+ ---
61
+ title: Sample Post
62
+ author: rsakhale
63
+ ---
64
+ ```
65
+
66
+ ### Contribute
67
+
68
+ Fork this repository, create your branch, make changes and then issue a pull request.
69
+
70
+ If you find bugs or have new ideas that you do not want to implement yourself, file a bug report.
71
+
72
+ ### Copyright
73
+
74
+ Copyright (c) 2016 Sai Ashirwad Informatia
75
+
76
+ License: [MIT](LICENSE.md)
@@ -0,0 +1 @@
1
+ <h1>{{ page.author.name }}</h1>
@@ -0,0 +1,3 @@
1
+ # Generate script code for Google Analytics with Liquid Tag
2
+ require 'jekyll'
3
+ require 'jekyll/author'
@@ -0,0 +1,41 @@
1
+ module JekyllPlugins
2
+
3
+ class AuthorPage < Jekyll::Page
4
+ def initialize(site, base, dir, author)
5
+ @site = site
6
+ @base = base
7
+ @dir = dir
8
+ @name = 'index.html'
9
+
10
+ self.process(@name)
11
+ self.read_yaml(File.join(base, '_layouts'), 'author.html')
12
+
13
+ self.data['title'] = author['name']
14
+ self.data['description'] = author['bio']
15
+ self.data['author'] = author
16
+ end
17
+ end
18
+
19
+ class AuthorGenerator < Jekyll::Generator
20
+ safe true
21
+
22
+ def generate(site)
23
+ puts "Generating Author Pages"
24
+ dir = site.config['authors_dir'] || 'authors'
25
+ puts "Authors pages directory: " + dir
26
+ site.data['authors'].each do |author_key, author|
27
+ author_post = Array.new
28
+ site.posts.docs.each do |post|
29
+ if post.data['author'] == author_key
30
+ post.data['author'] = author
31
+ author_post << post
32
+ end
33
+ end
34
+ author['posts'] = author_post
35
+ author['slug'] = File.join(dir, Jekyll::Utils.slugify(author_key))
36
+ author['url'] = "/" + author['slug']
37
+ site.pages << AuthorPage.new(site, site.source, author['slug'], author)
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,6 @@
1
+
2
+ module JekyllPlugins
3
+ class Author
4
+ VERSION = "1.0.0".freeze
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-author-pages
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Rohan Sakhale
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-11-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.3.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 3.3.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: Generate Author pages for Jekyll based sites
56
+ email: rohansakhale@gmail.com
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - LICENSE.md
62
+ - README.md
63
+ - _layouts/author.html
64
+ - lib/jekyll-author.rb
65
+ - lib/jekyll/author.rb
66
+ - lib/jekyll/plugin_version.rb
67
+ homepage: https://gitlab.com/SaiAshirwadInformatia/Jekyll-Author
68
+ licenses:
69
+ - MIT
70
+ metadata:
71
+ allowed_push_host: https://rubygems.org
72
+ post_install_message:
73
+ rdoc_options: []
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ requirements: []
87
+ rubyforge_project:
88
+ rubygems_version: 2.5.1
89
+ signing_key:
90
+ specification_version: 4
91
+ summary: Generate Author pages for Jekyll based sites
92
+ test_files: []