@@ -81,6 +81,14 @@ gDate = gDate.match(/([0-9]{4}-[0-9]{2}-[0-9]{2})/)[1];
8181scrawl . group = config . group || 'Telecon' ;
8282scrawl . people = JSON . parse ( peopleJson ) ;
8383
84+ // we can't make any URLs without this...so fail...
85+ if ( ! ( 'minutes_base_url' in config ) ) {
86+ console . error ( 'Error: The `minutes_base_url` was not set in the config' ) ;
87+ process . exit ( 1 ) ;
88+ }
89+ // Location of date-based minutes folders; MUST end in a forward slash
90+ scrawl . minutes_base_url = config . minutes_base_url ;
91+
8492// Mustache template - vars: gDate, formattedItems, content, minutes_base_url
8593const GPLUS_BODY = ( 'gplus' in config && 'body' in config . gplus )
8694 ? config . gplus . body
@@ -105,10 +113,6 @@ const TWITTER_BODY = ('twitter' in config && 'body' in config.twitter)
105113const WORDPRESS_TITLE = ( 'wordpress' in config && 'title' in config . wordpress )
106114 ? config . wordpress . title
107115 : 'Meeting Minutes for {{gDate}}' ;
108- // Location of date-based minutes folders; MUST end in a forward slash
109- const MINUTES_BASE_URL = 'https://json-ld.github.io/minutes/'
110-
111- scrawl . minutes_base_url = MINUTES_BASE_URL ;
112116
113117/************************* Utility Functions *********************************/
114118function postToWordpress ( username , password , content , callback ) {
@@ -124,12 +128,12 @@ function postToWordpress(username, password, content, callback) {
124128 wpSummary = wpSummary . substring (
125129 wpSummary . indexOf ( '<dl>' ) , wpSummary . indexOf ( '</dl>' ) + 5 ) ;
126130 wpSummary = wpSummary . replace ( / h r e f = \" # / g,
127- 'href="' + MINUTES_BASE_URL + gDate + '/#' ) ;
131+ 'href="' + scrawl . minutes_base_url + gDate + '/#' ) ;
128132 wpSummary = wpSummary . replace ( / h r e f = \" a u d i o / g,
129- 'href="' + MINUTES_BASE_URL + gDate + '/audio' ) ;
133+ 'href="' + scrawl . minutes_base_url + gDate + '/audio' ) ;
130134 wpSummary = wpSummary . replace ( / < d i v > < a u d i o [ \s \S ] * \/ a u d i o > < \/ d i v > / g, '' ) ;
131135 wpSummary += '<p>Detailed minutes and recorded audio for this call are ' +
132- '<a href="' + MINUTES_BASE_URL + gDate +
136+ '<a href="' + scrawl . minutes_base_url + gDate +
133137 '/">available in the archive</a>.</p>' ;
134138
135139 // calculate the proper post date
0 commit comments