File tree Expand file tree Collapse file tree 1 file changed +0
-28
lines changed
Expand file tree Collapse file tree 1 file changed +0
-28
lines changed Original file line number Diff line number Diff line change @@ -155,34 +155,6 @@ export default function(eleventyConfig) {
155155 return content ;
156156 } ) ;
157157
158- // добавление на заголовки id с временными метками внутри страниц подкастов
159- eleventyConfig . addTransform ( 'podcast-headings' , async function ( content ) {
160- if ( ! this . page ?. outputPath ?. endsWith ?. ( 'html' ) ) {
161- return content ;
162- }
163-
164- // игнорируем страницы, не попадающие под url вида `/podcast/<номер подкаста>/`
165- if ( ! ( / \po d c a s t \/ \d + \/ / . test ( this . page ?. url ) ) ) {
166- return content ;
167- }
168-
169- const { document } = parseHTML ( content ) ;
170-
171- const titlesMap = Array . from ( document . querySelectorAll ( '.podcast__content h2' ) )
172- . reduce ( ( map , titleElement ) => {
173- map [ titleElement . textContent . trim ( ) ] = titleElement ;
174- return map ;
175- } , { } ) ;
176-
177- for ( const chapterElement of document . querySelectorAll ( '.podcast__timecode-chapter' ) ) {
178- const titleText = chapterElement . querySelector ( '.podcast__timecode-title' ) . textContent . trim ( ) ;
179- const timeCode = chapterElement . querySelector ( '.podcast__timecode-link' ) . textContent . trim ( ) ;
180- titlesMap [ titleText ] ?. setAttribute ( 'id' , timeCode ) ;
181- }
182-
183- return document . toString ( ) ;
184- } ) ;
185-
186158 // добавление id на заголовки и кнопок для копирования ссылок
187159 eleventyConfig . addTransform ( 'content-headings' , async function ( content ) {
188160 if ( ! this . page ?. outputPath ?. endsWith ?. ( 'html' ) ) {
You can’t perform that action at this time.
0 commit comments