bunki 0.18.5 → 0.18.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +25 -37
- package/dist/index.js +25 -37
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -33964,31 +33964,6 @@ ${categoryTags}`;
|
|
|
33964
33964
|
return itemXml;
|
|
33965
33965
|
}
|
|
33966
33966
|
|
|
33967
|
-
// src/utils/pagination.ts
|
|
33968
|
-
function createPagination(items, currentPage, pageSize, pagePath) {
|
|
33969
|
-
const totalItems = items.length;
|
|
33970
|
-
const totalPages = Math.ceil(totalItems / pageSize);
|
|
33971
|
-
return {
|
|
33972
|
-
currentPage,
|
|
33973
|
-
totalPages,
|
|
33974
|
-
hasNextPage: currentPage < totalPages,
|
|
33975
|
-
hasPrevPage: currentPage > 1,
|
|
33976
|
-
nextPage: currentPage < totalPages ? currentPage + 1 : null,
|
|
33977
|
-
prevPage: currentPage > 1 ? currentPage - 1 : null,
|
|
33978
|
-
pageSize,
|
|
33979
|
-
totalItems,
|
|
33980
|
-
pagePath
|
|
33981
|
-
};
|
|
33982
|
-
}
|
|
33983
|
-
function getPaginatedItems(items, page, pageSize) {
|
|
33984
|
-
const startIndex = (page - 1) * pageSize;
|
|
33985
|
-
const endIndex = startIndex + pageSize;
|
|
33986
|
-
return items.slice(startIndex, endIndex);
|
|
33987
|
-
}
|
|
33988
|
-
function getTotalPages(totalItems, pageSize) {
|
|
33989
|
-
return Math.ceil(totalItems / pageSize);
|
|
33990
|
-
}
|
|
33991
|
-
|
|
33992
33967
|
// src/generators/feeds.ts
|
|
33993
33968
|
function makeAbsoluteUrl(imageUrl, baseUrl) {
|
|
33994
33969
|
return imageUrl.startsWith("http") ? imageUrl : `${baseUrl}${imageUrl}`;
|
|
@@ -34058,10 +34033,6 @@ function generateSitemap(site, config, pageSize = 10) {
|
|
|
34058
34033
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
34059
34034
|
`;
|
|
34060
34035
|
sitemapContent += buildSitemapUrl(`${config.baseUrl}/`, currentDate, "daily", 1);
|
|
34061
|
-
const totalHomePages = getTotalPages(site.posts.length, pageSize);
|
|
34062
|
-
for (let page = 2;page <= totalHomePages; page++) {
|
|
34063
|
-
sitemapContent += buildSitemapUrl(`${config.baseUrl}/page/${page}/`, currentDate, "daily", 0.8);
|
|
34064
|
-
}
|
|
34065
34036
|
for (const post of site.posts) {
|
|
34066
34037
|
const postUrl = `${config.baseUrl}${post.url}`;
|
|
34067
34038
|
const postDate = new Date(post.date).toISOString();
|
|
@@ -34077,20 +34048,12 @@ function generateSitemap(site, config, pageSize = 10) {
|
|
|
34077
34048
|
const mostRecentPost = tagData.posts[0];
|
|
34078
34049
|
const tagPriority = mostRecentPost ? calculateFreshnessPriority(mostRecentPost.date, 0.4, now) : 0.4;
|
|
34079
34050
|
sitemapContent += buildSitemapUrl(tagUrl, currentDate, "weekly", tagPriority);
|
|
34080
|
-
const totalTagPages = getTotalPages(tagData.posts.length, pageSize);
|
|
34081
|
-
for (let page = 2;page <= totalTagPages; page++) {
|
|
34082
|
-
sitemapContent += buildSitemapUrl(`${config.baseUrl}/tags/${tagData.slug}/page/${page}/`, currentDate, "weekly", Math.max(0.3, tagPriority - 0.1));
|
|
34083
|
-
}
|
|
34084
34051
|
}
|
|
34085
34052
|
for (const [year, yearPosts] of Object.entries(site.postsByYear)) {
|
|
34086
34053
|
const currentYear = new Date().getFullYear();
|
|
34087
34054
|
const isCurrentYear = parseInt(year) === currentYear;
|
|
34088
34055
|
const yearPriority = isCurrentYear ? 0.7 : 0.5;
|
|
34089
34056
|
sitemapContent += buildSitemapUrl(`${config.baseUrl}/${year}/`, currentDate, isCurrentYear ? "weekly" : "monthly", yearPriority);
|
|
34090
|
-
const totalYearPages = getTotalPages(yearPosts.length, pageSize);
|
|
34091
|
-
for (let page = 2;page <= totalYearPages; page++) {
|
|
34092
|
-
sitemapContent += buildSitemapUrl(`${config.baseUrl}/${year}/page/${page}/`, currentDate, isCurrentYear ? "weekly" : "monthly", yearPriority - 0.1);
|
|
34093
|
-
}
|
|
34094
34057
|
}
|
|
34095
34058
|
sitemapContent += `</urlset>`;
|
|
34096
34059
|
return sitemapContent;
|
|
@@ -34129,6 +34092,31 @@ Sitemap: ${config.baseUrl}/sitemap.xml
|
|
|
34129
34092
|
var import_nunjucks = __toESM(require_nunjucks(), 1);
|
|
34130
34093
|
import path7 from "path";
|
|
34131
34094
|
|
|
34095
|
+
// src/utils/pagination.ts
|
|
34096
|
+
function createPagination(items, currentPage, pageSize, pagePath) {
|
|
34097
|
+
const totalItems = items.length;
|
|
34098
|
+
const totalPages = Math.ceil(totalItems / pageSize);
|
|
34099
|
+
return {
|
|
34100
|
+
currentPage,
|
|
34101
|
+
totalPages,
|
|
34102
|
+
hasNextPage: currentPage < totalPages,
|
|
34103
|
+
hasPrevPage: currentPage > 1,
|
|
34104
|
+
nextPage: currentPage < totalPages ? currentPage + 1 : null,
|
|
34105
|
+
prevPage: currentPage > 1 ? currentPage - 1 : null,
|
|
34106
|
+
pageSize,
|
|
34107
|
+
totalItems,
|
|
34108
|
+
pagePath
|
|
34109
|
+
};
|
|
34110
|
+
}
|
|
34111
|
+
function getPaginatedItems(items, page, pageSize) {
|
|
34112
|
+
const startIndex = (page - 1) * pageSize;
|
|
34113
|
+
const endIndex = startIndex + pageSize;
|
|
34114
|
+
return items.slice(startIndex, endIndex);
|
|
34115
|
+
}
|
|
34116
|
+
function getTotalPages(totalItems, pageSize) {
|
|
34117
|
+
return Math.ceil(totalItems / pageSize);
|
|
34118
|
+
}
|
|
34119
|
+
|
|
34132
34120
|
// src/utils/schema-factory.ts
|
|
34133
34121
|
function generateCollectionSchemas(config, options2) {
|
|
34134
34122
|
const schemas = [
|
package/dist/index.js
CHANGED
|
@@ -31808,31 +31808,6 @@ ${categoryTags}`;
|
|
|
31808
31808
|
return itemXml;
|
|
31809
31809
|
}
|
|
31810
31810
|
|
|
31811
|
-
// src/utils/pagination.ts
|
|
31812
|
-
function createPagination(items, currentPage, pageSize, pagePath) {
|
|
31813
|
-
const totalItems = items.length;
|
|
31814
|
-
const totalPages = Math.ceil(totalItems / pageSize);
|
|
31815
|
-
return {
|
|
31816
|
-
currentPage,
|
|
31817
|
-
totalPages,
|
|
31818
|
-
hasNextPage: currentPage < totalPages,
|
|
31819
|
-
hasPrevPage: currentPage > 1,
|
|
31820
|
-
nextPage: currentPage < totalPages ? currentPage + 1 : null,
|
|
31821
|
-
prevPage: currentPage > 1 ? currentPage - 1 : null,
|
|
31822
|
-
pageSize,
|
|
31823
|
-
totalItems,
|
|
31824
|
-
pagePath
|
|
31825
|
-
};
|
|
31826
|
-
}
|
|
31827
|
-
function getPaginatedItems(items, page, pageSize) {
|
|
31828
|
-
const startIndex = (page - 1) * pageSize;
|
|
31829
|
-
const endIndex = startIndex + pageSize;
|
|
31830
|
-
return items.slice(startIndex, endIndex);
|
|
31831
|
-
}
|
|
31832
|
-
function getTotalPages(totalItems, pageSize) {
|
|
31833
|
-
return Math.ceil(totalItems / pageSize);
|
|
31834
|
-
}
|
|
31835
|
-
|
|
31836
31811
|
// src/generators/feeds.ts
|
|
31837
31812
|
function makeAbsoluteUrl(imageUrl, baseUrl) {
|
|
31838
31813
|
return imageUrl.startsWith("http") ? imageUrl : `${baseUrl}${imageUrl}`;
|
|
@@ -31902,10 +31877,6 @@ function generateSitemap(site, config, pageSize = 10) {
|
|
|
31902
31877
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
31903
31878
|
`;
|
|
31904
31879
|
sitemapContent += buildSitemapUrl(`${config.baseUrl}/`, currentDate, "daily", 1);
|
|
31905
|
-
const totalHomePages = getTotalPages(site.posts.length, pageSize);
|
|
31906
|
-
for (let page = 2;page <= totalHomePages; page++) {
|
|
31907
|
-
sitemapContent += buildSitemapUrl(`${config.baseUrl}/page/${page}/`, currentDate, "daily", 0.8);
|
|
31908
|
-
}
|
|
31909
31880
|
for (const post of site.posts) {
|
|
31910
31881
|
const postUrl = `${config.baseUrl}${post.url}`;
|
|
31911
31882
|
const postDate = new Date(post.date).toISOString();
|
|
@@ -31921,20 +31892,12 @@ function generateSitemap(site, config, pageSize = 10) {
|
|
|
31921
31892
|
const mostRecentPost = tagData.posts[0];
|
|
31922
31893
|
const tagPriority = mostRecentPost ? calculateFreshnessPriority(mostRecentPost.date, 0.4, now) : 0.4;
|
|
31923
31894
|
sitemapContent += buildSitemapUrl(tagUrl, currentDate, "weekly", tagPriority);
|
|
31924
|
-
const totalTagPages = getTotalPages(tagData.posts.length, pageSize);
|
|
31925
|
-
for (let page = 2;page <= totalTagPages; page++) {
|
|
31926
|
-
sitemapContent += buildSitemapUrl(`${config.baseUrl}/tags/${tagData.slug}/page/${page}/`, currentDate, "weekly", Math.max(0.3, tagPriority - 0.1));
|
|
31927
|
-
}
|
|
31928
31895
|
}
|
|
31929
31896
|
for (const [year, yearPosts] of Object.entries(site.postsByYear)) {
|
|
31930
31897
|
const currentYear = new Date().getFullYear();
|
|
31931
31898
|
const isCurrentYear = parseInt(year) === currentYear;
|
|
31932
31899
|
const yearPriority = isCurrentYear ? 0.7 : 0.5;
|
|
31933
31900
|
sitemapContent += buildSitemapUrl(`${config.baseUrl}/${year}/`, currentDate, isCurrentYear ? "weekly" : "monthly", yearPriority);
|
|
31934
|
-
const totalYearPages = getTotalPages(yearPosts.length, pageSize);
|
|
31935
|
-
for (let page = 2;page <= totalYearPages; page++) {
|
|
31936
|
-
sitemapContent += buildSitemapUrl(`${config.baseUrl}/${year}/page/${page}/`, currentDate, isCurrentYear ? "weekly" : "monthly", yearPriority - 0.1);
|
|
31937
|
-
}
|
|
31938
31901
|
}
|
|
31939
31902
|
sitemapContent += `</urlset>`;
|
|
31940
31903
|
return sitemapContent;
|
|
@@ -31973,6 +31936,31 @@ Sitemap: ${config.baseUrl}/sitemap.xml
|
|
|
31973
31936
|
var import_nunjucks = __toESM(require_nunjucks(), 1);
|
|
31974
31937
|
import path6 from "path";
|
|
31975
31938
|
|
|
31939
|
+
// src/utils/pagination.ts
|
|
31940
|
+
function createPagination(items, currentPage, pageSize, pagePath) {
|
|
31941
|
+
const totalItems = items.length;
|
|
31942
|
+
const totalPages = Math.ceil(totalItems / pageSize);
|
|
31943
|
+
return {
|
|
31944
|
+
currentPage,
|
|
31945
|
+
totalPages,
|
|
31946
|
+
hasNextPage: currentPage < totalPages,
|
|
31947
|
+
hasPrevPage: currentPage > 1,
|
|
31948
|
+
nextPage: currentPage < totalPages ? currentPage + 1 : null,
|
|
31949
|
+
prevPage: currentPage > 1 ? currentPage - 1 : null,
|
|
31950
|
+
pageSize,
|
|
31951
|
+
totalItems,
|
|
31952
|
+
pagePath
|
|
31953
|
+
};
|
|
31954
|
+
}
|
|
31955
|
+
function getPaginatedItems(items, page, pageSize) {
|
|
31956
|
+
const startIndex = (page - 1) * pageSize;
|
|
31957
|
+
const endIndex = startIndex + pageSize;
|
|
31958
|
+
return items.slice(startIndex, endIndex);
|
|
31959
|
+
}
|
|
31960
|
+
function getTotalPages(totalItems, pageSize) {
|
|
31961
|
+
return Math.ceil(totalItems / pageSize);
|
|
31962
|
+
}
|
|
31963
|
+
|
|
31976
31964
|
// src/utils/schema-factory.ts
|
|
31977
31965
|
function generateCollectionSchemas(config, options2) {
|
|
31978
31966
|
const schemas = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bunki",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.6",
|
|
4
4
|
"description": "An opinionated static site generator built with Bun featuring PostCSS integration and modern web development workflows",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"prepublishOnly": "bun run clean && bun run build && bun run test && bun run typecheck"
|
|
23
23
|
},
|
|
24
24
|
"bin": {
|
|
25
|
-
"bunki": "
|
|
25
|
+
"bunki": "dist/cli.js"
|
|
26
26
|
},
|
|
27
27
|
"keywords": [
|
|
28
28
|
"static-site-generator",
|