From a8c5b18c6a7b0d71068706fdb40bf566110af3aa Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Mon, 1 Apr 2024 17:10:23 +0300 Subject: [PATCH] lite-youtube-embed --- hugo.yml | 2 ++ package-lock.json | 14 +++++++------- package.json | 2 +- src/assets/js/lite-youtube.js | 2 +- src/layouts/partials/stylesheet.html | 9 +++++++-- src/layouts/partials/video.html | 4 +--- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/hugo.yml b/hugo.yml index cf0e7529e..314fb0a94 100644 --- a/hugo.yml +++ b/hugo.yml @@ -80,6 +80,8 @@ module: target: assets/scss/bootstrap - source: node_modules/bootstrap/dist/js/bootstrap.bundle.min.js target: assets/js/vendor/bootstrap.bundle.min.js + - source: node_modules/lite-youtube-embed/src/lite-yt-embed.css + target: assets/css/lite-yt-embed.css params: docs_version: "5.3" diff --git a/package-lock.json b/package-lock.json index ff8bb4296..fa3050902 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,6 @@ "version": "1.0.0", "license": "MIT", "devDependencies": { - "@justinribeiro/lite-youtube": "^1.5.0", "autoprefixer": "^10.4.19", "bootstrap": "^5.3.3", "clipboard": "^2.0.11", @@ -18,6 +17,7 @@ "find-unused-sass-variables": "^5.0.0", "hugo-bin": "^0.121.1", "linkinator": "^6.0.4", + "lite-youtube-embed": "^0.3.2", "lockfile-lint": "^4.13.2", "markdownlint-cli2": "^0.12.1", "npm-run-all2": "^6.1.2", @@ -426,12 +426,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/@justinribeiro/lite-youtube": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@justinribeiro/lite-youtube/-/lite-youtube-1.5.0.tgz", - "integrity": "sha512-TU92RKtz9BI9PRYrVwDIUsnFadLZtqRKWl1ZOdbxb7roJDb8Dd/xURllAsLEmCg6oJNyhXlVa5RsnUc0EKd8Cw==", - "dev": true - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -2907,6 +2901,12 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/lite-youtube-embed": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/lite-youtube-embed/-/lite-youtube-embed-0.3.2.tgz", + "integrity": "sha512-b1dgKyF4PHhinonmr3PB172Nj0qQgA/7DE9EmeIXHR1ksnFEC2olWjNJyJGdsN2cleKHRjjsmrziKlwXtPlmLQ==", + "dev": true + }, "node_modules/load-json-file": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-7.0.1.tgz", diff --git a/package.json b/package.json index 76ffa39de..172e11892 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,6 @@ "netlify": "cross-env-shell HUGO_BASEURL=$DEPLOY_PRIME_URL npm run build" }, "devDependencies": { - "@justinribeiro/lite-youtube": "^1.5.0", "autoprefixer": "^10.4.19", "bootstrap": "^5.3.3", "clipboard": "^2.0.11", @@ -43,6 +42,7 @@ "find-unused-sass-variables": "^5.0.0", "hugo-bin": "^0.121.1", "linkinator": "^6.0.4", + "lite-youtube-embed": "^0.3.2", "lockfile-lint": "^4.13.2", "markdownlint-cli2": "^0.12.1", "npm-run-all2": "^6.1.2", diff --git a/src/assets/js/lite-youtube.js b/src/assets/js/lite-youtube.js index e6d709f1e..9c81ff297 100644 --- a/src/assets/js/lite-youtube.js +++ b/src/assets/js/lite-youtube.js @@ -1 +1 @@ -import '@justinribeiro/lite-youtube' +import 'lite-youtube-embed' diff --git a/src/layouts/partials/stylesheet.html b/src/layouts/partials/stylesheet.html index 4f4805f03..d9778a6cc 100644 --- a/src/layouts/partials/stylesheet.html +++ b/src/layouts/partials/stylesheet.html @@ -5,5 +5,10 @@ {{- $sassOptions = merge $sassOptions (dict "outputStyle" "compressed") -}} {{- end -}} -{{- $style := resources.Get "scss/style.scss" | toCSS $sassOptions | postCSS $postcssOptions | fingerprint }} - +{{- $style := resources.Get "scss/style.scss" | toCSS $sassOptions -}} +{{- $lye := resources.Get "css/lite-yt-embed.css" -}} +{{- if hugo.IsProduction -}} + {{- $lye = $lye | minify -}} +{{- end -}} +{{- $styles := slice $style $lye | resources.Concat "/assets/css/styles.css" | postCSS $postcssOptions | fingerprint }} + diff --git a/src/layouts/partials/video.html b/src/layouts/partials/video.html index c013dbced..45c1ddaff 100644 --- a/src/layouts/partials/video.html +++ b/src/layouts/partials/video.html @@ -5,7 +5,5 @@ {{- $videoStart := .context.Params.video_start -}}
- - Watch on YouTube" - +