custom_jekyll 0.1.0 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f87507e433e1d734e249ba8d98608f0103e74f9208715e6fea724151c5b8fac
4
- data.tar.gz: 1601f4b7866916c7bc620d934981b5ff7bafa04f6bd404030822befb4c7532c2
3
+ metadata.gz: 7111645d46352fb62b80654cb064077e0f8f6de78a4acf8e3316c09ed52a6058
4
+ data.tar.gz: c59579f3cf37248af6b58b2e58a9234f9782cb885a0198f45876594ffa07ff46
5
5
  SHA512:
6
- metadata.gz: fb4276f1fa7ec5bc77234dfe8fbff40e7f68abd689bf5d8410e12bb04b8c3debc64d87c3bb6710a77a25121f9d1620ab7ee49ba7c295683e4529b8764e9db981
7
- data.tar.gz: 34ec283a18660709f904babb09845fdfa92ba34ed8c9b40a18a22c3fd91dbc15c28fcb46287d5db200e5c0fe7d4792cf20ede84965725adb22af2681f5a3d62f
6
+ metadata.gz: 83e273d061461173ed0deeedc934afb97496d9dc119e0b3cefdad2f3d16fc6eb04c5aa96eed230eaf94cc390de5caa106d764a0f315088b1a30294c478ae4c46
7
+ data.tar.gz: cdd2b301282cdf9383a4fcf2f07fe16de53a4a4842cc57b883307aaee062e1786b1a24d0be74c9135c6a07957ed3dbc9eafbc5d757487fab84766694d350e3b4
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- custom_jekyll (0.1.0)
4
+ custom_jekyll (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,29 +1,29 @@
1
1
  # CustomJekyll
2
+ The purpose of this gem is to make one's life easy while making any kind of site with jekyll. This gem is a mere generator that will generate all the files required for you to start any kind of static website using jekyll. Jekyll default generator is focused for blogs. I love to make different static websites and hosting them using github pages.
2
3
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/custom_jekyll`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'custom_jekyll'
13
- ```
14
-
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install custom_jekyll
4
+ Generate using CustomJekyll and have the basic structure for creating any kind of static website and then hosting it on GithubPages.
5
+
22
6
 
23
7
  ## Usage
8
+ ### Install
9
+ ```shell
10
+ $ gem install custom_jekyll
11
+ ```
12
+ ### Generate a site
13
+ ```shell
14
+ $ custom_jekyll static-is-fun-with-jekyll
15
+ ```
16
+ ### if you do not like the name custom_jekyll (I totally understand :P)
17
+ Add the following in your shell's profile
24
18
 
25
- TODO: Write usage instructions here
19
+ ```shell
20
+ alias cj="custom_jekyll"
21
+ ```
22
+ then
26
23
 
24
+ ```shell
25
+ $ cj learning-flexbox
26
+ ```
27
27
  ## Development
28
28
 
29
29
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -40,4 +40,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
40
40
 
41
41
  ## Code of Conduct
42
42
 
43
- Everyone interacting in the CustomJekyll project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/custom_jekyll/blob/master/CODE_OF_CONDUCT.md).
43
+ Everyone interacting in the CustomJekyll project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/aurangzaib-danial/custom_jekyll/blob/master/CODE_OF_CONDUCT.md).
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Aurangzaib"]
10
10
  spec.email = ["aurangzaib.danial@gmail.com"]
11
11
 
12
- spec.summary = "Need summary"
13
- spec.description = "Need description"
12
+ spec.summary = "Generate using CustomJekyll and have the basic structure for creating any kind of static website and then hosting it on GithubPages."
13
+ spec.description = "The purpose of this gem is to make one's life easy while making any kind of site with jekyll. This gem is a mere generator that will generate all the files required for you to start any kind of static website using jekyll. Jekyll default generator is focused for blogs. I love to make different static websites and hosting them using github pages. "
14
14
  spec.homepage = "https://github.com/aurangzaib-danial/custom_jekyll"
15
15
  spec.license = "MIT"
16
16
 
@@ -20,7 +20,9 @@ class CustomJekyll::Generator
20
20
 
21
21
  def generate_site
22
22
  copy_templates_to_new_site
23
+ change_directory_to_site
23
24
  run_automated_commands
25
+ add_site_name_to_site_config
24
26
  end
25
27
 
26
28
  def g_site_folder
@@ -32,21 +34,26 @@ class CustomJekyll::Generator
32
34
  end
33
35
 
34
36
  def run_automated_commands
35
- change_directory_to_site
36
37
  run_bundle_install
37
38
  make_git_repo
38
39
  end
39
40
 
40
- private
41
-
42
- def site_template
43
- self.class.path_to_site_template << '/.'
41
+ def add_site_name_to_site_config
42
+ config = File.read('_config.yml')
43
+ config.gsub!('%site_title%', humanize_site_name)
44
+ overwrite_config(config)
44
45
  end
45
46
 
46
47
  def change_directory_to_site
47
48
  Dir.chdir(site_name)
48
49
  end
49
50
 
51
+ private
52
+
53
+ def site_template
54
+ self.class.path_to_site_template << '/.'
55
+ end
56
+
50
57
  def run_bundle_install
51
58
  puts "Running bundle install in #{site_name}"
52
59
  ENV["BUNDLE_GEMFILE"] = File.expand_path('Gemfile')
@@ -56,5 +63,15 @@ class CustomJekyll::Generator
56
63
  def make_git_repo
57
64
  system("git init")
58
65
  end
66
+
67
+ def humanize_site_name
68
+ site_name.split(/-|\s/).map {|w| w.capitalize}.join("\s")
69
+ end
70
+
71
+ def overwrite_config(content)
72
+ File.open '_config.yml', 'w' do |f|
73
+ f.write content
74
+ end
75
+ end
59
76
 
60
77
  end
@@ -1,4 +1,4 @@
1
- title: 'TODO: Add awesome title'
1
+ title: %site_title%
2
2
  defaults:
3
3
  -
4
4
  scope:
@@ -1,3 +1,3 @@
1
1
  module CustomJekyll
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/notes.md CHANGED
@@ -15,3 +15,5 @@ Custom jekyll is a gem that will generate files that I require to start any kind
15
15
  TODO
16
16
  - [x] Set set_template according to your need.
17
17
  - [x] Run automated commands like bundle install, initialize git repository
18
+ - [x] edit config to include site_name
19
+ - [ ] fix readme and gem description
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: custom_jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aurangzaib
@@ -66,7 +66,11 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.13.1
69
- description: Need description
69
+ description: 'The purpose of this gem is to make one''s life easy while making any
70
+ kind of site with jekyll. This gem is a mere generator that will generate all the
71
+ files required for you to start any kind of static website using jekyll. Jekyll
72
+ default generator is focused for blogs. I love to make different static websites
73
+ and hosting them using github pages. '
70
74
  email:
71
75
  - aurangzaib.danial@gmail.com
72
76
  executables:
@@ -130,5 +134,6 @@ requirements: []
130
134
  rubygems_version: 3.0.3
131
135
  signing_key:
132
136
  specification_version: 4
133
- summary: Need summary
137
+ summary: Generate using CustomJekyll and have the basic structure for creating any
138
+ kind of static website and then hosting it on GithubPages.
134
139
  test_files: []