Skip to content

Commit 7198412

Browse files
luke6Lh43chalin
authored andcommitted
fix: add dynamic year update in content/en/docs/contributing/blog.md
1 parent 4ef38f8 commit 7198412

File tree

1 file changed

+9
-13
lines changed
  • content/en/docs/contributing

1 file changed

+9
-13
lines changed

content/en/docs/contributing/blog.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,28 +95,25 @@ instructions provided by the
9595
After you've set up the local fork you can create a blog post using a template.
9696
Follow these steps to create a post from the template:
9797

98-
1. Run the following command from the repository root (please ensure the year in
99-
the path is correct, as your blog will be created in that directory):
98+
1. Run the following command from the repository root:
10099

101100
```sh
102-
npx hugo new content/en/blog/2025/short-name-for-post.md
101+
npx hugo new content/en/blog/$(date +%Y)/short-name-for-post.md
103102
```
104103

105-
If your post has images or other assets, run the following command (please
106-
ensure the year in the path is correct, as your blog will be created in that
107-
directory):
104+
If your post has images or other assets, run the following command:
108105

109106
```sh
110-
npx hugo new content/en/blog/2025/short-name-for-post/index.md
107+
npx hugo new content/en/blog/$(date +%Y)/short-name-for-post/index.md
111108
```
112109

113-
1. Edit the Markdown file at the path you provided in the previous command. The
110+
2. Edit the Markdown file at the path you provided in the previous command. The
114111
file is initialized from the blog-post starter under
115112
[archetypes](https://github.com/open-telemetry/opentelemetry.io/tree/main/archetypes/).
116113

117-
1. Put assets, like images or other files, into the folder you've created.
114+
3. Put assets, like images or other files, into the folder you've created.
118115

119-
1. When your post is ready, submit it through a pull request.
116+
4. When your post is ready, submit it through a pull request.
120117

121118
### Use the GitHub UI
122119

@@ -132,10 +129,9 @@ new post. Follow these steps to add a post using the UI:
132129

133130
1. Paste the content from the template you copied in the first step.
134131

135-
1. Name your file (please ensure the year in the path is correct, as your blog
136-
will be created in that directory), for example:
132+
1. Name your file, for example (`YYYY` is the current year):
137133

138-
`content/en/blog/2025/short-name-for-your-blog-post/index.md`.
134+
`content/en/blog/YYYY/short-name-for-your-blog-post/index.md`.
139135

140136
1. Edit the Markdown file in GitHub.
141137

0 commit comments

Comments
 (0)