Skip to content

Commit 8816a85

Browse files
committed
Fix: change path to src/content to match astro v2 conent collections
1 parent 9e68134 commit 8816a85

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Create page with auto generated frontmatter.
88
### Usage
99

1010
Make sure you run the command inside the root directory of your site projet.
11-
It will create a file in the src/pages path.
11+
It will create a file in the src/content path.
1212

1313
```bash
1414
# $ astroadd [path]

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var rootCmd = &cobra.Command{
3232
Use: "astroadd [path]",
3333
Short: "Create a new file",
3434
Long: `Create a new file.
35-
Goes to src/pages
35+
Goes to src/content
3636
Based on the given path.
3737
Automatically add the frontmatter (title, date, draft).
3838
Ensure you run this within the root directory of your site.`,

helpers/files.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
// Get the os platform separator
1313
var sep = os.PathSeparator
14-
var basePath = fmt.Sprintf("src%cpages%c", sep, sep)
14+
var basePath = fmt.Sprintf("src%ccontent%c", sep, sep)
1515

1616
// Return the title without dashes and the directory path for the given path.
1717
// Or an error

helpers/files_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ func TestSanitizer(t *testing.T) {
88
arg string
99
expected string
1010
}{
11-
{"pages/posts.md", "Posts"},
12-
{"pages/posts-1.md", "Posts 1"},
13-
{"pages/posts_2.md", "Posts 2"},
14-
{"pages/posts@3.md", "Posts 3"},
15-
{"pages/posts_blog@4.md", "Posts blog 4"},
16-
{"pages/posts_blog@/4.md", "4"},
11+
{"content/posts.md", "Posts"},
12+
{"content/posts-1.md", "Posts 1"},
13+
{"content/posts_2.md", "Posts 2"},
14+
{"content/posts@3.md", "Posts 3"},
15+
{"content/posts_blog@4.md", "Posts blog 4"},
16+
{"content/posts_blog@/4.md", "4"},
1717
}
1818

1919
for _, tc := range cases {

0 commit comments

Comments
 (0)