opentwig 1.0.3 → 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opentwig",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "opentwig 🌿 is an open source link in bio page generator.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -37,7 +37,7 @@
37
37
  "homepage": "https://github.com/tufantunc/opentwig#readme",
38
38
  "dependencies": {
39
39
  "autoprefixer": "^10.4.21",
40
- "html-minifier": "^4.0.0",
40
+ "html-minifier-terser": "^7.2.0",
41
41
  "postcss": "^8.5.6",
42
42
  "postcss-minify": "^1.2.0",
43
43
  "qrcode": "^1.5.4",
@@ -20,7 +20,7 @@ const buildPage = async (config) => {
20
20
  const theme = loadTheme(config);
21
21
 
22
22
  // Generate HTML
23
- const html = generateHTML(config, theme);
23
+ const html = await generateHTML(config, theme);
24
24
 
25
25
  // Process CSS (async)
26
26
  const css = await processCSS(config);
@@ -1,14 +1,13 @@
1
- const htmlMinifier = require('html-minifier');
1
+ const htmlMinifier = require('html-minifier-terser');
2
2
 
3
- module.exports = function(config, theme) {
3
+ module.exports = async function(config, theme) {
4
4
  let html = theme(config);
5
5
 
6
6
  if (config.minify) {
7
- const minifiedHtml = htmlMinifier.minify(html, {
7
+ const minifiedHtml = await htmlMinifier.minify(html, {
8
8
  removeComments: true,
9
9
  collapseWhitespace: true,
10
10
  minifyCSS: true,
11
- minifyJS: true
12
11
  });
13
12
  html = minifiedHtml;
14
13
  }
@@ -4,7 +4,7 @@ module.exports = function({share}) {
4
4
  }
5
5
 
6
6
  return `
7
- <button class="icon-btn" aria-label="Share" onclick="() => navigator.share({ url: location.href, title:'${share.title}', text:'${share.text}' })">
7
+ <button class="icon-btn" type="button" aria-label="Share" onclick="navigator.share({ url: location.href, title:'${share.title}', text:'${share.text}' })">
8
8
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12v7a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-7"/><polyline points="16 6 12 2 8 6"/><line x1="12" y1="2" x2="12" y2="15"/></svg>
9
9
  </button>
10
10
  `;