jekyll-robotstxt 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 613e7874968a6f122b4e44f150d78e7b0d87e34ec0e8fed73952cd01e318ed3f
4
+ data.tar.gz: 5189dd5bd566affdae80bca7c1c7b6a53f63fdf8b419179e7cd5584c4ea6ddad
5
+ SHA512:
6
+ metadata.gz: b8736c18dd0bcb3b2575a353e92b735a73ed67469423cfa33fd181093990d53fa7d902d411c49126981b5313c62901360a41067e57b6727d346340ab975f6a3e
7
+ data.tar.gz: f9a867d975ee17be77a0e069e1e2f8fc634c999570fcea77f4b641b862553778bd2d79743fade0cb05d471cd5489a12dc436e351a860c8c04b152a1a847a5914
@@ -0,0 +1,16 @@
1
+ build_task:
2
+ container:
3
+ matrix:
4
+ - image: ruby:latest
5
+ - image: ruby:2.5
6
+ - image: ruby:2.4
7
+ bootstrap_script: gem install bundler
8
+ bundler_cache:
9
+ folder: /usr/local/bundle
10
+ fingerprint_script: |
11
+ cat Gemfile
12
+ cat *.gemspec
13
+ populate_script: bundler
14
+ build_script: gem build *.gemspec
15
+ gem_artifacts:
16
+ path: ./jekyll-robotstxt-*.gem
@@ -0,0 +1,2 @@
1
+ *.gem
2
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+ gemspec
5
+
6
+ gem "jekyll", ENV["JEKYLL_VERSION"] if ENV["JEKYLL_VERSION"]
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Reece Dunham
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 all
13
+ 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 THE
21
+ SOFTWARE.
@@ -0,0 +1,12 @@
1
+ # Jekyll robots.txt
2
+
3
+ Generate a `robots.txt` file for your Jekyll site!
4
+
5
+ Please keep in mind this is my first ever RubyGem, and it may have bugs.
6
+
7
+ ## Config
8
+
9
+ If you don't want search engines crawling a certain file on your site, just add the following to that file's front matter:
10
+ ```yaml
11
+ norobots: true
12
+ ```
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task :default => :spec
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path("lib", __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require "jekyll-robotstxt/version"
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "jekyll-robotstxt"
9
+ spec.summary = "Automatically generate a robots.txt file for your Jekyll site."
10
+ spec.version = Jekyll::Robots::VERSION
11
+ spec.authors = ["RDIL"]
12
+ spec.email = "me@rdil.rocks"
13
+ spec.date = '2019-04-09'
14
+ spec.homepage = "https://github.com/RDIL/jekyll-robotstxt"
15
+ spec.licenses = ["MIT"]
16
+
17
+ spec.files = `git ls-files -z`.split("\x0")
18
+ spec.executables = spec.files.grep(%r!^bin/!) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.required_ruby_version = ">= 2.3.0"
22
+
23
+ spec.add_dependency "jekyll", ">= 3.7", "< 5.0"
24
+ spec.add_dependency "rake"
25
+
26
+ spec.add_development_dependency "bundler"
27
+ spec.add_development_dependency "rubocop-jekyll", "~> 0.4"
28
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "jekyll/page_without_a_file"
4
+ require "jekyll/jekyll-robotstxt"
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ module Robots
5
+ VERSION = "0.3.2"
6
+ end
7
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "fileutils"
4
+
5
+ module Jekyll
6
+ class JekyllRobots < Jekyll::Generator
7
+ safe true
8
+ priority :lowest
9
+
10
+ # Main plugin action, called by Jekyll-core
11
+ def generate(site)
12
+ @site = site
13
+ @site.pages << robots
14
+ end
15
+
16
+ # Path to robots.txt template file
17
+ def source_path(file = "robots.txt")
18
+ File.expand_path "../#{file}", __dir__
19
+ end
20
+
21
+ # Destination for robots.txt file within the site source directory
22
+ def destination_path(file = "robots.txt")
23
+ @site.in_dest_dir(file)
24
+ end
25
+
26
+ def robots
27
+ robots = PageWithoutAFile.new(@site, __dir__, "", "robots.txt")
28
+ robots.data["layout"] = nil
29
+ robots
30
+ end
31
+
32
+ # Checks if a file already exists in the site source
33
+ def file_exists?(file_path)
34
+ if @site.respond_to?(:in_source_dir)
35
+ File.exist? @site.in_source_dir(file_path)
36
+ else
37
+ File.exist? Jekyll.sanitized_path(@site.source, file_path)
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ class PageWithoutAFile < Page
5
+ # rubocop:disable Naming/MemoizedInstanceVariableName
6
+ def read_yaml(*)
7
+ @data ||= {}
8
+ end
9
+ # rubocop:enable Naming/MemoizedInstanceVariableName
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ User-agent: *
2
+ {% assign pages = site.html_pages | where_exp:'doc','doc.norobots == true' | where_exp:'doc','doc.url != "/404.html"' %}
3
+ {% assign collections = site.collections | where_exp:'collection','collection.output != false' %}
4
+ {% for page in pages %}
5
+ Disallow: {{ page.url }}
6
+ {% endfor %}
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ set -ex
3
+
4
+ bundler install
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ set -e
3
+
4
+ time script/fmt
@@ -0,0 +1,10 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ echo "Rubocop $(bundle exec rubocop --version)"
5
+ bundle exec rubocop -D -E $@
6
+ success=$?
7
+ if ((success != 0)); then
8
+ echo -e "\nTry running \`script/fmt -a\` to automatically fix errors"
9
+ fi
10
+ exit $success
metadata ADDED
@@ -0,0 +1,119 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-robotstxt
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.2
5
+ platform: ruby
6
+ authors:
7
+ - RDIL
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-04-09 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.7'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '3.7'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: rake
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: bundler
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rubocop-jekyll
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '0.4'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '0.4'
75
+ description:
76
+ email: me@rdil.rocks
77
+ executables: []
78
+ extensions: []
79
+ extra_rdoc_files: []
80
+ files:
81
+ - ".cirrus.yml"
82
+ - ".gitignore"
83
+ - Gemfile
84
+ - LICENSE
85
+ - README.md
86
+ - Rakefile
87
+ - jekyll-robotstxt.gemspec
88
+ - lib/jekyll-robotstxt.rb
89
+ - lib/jekyll-robotstxt/version.rb
90
+ - lib/jekyll/jekyll-robotstxt.rb
91
+ - lib/jekyll/page_without_a_file.rb
92
+ - lib/robots.txt
93
+ - script/bootstrap
94
+ - script/cibuild
95
+ - script/fmt
96
+ homepage: https://github.com/RDIL/jekyll-robotstxt
97
+ licenses:
98
+ - MIT
99
+ metadata: {}
100
+ post_install_message:
101
+ rdoc_options: []
102
+ require_paths:
103
+ - lib
104
+ required_ruby_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: 2.3.0
109
+ required_rubygems_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
114
+ requirements: []
115
+ rubygems_version: 3.0.3
116
+ signing_key:
117
+ specification_version: 4
118
+ summary: Automatically generate a robots.txt file for your Jekyll site.
119
+ test_files: []