File tree 2 files changed +28
-0
lines changed
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 57
57
58
58
{{notices | default: newline}}
59
59
60
+ {%- if page.podcast_mentions.size > 0 -%}
61
+ ## Optech podcast appearances
62
+
63
+ {%- for mention in page.podcast_mentions -%}
64
+ {{newline}}- [{{mention.title}}]({{mention.url}})
65
+ {%- endfor -%}
66
+ {% endif %}{{newline}}{{newline}}
67
+
60
68
{%- if page.optech_mentions and page.optech_mentions != '' -%}
61
69
## Optech newsletter mentions
62
70
Original file line number Diff line number Diff line change @@ -110,6 +110,26 @@ def generate(site)
110
110
end
111
111
end
112
112
end
113
+
114
+ # Podcast appearances
115
+ # =====================
116
+ podcast_pages = pages_with_link_syntax . select { |doc | doc . url . start_with? ( "/#{ lang } /podcast/" ) } . reverse
117
+ people_pages = site . collections [ "people" ] . docs
118
+
119
+ people_pages . each do |person |
120
+ podcast_mentions = [ ]
121
+ # Iterate over podcast pages to find mentions of people
122
+ podcast_pages . each do |podcast |
123
+ podcast_intro = podcast . content . each_line . first . chomp
124
+ if podcast_intro . include? ( "href='#{ person . url } '" )
125
+ podcast_mentions << { "title" => podcast . title , "url" => podcast . url }
126
+ # the excerpt of pages is calculated by Jekyll before generators run
127
+ # therefore we need to override the excerpt to remove [[]]
128
+ podcast . excerpt . content = podcast_intro
129
+ end
130
+ end
131
+ person . data [ "podcast_mentions" ] = podcast_mentions
132
+ end
113
133
end
114
134
115
135
def liquify ( content , date )
You can’t perform that action at this time.
0 commit comments