Merge upstream changes
Some checks failed
Build and Deploy Test Version (with Drafts) - next.asandikci.com / build-drafts-and-deploy (push) Failing after 1m57s

This commit is contained in:
Aliberk Sandıkçı 2024-12-01 15:12:37 +03:00
commit b0bfb363ae
Signed by: asandikci
GPG key ID: A3B47D76845BEDF3
3 changed files with 25 additions and 14 deletions

View file

@ -133,10 +133,10 @@
<!-- Scripts -->
{% unless site.theme_mode %}
<script src="{{ '/assets/js/dist/theme.min.js' | relative_url }}"></script>
{% endunless %} {% include js-selector.html lang=lang %} {% if
jekyll.environment == 'production' %}
{% include js-selector.html lang=lang %} {% if jekyll.environment ==
'production' %}
<!-- PWA -->
{% if site.pwa.enabled %}
<script
@ -145,6 +145,12 @@
></script>
{% endif %}
<!-- Web Analytics -->
{% for analytics in site.analytics %} {% capture str %}{{ analytics }}{%
endcapture %} {% assign platform = str | split: '{' | first %} {% if
site.analytics[platform].id and site.analytics[platform].id != empty %} {%
include analytics/{{ platform }}.html %} {% endif %} {% endfor %} {% endif %}
<!-- Web Analytics -->
{% for analytics in site.analytics %} {% capture str %}{{ analytics }}{%
endcapture %} {% assign platform = str | split: '{' | first %} {% if

View file

@ -1,6 +1,7 @@
<!-- Display GoatCounter pageviews -->
<script>
let pv = document.getElementById('pageviews');
document.addEventListener('DOMContentLoaded', () => {
const pv = document.getElementById('pageviews');
if (pv !== null) {
const uri = location.pathname.replace(/\/$/, '');
@ -16,4 +17,5 @@
pv.innerText = '1';
});
}
});
</script>

View file

@ -11,11 +11,11 @@ const DIST = 'assets/js/dist';
const banner = `/*!
* ${pkg.name} v${pkg.version} | © ${pkg.since} ${pkg.author} | ${pkg.license} Licensed | ${pkg.homepage}
*/`;
const frontmatter = `---\npermalink: /:basename\n---\n`;
const isProd = process.env.BUILD === 'production';
let hasWatched = false;
function cleanup() {
fs.rmSync(DIST, { recursive: true, force: true });
console.log(`> Directory "${DIST}" has been cleaned.`);
@ -39,6 +39,11 @@ function build(
{ src = SRC_DEFAULT, jekyll = false, outputName = null } = {}
) {
const input = `${src}/${filename}.js`;
const shouldWatch = hasWatched ? false : true;
if (!hasWatched) {
hasWatched = true;
}
return {
input,
@ -49,9 +54,7 @@ function build(
banner,
sourcemap: !isProd && !jekyll
},
watch: {
include: input
},
...(shouldWatch && { watch: { include: `${SRC_DEFAULT}/**/*.js` } }),
plugins: [
babel({
babelHelpers: 'bundled',