@@ -19,7 +19,7 @@ class MigratedLog < Generator
19
19
def generate ( site )
20
20
@site = site
21
21
pages = @site . pages
22
- migrated_pages = pages . select { |page | page . data [ 'layout' ] and page . data [ 'layout' ] . include? 'migrated' }
22
+ migrated_pages = pages . select { |page | page . data [ 'layout' ] & .include? 'migrated' }
23
23
v2_3_pages = pages . select { |page | page . data [ 'guide_version' ] == '2.3' }
24
24
remained_pages = pages - v2_3_pages
25
25
deprecated_pages = remained_pages . select { |page | page . data [ 'group' ] . nil? || page . data [ 'redirect_to' ] }
@@ -32,8 +32,12 @@ def generate(site)
32
32
migrated_page = {
33
33
path : page . path ,
34
34
title : page . data [ 'title' ] || abort ( "Error in '#{ page . path } '.\n Check 'title' in the file's frontmatter." . red ) ,
35
- guide : page . data [ 'layout' ] . include? ( 'video' ) ? 'Video Tutorials' : @site . data . dig ( 'toc' , page . data [ 'group' ] ,
36
- 'label' ) || abort ( "Error in '#{ page . path } '.\n Check 'group' in the file's frontmatter or 'label' in the corresponding TOC." . red ) ,
35
+ guide : if page . data [ 'layout' ] . include? ( 'video' )
36
+ 'Video Tutorials'
37
+ else
38
+ @site . data . dig ( 'toc' , page . data [ 'group' ] ,
39
+ 'label' ) || abort ( "Error in '#{ page . path } '.\n Check 'group' in the file's frontmatter or 'label' in the corresponding TOC." . red )
40
+ end ,
37
41
migrated_from : site . baseurl + page . url ,
38
42
migrated_to : page . data [ 'migrated_to' ] || abort ( "Error in '#{ page . path } '.\n Check 'migrated_to' in the file's frontmatter." . red ) ,
39
43
migrated_to_source : if page . data [ 'migrated_to' ] . start_with? ( 'https://experienceleague.adobe.com' )
@@ -61,9 +65,9 @@ def generate(site)
61
65
62
66
content += "\n ***\n \n \n "
63
67
content += "\n ## Pages to be migrated\n \n \n "
64
-
68
+
65
69
if remained_migrating_pages . empty?
66
- content += " All 2.4 and versionless pages were migrated"
70
+ content += ' All 2.4 and versionless pages were migrated'
67
71
else
68
72
remained_migrating_pages . sort_by ( &:path )
69
73
. each do |page |
@@ -93,12 +97,12 @@ def generate(site)
93
97
pages << topic
94
98
95
99
site . data [ 'migration' ] =
96
- {
97
- 'migrated_pages' => migrated_pages . map ( &:path ) ,
98
- 'deprecated_pages' => deprecated_pages . map ( &:path ) ,
99
- 'all_migrating_pages' => all_migrating_pages . map ( &:path ) ,
100
- 'remained_migrating_pages' => remained_migrating_pages . map ( &:path )
101
- }
100
+ {
101
+ 'migrated_pages' => migrated_pages . map ( &:path ) ,
102
+ 'deprecated_pages' => deprecated_pages . map ( &:path ) ,
103
+ 'all_migrating_pages' => all_migrating_pages . map ( &:path ) ,
104
+ 'remained_migrating_pages' => remained_migrating_pages . map ( &:path )
105
+ }
102
106
103
107
migrated_pages_data
104
108
end
0 commit comments