@@ -29,25 +29,17 @@ This is a starter template for building a Next.js application that fetches data
29
29
### What's included?
30
30
31
31
✅ Type-safe data layer with the WordPress RestAPI
32
-
32
+ ✅ Granualar access to revalidation and cache tags
33
33
✅ Setup for all basic WordPress options: Posts, Pages, Authors, Categories, Tags
34
-
35
34
✅ Easy integration with custom post types and ACF
36
-
37
35
✅ Dynamic routes for Posts and Pages
38
-
39
36
✅ Design system for layout and prose styling ([ craft-ds.com] ( https://craft-ds.com ) )
40
-
41
37
✅ Filter, Search, and Card components
42
-
43
38
✅ Dynamically rendered sitemap
44
-
45
39
✅ Dynamically generated metadata
46
-
40
+ ✅ Dynamically generated OG/Twitter Cards for Posts and pages
47
41
✅ Responsive Nav and Footer components
48
-
49
42
✅ Site configuration file
50
-
51
43
✅ Menu configuration file
52
44
53
45
### Important files
@@ -97,49 +89,35 @@ const defaultFetchOptions = {
97
89
#### Posts
98
90
99
91
- ` getAllPosts(filterParams?: { author?: string; tag?: string; category?: string; }) ` : Fetches posts with optional filtering by author, tag, or category. Uses cache tags for efficient revalidation.
100
-
101
92
- ` getPostById(id: number) ` : Retrieves a specific post by ID with proper error handling.
102
-
103
93
- ` getPostBySlug(slug: string) ` : Fetches a post using its URL-friendly slug.
104
94
105
95
#### Categories
106
96
107
97
- ` getAllCategories() ` : Retrieves all categories with cache invalidation support.
108
-
109
98
- ` getCategoryById(id: number) ` : Gets a specific category with error handling.
110
-
111
99
- ` getCategoryBySlug(slug: string) ` : Fetches a category by its slug.
112
-
113
100
- ` getPostsByCategory(categoryId: number) ` : Gets all posts in a category, using proper cache tags.
114
101
115
102
#### Tags
116
103
117
104
- ` getAllTags() ` : Fetches all available tags.
118
-
119
105
- ` getTagById(id: number) ` : Retrieves a specific tag.
120
-
121
106
- ` getTagBySlug(slug: string) ` : Gets a tag by its slug.
122
-
123
107
- ` getTagsByPost(postId: number) ` : Fetches all tags associated with a post.
124
-
125
108
- ` getPostsByTag(tagId: number) ` : Gets all posts with a specific tag.
126
109
127
110
#### Pages
128
111
129
112
- ` getAllPages() ` : Retrieves all WordPress pages.
130
-
131
113
- ` getPageById(id: number) ` : Gets a specific page by ID.
132
-
133
114
- ` getPageBySlug(slug: string) ` : Fetches a page by its slug.
134
115
135
116
#### Authors
136
117
137
118
- ` getAllAuthors() ` : Fetches all WordPress authors.
138
-
139
119
- ` getAuthorById(id: number) ` : Gets a specific author.
140
-
141
120
- ` getAuthorBySlug(slug: string) ` : Retrieves an author by slug.
142
-
143
121
- ` getPostsByAuthor(authorId: number) ` : Gets all posts by a specific author.
144
122
145
123
#### Media
0 commit comments