File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,31 +100,43 @@ paginate: 5
100100kramdown :
101101 input : GFM
102102
103+ # Common defaults using YAML anchors
104+ ALL_PAGES : &ALL_PAGES
105+ after-content :
106+ - donate.html
107+ footer-extra :
108+ - footer-extra.html
109+ ALL_POSTS : &ALL_POSTS
110+ comments : true # add comments to all blog posts
111+ social-share : true # add social media sharing buttons to all blog posts
112+ css :
113+ - " /assets/css/show-search.css"
114+
103115# Default YAML values (more information on Jekyll's site)
104116defaults :
105117 - scope :
106118 path : " "
107119 type : " posts"
108120 values :
109121 layout : " post"
110- after-content :
111- - donate.html
112- footer-extra :
113- - footer-extra.html
114- comments : true # add comments to all blog posts
115- social-share : true # add social media sharing buttons to all blog posts
116- css :
117- - " /assets/css/show-search.css"
122+ << : *ALL_PAGES
123+ << : *ALL_POSTS
124+ - scope :
125+ path : " _posts/releases"
126+ type : " posts"
127+ values :
128+ layout : " post"
129+ << : *ALL_PAGES
130+ << : *ALL_POSTS
131+ js :
132+ - " /assets/js/changelog-links.js"
118133 - scope :
119134 path : " " # any file that's not a post will be a "page" layout by default
120135 values :
121136 layout : " page"
122- after-content :
123- - donate.html
124- footer-extra :
125- - footer-extra.html
137+ << : *ALL_PAGES
126138
127- # Exclude these files from production site
139+ # Exclude these files from the production site
128140exclude :
129141 - Dockerfile
130142 - Gemfile
Original file line number Diff line number Diff line change 1+ /**
2+ * Convert Full Changelog URLs to clickable links in GitHub release notes
3+ */
4+ ( function ( ) {
5+ 'use strict' ;
6+
7+ function makeChangelogLinksClickable ( ) {
8+ // Find all paragraphs that contain "Full Changelog" text and a GitHub compare URL
9+ const paragraphs = document . querySelectorAll ( 'p' ) ;
10+
11+ // Loop through paragraphs in reverse order and break after the first match
12+ for ( let i = paragraphs . length - 1 ; i >= 0 ; i -- ) {
13+ const paragraph = paragraphs [ i ] ;
14+ const text = paragraph . textContent || paragraph . innerText ;
15+
16+ // Check if this paragraph contains "Full Changelog" and a GitHub compare URL
17+ if (
18+ text . includes ( 'Full Changelog' ) &&
19+ text . includes ( 'https://github.com/' ) &&
20+ text . includes ( '/compare/' ) &&
21+ text . includes ( '…' )
22+ ) {
23+ // Extract the URL from the text
24+ const urlMatch = text . match ( / ( h t t p s : \/ \/ g i t h u b \. c o m \/ \S + ) / ) ;
25+
26+ if ( ! urlMatch ) {
27+ continue ;
28+ }
29+
30+ const url = urlMatch [ 1 ] ;
31+
32+ // Update the paragraph's innerHTML with a clickable link
33+ paragraph . innerHTML = paragraph . innerHTML . replace (
34+ url ,
35+ `<a href="${ url } " target="_blank" rel="noopener noreferrer">${ url } </a>`
36+ ) ;
37+
38+ // Break after first match
39+ break ;
40+ }
41+ }
42+ }
43+
44+ // Run when DOM is ready
45+ if ( document . readyState === 'loading' ) {
46+ document . addEventListener ( 'DOMContentLoaded' , makeChangelogLinksClickable ) ;
47+ } else {
48+ makeChangelogLinksClickable ( ) ;
49+ }
50+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments