File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 5757
5858 {{notices | default: newline}}
5959
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+
6068 {%- if page.optech_mentions and page.optech_mentions != '' -%}
6169 ## Optech newsletter mentions
6270
Original file line number Diff line number Diff line change @@ -110,6 +110,26 @@ def generate(site)
110110 end
111111 end
112112 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
113133 end
114134
115135 def liquify ( content , date )
You can’t perform that action at this time.
0 commit comments