Skip to content

Commit 402580a

Browse files
authored
Update Robots.txt generator (#2356)
* Update Robots.txt generator * touchups * Updated robots.txt
1 parent e725db2 commit 402580a

File tree

2 files changed

+4
-187
lines changed

2 files changed

+4
-187
lines changed

lib/tasks/pwpush.rake

+2-12
Original file line numberDiff line numberDiff line change
@@ -107,24 +107,14 @@ end
107107
desc "Generate robots.txt."
108108
task generate_robots_txt: :environment do
109109
include Rails.application.routes.url_helpers
110-
contents = "User-Agent: *\n"
110+
contents = "User-agent: *\n"
111111
contents += "Disallow: /p/\n"
112112
contents += "Disallow: /f/\n"
113113
contents += "Disallow: /r/\n"
114114
contents += "Allow: /p/new\n"
115115
contents += "Allow: /f/new\n"
116116
contents += "Allow: /r/new\n"
117-
118-
I18n.available_locales.each do |locale|
119-
contents += "Disallow: /#{locale}/p/\n"
120-
contents += "Disallow: /#{locale}/f/\n"
121-
contents += "Disallow: /#{locale}/r/\n"
122-
I18n.with_locale(locale) do
123-
contents += "Allow: #{new_password_path}\n"
124-
contents += "Allow: #{new_file_push_path}\n"
125-
contents += "Allow: #{new_url_path}\n"
126-
end
127-
end
117+
contents += "Allow: /pages/\n"
128118

129119
File.write("./public/robots.txt", contents)
130120

public/robots.txt

+2-175
Original file line numberDiff line numberDiff line change
@@ -1,181 +1,8 @@
1-
User-Agent: *
1+
User-agent: *
22
Disallow: /p/
33
Disallow: /f/
44
Disallow: /r/
55
Allow: /p/new
66
Allow: /f/new
77
Allow: /r/new
8-
Disallow: /ca/p/
9-
Disallow: /ca/f/
10-
Disallow: /ca/r/
11-
Allow: /ca/p/nou
12-
Allow: /ca/f/nou
13-
Allow: /ca/r/nou
14-
Disallow: /cs/p/
15-
Disallow: /cs/f/
16-
Disallow: /cs/r/
17-
Allow: /cs/p/Nov%C3%BD
18-
Allow: /cs/f/Nov%C3%BD
19-
Allow: /cs/r/Nov%C3%BD
20-
Disallow: /da/p/
21-
Disallow: /da/f/
22-
Disallow: /da/r/
23-
Allow: /da/p/ny
24-
Allow: /da/f/ny
25-
Allow: /da/r/ny
26-
Disallow: /de/p/
27-
Disallow: /de/f/
28-
Disallow: /de/r/
29-
Allow: /de/p/neu
30-
Allow: /de/f/neu
31-
Allow: /de/r/neu
32-
Disallow: /en/p/
33-
Disallow: /en/f/
34-
Disallow: /en/r/
35-
Allow: /en/p/new
36-
Allow: /en/f/new
37-
Allow: /en/r/new
38-
Disallow: /es/p/
39-
Disallow: /es/f/
40-
Disallow: /es/r/
41-
Allow: /es/p/nuevo
42-
Allow: /es/f/nuevo
43-
Allow: /es/r/nuevo
44-
Disallow: /fi/p/
45-
Disallow: /fi/f/
46-
Disallow: /fi/r/
47-
Allow: /fi/p/Uusi
48-
Allow: /fi/f/Uusi
49-
Allow: /fi/r/Uusi
50-
Disallow: /fr/p/
51-
Disallow: /fr/f/
52-
Disallow: /fr/r/
53-
Allow: /fr/p/nouveau
54-
Allow: /fr/f/nouveau
55-
Allow: /fr/r/nouveau
56-
Disallow: /hi/p/
57-
Disallow: /hi/f/
58-
Disallow: /hi/r/
59-
Allow: /hi/p/%E0%A4%A8%E0%A4%AF%E0%A4%BE
60-
Allow: /hi/f/%E0%A4%A8%E0%A4%AF%E0%A4%BE
61-
Allow: /hi/r/%E0%A4%A8%E0%A4%AF%E0%A4%BE
62-
Disallow: /hu/p/
63-
Disallow: /hu/f/
64-
Disallow: /hu/r/
65-
Allow: /hu/p/%C3%BAj
66-
Allow: /hu/f/%C3%BAj
67-
Allow: /hu/r/%C3%BAj
68-
Disallow: /id/p/
69-
Disallow: /id/f/
70-
Disallow: /id/r/
71-
Allow: /id/p/baru
72-
Allow: /id/f/baru
73-
Allow: /id/r/baru
74-
Disallow: /is/p/
75-
Disallow: /is/f/
76-
Disallow: /is/r/
77-
Allow: /is/p/n%C3%BDr
78-
Allow: /is/f/n%C3%BDr
79-
Allow: /is/r/n%C3%BDr
80-
Disallow: /it/p/
81-
Disallow: /it/f/
82-
Disallow: /it/r/
83-
Allow: /it/p/nuovo
84-
Allow: /it/f/nuovo
85-
Allow: /it/r/nuovo
86-
Disallow: /ja/p/
87-
Disallow: /ja/f/
88-
Disallow: /ja/r/
89-
Allow: /ja/p/%E6%96%B0%E3%81%97%E3%81%84
90-
Allow: /ja/f/%E6%96%B0%E3%81%97%E3%81%84
91-
Allow: /ja/r/%E6%96%B0%E3%81%97%E3%81%84
92-
Disallow: /ko/p/
93-
Disallow: /ko/f/
94-
Disallow: /ko/r/
95-
Allow: /ko/p/%EC%83%88%EB%A1%9C%EC%9A%B4
96-
Allow: /ko/f/%EC%83%88%EB%A1%9C%EC%9A%B4
97-
Allow: /ko/r/%EC%83%88%EB%A1%9C%EC%9A%B4
98-
Disallow: /lv/p/
99-
Disallow: /lv/f/
100-
Disallow: /lv/r/
101-
Allow: /lv/p/jauns
102-
Allow: /lv/f/jauns
103-
Allow: /lv/r/jauns
104-
Disallow: /nl/p/
105-
Disallow: /nl/f/
106-
Disallow: /nl/r/
107-
Allow: /nl/p/nieuw
108-
Allow: /nl/f/nieuw
109-
Allow: /nl/r/nieuw
110-
Disallow: /no/p/
111-
Disallow: /no/f/
112-
Disallow: /no/r/
113-
Allow: /no/p/ny
114-
Allow: /no/f/ny
115-
Allow: /no/r/ny
116-
Disallow: /pl/p/
117-
Disallow: /pl/f/
118-
Disallow: /pl/r/
119-
Allow: /pl/p/nowy
120-
Allow: /pl/f/nowy
121-
Allow: /pl/r/nowy
122-
Disallow: /pt-BR/p/
123-
Disallow: /pt-BR/f/
124-
Disallow: /pt-BR/r/
125-
Allow: /pt-br/p/novo
126-
Allow: /pt-br/f/novo
127-
Allow: /pt-br/r/novo
128-
Disallow: /pt-PT/p/
129-
Disallow: /pt-PT/f/
130-
Disallow: /pt-PT/r/
131-
Allow: /pt-pt/p/novo
132-
Allow: /pt-pt/f/novo
133-
Allow: /pt-pt/r/novo
134-
Disallow: /ro/p/
135-
Disallow: /ro/f/
136-
Disallow: /ro/r/
137-
Allow: /ro/p/nou
138-
Allow: /ro/f/nou
139-
Allow: /ro/r/nou
140-
Disallow: /ru/p/
141-
Disallow: /ru/f/
142-
Disallow: /ru/r/
143-
Allow: /ru/p/%D0%BD%D0%BE%D0%B2%D1%8B%D0%B9
144-
Allow: /ru/f/%D0%BD%D0%BE%D0%B2%D1%8B%D0%B9
145-
Allow: /ru/r/%D0%BD%D0%BE%D0%B2%D1%8B%D0%B9
146-
Disallow: /sr/p/
147-
Disallow: /sr/f/
148-
Disallow: /sr/r/
149-
Allow: /sr/p/%D0%9D%D0%BE%D0%B2%D0%B0
150-
Allow: /sr/f/%D0%9D%D0%BE%D0%B2%D0%B0
151-
Allow: /sr/r/%D0%9D%D0%BE%D0%B2%D0%B0
152-
Disallow: /sv/p/
153-
Disallow: /sv/f/
154-
Disallow: /sv/r/
155-
Allow: /sv/p/ny
156-
Allow: /sv/f/ny
157-
Allow: /sv/r/ny
158-
Disallow: /th/p/
159-
Disallow: /th/f/
160-
Disallow: /th/r/
161-
Allow: /th/p/%E0%B9%83%E0%B8%AB%E0%B8%A1%E0%B9%88
162-
Allow: /th/f/%E0%B9%83%E0%B8%AB%E0%B8%A1%E0%B9%88
163-
Allow: /th/r/%E0%B9%83%E0%B8%AB%E0%B8%A1%E0%B9%88
164-
Disallow: /uk/p/
165-
Disallow: /uk/f/
166-
Disallow: /uk/r/
167-
Allow: /uk/p/%D0%BD%D0%BE%D0%B2%D0%B8%D0%B9
168-
Allow: /uk/f/%D0%BD%D0%BE%D0%B2%D0%B8%D0%B9
169-
Allow: /uk/r/%D0%BD%D0%BE%D0%B2%D0%B8%D0%B9
170-
Disallow: /ur/p/
171-
Disallow: /ur/f/
172-
Disallow: /ur/r/
173-
Allow: /ur/p/%D9%86%D8%A6%DB%8C
174-
Allow: /ur/f/%D9%86%D8%A6%DB%8C
175-
Allow: /ur/r/%D9%86%D8%A6%DB%8C
176-
Disallow: /zh-CN/p/
177-
Disallow: /zh-CN/f/
178-
Disallow: /zh-CN/r/
179-
Allow: /zh-cn/p/%E6%96%B0%E7%9A%84
180-
Allow: /zh-cn/f/%E6%96%B0%E7%9A%84
181-
Allow: /zh-cn/r/%E6%96%B0%E7%9A%84
8+
Allow: /pages/

0 commit comments

Comments
 (0)