pug-site-core 3.0.2 → 3.0.3

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.
Files changed (2) hide show
  1. package/lib/generate.js +11 -11
  2. package/package.json +2 -2
package/lib/generate.js CHANGED
@@ -309,7 +309,7 @@ export async function fetchDataToJsonFile(args) {
309
309
  await checkData(data, language, obj.getDataFn);
310
310
  let outPutPath = obj.outPutPath.split("/").join(pathSymbol);
311
311
  if (Array.isArray(data)) {
312
- let name = outPutPath.split(pathSymbol).pop().replace(/\..*$/, "");
312
+ let name = outPutPath.split(pathSymbol).pop().replace(/\.[^.]*$/, "");
313
313
  const regex = /^\[.+\]$/;
314
314
  if (regex.test(name)) {
315
315
  let property = name.slice(1, -1);
@@ -508,14 +508,14 @@ export async function buildStatic() {
508
508
  let htmlPath
509
509
  try {
510
510
  if (fileName) {
511
- htmlPath = paths.resolveRoot(
512
- distOutputPath,
513
- lang,
514
- outputPath.replace(
515
- outputPath.split("/").pop().replace(/\..*$/, ""),
516
- fileName.replace(/\..*$/, "")
517
- )
518
- );
511
+ htmlPath = paths.resolveRoot(
512
+ distOutputPath,
513
+ lang,
514
+ outputPath.replace(
515
+ outputPath.split("/").pop().replace(/\.[^.]*$/, ""),
516
+ fileName.replace(/\.[^.]*$/, "")
517
+ )
518
+ );
519
519
  } else {
520
520
  htmlPath = paths.resolveRoot(distOutputPath, lang, outputPath);
521
521
  }
@@ -550,7 +550,7 @@ export async function buildStatic() {
550
550
  */
551
551
  async function processArrayData(pagesPugToFn, data, obj, funName, pagePath, commonData, lang) {
552
552
  try {
553
- const name = obj.outPutHtmlPath.split("/").pop().replace(/\..*$/, "");
553
+ const name = obj.outPutHtmlPath.split("/").pop().replace(/\.[^.]*$/, "");
554
554
  const regex = /^\[.+\]$/;
555
555
 
556
556
  if (regex.test(name)) {
@@ -673,7 +673,7 @@ export async function buildStatic() {
673
673
  const htmlPath = paths.resolveRoot(
674
674
  distOutputPath,
675
675
  lang,
676
- finalPugTemplate.replace(/\..*$/, ".html")
676
+ finalPugTemplate.replace(/\.[^.]*$/, ".html")
677
677
  );
678
678
  console.log(htmlPath);
679
679
  await fse.outputFile(htmlPath, html);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pug-site-core",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -51,7 +51,7 @@
51
51
  "ws": "^8.18.0"
52
52
  },
53
53
  "license": "ISC",
54
- "description": "优化静态html打包的log、并优化默认下载数据线程",
54
+ "description": "修复对带.符号的文件名处理",
55
55
  "files": [
56
56
  "lib/",
57
57
  "index.js"