diff --git a/make-release.py b/make-release.py index b9855d3c7..bae99d2ee 100755 --- a/make-release.py +++ b/make-release.py @@ -6,7 +6,7 @@ import os WEB_REPO = '../2009scape.github.io' -NEWS_DIR = 'services/m=news/archives' +NEWS_DIR = 'updates/_posts' LOG_DELIMITER = ';;;;;' DEBUG = False @@ -33,8 +33,8 @@ def get_changelog_html(tag: Tag) -> str: else: log_period = f'{tag.last_tag}..{tag.tag_name}' changelog = subprocess.check_output(['git', 'log', log_period, f'--format=%B{LOG_DELIMITER}']).decode('utf8').split(LOG_DELIMITER) - changelog_html = ''.join(['
  • ' + change.strip().replace('\n', '
    \n') + '
  • \n' for change in changelog if change.strip()]) - changelog_html = f'' + changelog_html = ''.join(['- ' + change.strip().replace('\n', '
    \n') + '\n' for change in changelog if change.strip()]) + changelog_html = f'\n{changelog_html}' print('generated changelog:', changelog_html, sep='\n') return changelog_html @@ -43,7 +43,7 @@ def make_news_post(tag: Tag) -> None: changelog_html = get_changelog_html(tag) os.chdir(os.path.join(WEB_REPO, NEWS_DIR)) current_date = datetime.datetime.now().strftime('%Y-%m-%d') - news_filename = current_date + '.html' + news_filename = f'{current_date}-More-changes-in-Gielinor.md' print('news filename:', news_filename) news_post = news_template(current_date, changelog_html) if DEBUG: @@ -56,111 +56,22 @@ def make_news_post(tag: Tag) -> None: def news_template(current_date: str, changelog: str) -> str: - return '''--- -title: More Changes in Gielinor + return f'''--- +title: More changes in Gielinor tags: news layout: newspost -collection: Game Updates -date: '''+ current_date + ''' 00:00:00 +0000 +date: {current_date} 00:00:00 +0000 authors: ryannathans excerpt: "There have been some more changes in Gielinor..." +modtype: "Lead Developer" +avatar: avatar8fa9.gif --- -
    -
    -
    -
    -
    -

    - {{ page.date | date: '%d-%B-%Y' }} -

    -
    -
    -
    -
    -
    -
    -
    -
    -
    {{ page.title }} -
    -
    -
    -
    - - - - - - - - -
    - -
    -
    -
    - - - - - - - - -
    -
    - {{ page.authors }} -
    - -
    ???
    -
    +Greetings Explorers -
    -
    -
    -
    - {{ page.date | date: '%d-%B-%Y' }} -
    -
    -
    -

    Greetings Explorers

    -

    There have been some more changes in Gielinor:

    ''' + changelog + ''' -
    -
    -
    -
    - - - - - - - - -
    - -
    -
    -
    -
    -
    -
    ''' +There have been some more changes in Gielinor: + +{changelog} +''' def main() -> None: