Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
AruSeito committed Dec 21, 2023
1 parent 576d704 commit d7f5691
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions plugins/blog-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ async function blogPluginExtended(...pluginArgs) {
blogTagsListPath,
} = blogContents;


const blogItemsToMetadata = {};

function blogPostItemsModule(items) {
Expand Down Expand Up @@ -157,9 +158,11 @@ async function blogPluginExtended(...pluginArgs) {
(post) => post.metadata.frontMatter.is_featured !== true,
);

const basePageUrl = blogTagsListPath.split("/tags")[0]

const blogListPaginated = paginateBlogPosts({
blogPosts,
basePageUrl: "/illa-website/blog",
basePageUrl: basePageUrl,
blogTitle,
blogDescription,
postsPerPageOption: postsPerPage,
Expand All @@ -181,6 +184,7 @@ async function blogPluginExtended(...pluginArgs) {
JSON.stringify({ ...metadata, relatedPosts, authorPosts }, null, 2),
);


addRoute({
path: metadata.permalink,
component: "@theme/BlogPostPage",
Expand Down Expand Up @@ -216,15 +220,14 @@ async function blogPluginExtended(...pluginArgs) {
JSON.stringify(tagsProp, null, 2),
);

console.log("permalink", permalink)

addRoute({
path: permalink,
component: "@theme/BlogListPage",
exact: true,
modules: {
items: blogPostItemsModule(
permalink === "/illa-website/blog"
permalink === basePageUrl
? [...items, ...featuredBlogPosts.map((post) => post.id)]
: items,
),
Expand Down

0 comments on commit d7f5691

Please sign in to comment.