Skip to content

Commit a1c4c67

Browse files
committed
Github-&-build-bug-fix
1 parent fb00950 commit a1c4c67

9 files changed

Lines changed: 37 additions & 13 deletions

File tree

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

โ€Žclient/build/index.htmlโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<link href="https://fonts.googleapis.com/css2?family=Exile&display=swap" rel="stylesheet">
1212
<link href="https://fonts.googleapis.com/css2?family=PT+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
1313
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" integrity="sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
14-
<script type="module" crossorigin src="./assets/main-DmI72XeM.js"></script>
14+
<script type="module" crossorigin src="./assets/main-CXwJOhlR.js"></script>
1515
<link rel="stylesheet" crossorigin href="./assets/main-CAT263re.css">
1616
</head>
1717
<body class="waves">

โ€Žclient/build/pages/cart.htmlโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<link href="https://fonts.googleapis.com/css2?family=Exile&display=swap" rel="stylesheet">
1212
<link href="https://fonts.googleapis.com/css2?family=PT+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
1313
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" integrity="sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
14-
<script type="module" crossorigin src="../assets/main-DmI72XeM.js"></script>
14+
<script type="module" crossorigin src="../assets/main-CXwJOhlR.js"></script>
1515
<link rel="stylesheet" crossorigin href="../assets/main-CAT263re.css">
1616
</head>
1717
<body class="waves">

โ€Žclient/build/pages/catalog.htmlโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<link href="https://fonts.googleapis.com/css2?family=Monoton&display=swap" rel="stylesheet">
1111
<link href="https://fonts.googleapis.com/css2?family=Exile&display=swap" rel="stylesheet">
1212
<link href="https://fonts.googleapis.com/css2?family=PT+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
13-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" integrity="sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <script type="module" crossorigin src="../assets/main-DmI72XeM.js"></script>
13+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" integrity="sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <script type="module" crossorigin src="../assets/main-CXwJOhlR.js"></script>
1414
<link rel="stylesheet" crossorigin href="../assets/main-CAT263re.css">
1515
</head>
1616
<body class="waves">

โ€Žclient/build/pages/contact.htmlโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<link href="https://fonts.googleapis.com/css2?family=Exile&display=swap" rel="stylesheet">
1212
<link href="https://fonts.googleapis.com/css2?family=PT+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
1313
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" integrity="sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
14-
<script type="module" crossorigin src="../assets/main-DmI72XeM.js"></script>
14+
<script type="module" crossorigin src="../assets/main-CXwJOhlR.js"></script>
1515
<link rel="stylesheet" crossorigin href="../assets/main-CAT263re.css">
1616
</head>
1717
<body class="waves">

โ€Žclient/build/pages/login.htmlโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<link href="https://fonts.googleapis.com/css2?family=Exile&display=swap" rel="stylesheet">
1212
<link href="https://fonts.googleapis.com/css2?family=PT+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
1313
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" integrity="sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
14-
<script type="module" crossorigin src="../assets/main-DmI72XeM.js"></script>
14+
<script type="module" crossorigin src="../assets/main-CXwJOhlR.js"></script>
1515
<link rel="stylesheet" crossorigin href="../assets/main-CAT263re.css">
1616
</head>
1717
<body class="waves">

โ€Žclient/build/pages/product.htmlโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<link href="https://fonts.googleapis.com/css2?family=Exile&display=swap" rel="stylesheet">
1212
<link href="https://fonts.googleapis.com/css2?family=PT+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
1313
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" integrity="sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
14-
<script type="module" crossorigin src="../assets/main-DmI72XeM.js"></script>
14+
<script type="module" crossorigin src="../assets/main-CXwJOhlR.js"></script>
1515
<link rel="stylesheet" crossorigin href="../assets/main-CAT263re.css">
1616
</head>
1717
<body class="waves">

โ€Žclient/build/pages/wishlist.htmlโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<link href="https://fonts.googleapis.com/css2?family=Exile&display=swap" rel="stylesheet">
1212
<link href="https://fonts.googleapis.com/css2?family=PT+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
1313
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" integrity="sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
14-
<script type="module" crossorigin src="../assets/main-DmI72XeM.js"></script>
14+
<script type="module" crossorigin src="../assets/main-CXwJOhlR.js"></script>
1515
<link rel="stylesheet" crossorigin href="../assets/main-CAT263re.css">
1616
</head>
1717
<body class="waves">

โ€Žclient/src/main.jsโ€Ž

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,36 @@ document.addEventListener('DOMContentLoaded', () => {
9494
// ืื—ืจืช (ืœื™ื™ื‘ ืกืจื‘ืจ ืžืงื•ืžื™ ืื• ืกื‘ื™ื‘ื” ืื—ืจืช): ../
9595
const basePath = isGitHubPages ? `/${githubRepo}/` : '/';
9696

97+
function fixPath(path, repo) {
98+
if (path && path.startsWith('/')) {
99+
return `/${repo}${path}`;
100+
}
101+
return path;
102+
}
103+
97104
//?: ื”ื›ื ืกืช ืžื•ืฆืจื™ื ืžืชื•ืš ื’'ื™ื™ืกื•ืŸ ืœืงื˜ืœื•ื’ ืื•ืคื ื•ืขื™ื
98105
fetch(`${basePath}data/data.json`)
99106
.then(response => response.json())
100-
.then(products => {
101-
107+
.then(data => {
108+
if (isGitHubPages) {
109+
data = data.map(item => {
110+
// ืชื™ืงื•ืŸ ืชืžื•ื ื” ืจืืฉื™ืช
111+
item.image = fixPath(item.image, githubRepo);
112+
113+
// ืชื™ืงื•ืŸ ืœื•ื’ื•
114+
item.logo = fixPath(item.logo, githubRepo);
115+
116+
// ืชื™ืงื•ืŸ ื›ืœ ื”ืชืžื•ื ื•ืช ื‘ืžืขืจืš
117+
if (Array.isArray(item.images)) {
118+
item.images = item.images.map(img => fixPath(img, githubRepo));
119+
}
102120

121+
return item;
122+
});
123+
}
124+
return data;
125+
})
126+
.then(products => {
103127
// ื‘ื“ื™ืงืช ื›ืžื•ืช ืžื•ืฆืจื™ื ื‘ืืชืจ
104128
let productsNumbersTotal = 0;
105129
products.forEach(() => productsNumbersTotal++);

0 commit comments

Comments
ย (0)