Skip to content

Commit 73b23b1

Browse files
committed
Render newsletter: Fixed post URL
addresses issue #146
1 parent ab43d25 commit 73b23b1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/actions/render-newsletter/dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/render-newsletter/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@ function contextFromPath(filepath: string) {
102102
function postUrl(post: PathContext, site: any) {
103103
const siteUrl = site.url;
104104
const basePath = site.baseurl ?? '';
105+
const m = `${post.month}`.padStart(2, '0');
106+
const d = `${post.day}`.padStart(2, '0');
105107

106-
return `${siteUrl}${basePath}/${post.year}/${post.month}/${post.day}/${post.slug}.html`;
108+
return `${siteUrl}${basePath}/${post.year}/${m}/${d}/${post.slug}.html`;
107109
}
108110

109111
type PostContext = PathContext &

0 commit comments

Comments
 (0)