Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,19 @@ impl Config {
.map(|url| format!("You can leave feedback on the [internals thread]({url})."))
.unwrap_or_default();
let prefix = if for_blog {
let date_path = chrono::Utc::now().date_naive().format("%Y/%m/%d");
format!(
r#"---
layout: post
title: "{} pre-release testing"
author: Release automation
team: The Release Team <https://www.rust-lang.org/governance/teams/release>
---{}"#,
release, "\n\n",
r#"+++
path = "inside-rust/{date_path}/{release}-prerelease"
title = "{release} pre-release testing"
authors = ["Release automation"]

[extra]
team = "the Release team"
team_url = "https://www.rust-lang.org/governance/teams/infra#team-release"
+++

"#,
)
} else {
String::new()
Expand All @@ -310,7 +315,7 @@ team: The Release Team <https://www.rust-lang.org/governance/teams/release>

You can try it out locally by running:

```plain
```
RUSTUP_DIST_SERVER=https://dev-static.rust-lang.org rustup update stable
```

Expand All @@ -323,7 +328,7 @@ we'd love your feedback [on this GitHub issue][feedback].

[relnotes]: {release_notes_url}
[feedback]: https://github.com/rust-lang/release-team/issues/16
"
"
))
}
}
Expand Down
6 changes: 1 addition & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -905,11 +905,7 @@ impl Context {
let blog_repo = token.repository()?;
token.create_file(
&blog_repo.default_branch,
&format!(
"posts/inside-rust/{}-{}-prerelease.md",
chrono::Utc::now().date_naive().format("%Y-%m-%d"),
version,
),
&format!("content/inside-rust/{version}-prerelease.md"),
&blog_contents,
)?;
} else if let Some(pr) = self.config.blog_pr {
Expand Down
Loading