From 5dbda0c09f3f03d5c42ba48a3f6698464443bd3e Mon Sep 17 00:00:00 2001 From: Dongee Seo <74766722+seod0209@users.noreply.github.com> Date: Sun, 25 Feb 2024 21:30:21 +0900 Subject: [PATCH 01/64] build(deps-dev): replace the deprecated libraries (#1559) Replace `@babel/plugin-proposal-class-properties` with `@babel/plugin-transform-class-properties` See: https://www.npmjs.com/package/@babel/plugin-proposal-class-properties --- package.json | 2 +- rollup.config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9ba42ffad70..dc5603b3534 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ }, "devDependencies": { "@babel/core": "^7.23.9", - "@babel/plugin-proposal-class-properties": "^7.18.6", + "@babel/plugin-transform-class-properties": "^7.23.3", "@babel/preset-env": "^7.23.9", "@commitlint/cli": "^18.6.1", "@commitlint/config-conventional": "^18.6.2", diff --git a/rollup.config.js b/rollup.config.js index 7f2d14a6101..6226080c26f 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -23,7 +23,7 @@ function build(filename) { babel({ babelHelpers: 'bundled', presets: ['@babel/env'], - plugins: ['@babel/plugin-proposal-class-properties'] + plugins: ['@babel/plugin-transform-class-properties'] }), license({ banner: { From b641b3f1f2e54bcfe96d8dff46d4f94186492d98 Mon Sep 17 00:00:00 2001 From: Alexander Fuks Date: Sun, 25 Feb 2024 22:50:41 +0400 Subject: [PATCH 02/64] feat(analytics)!: add post pageviews for GoatCounter (#1543) --------- Co-authored-by: Cotes Chung <11371340+cotes2020@users.noreply.github.com> --- _config.yml | 15 +++++++++----- _includes/analytics/goatcounter.html | 6 ++++++ _includes/analytics/google.html | 13 ++++++++++++ _includes/goatcounter.html | 8 ------- _includes/google-analytics.html | 14 ------------- _includes/head.html | 2 +- _includes/js-selector.html | 31 ++++++++++++++++++++-------- _includes/pageviews/goatcounter.html | 18 ++++++++++++++++ _layouts/post.html | 18 ++++++++++++---- _sass/layout/post.scss | 2 +- 10 files changed, 85 insertions(+), 42 deletions(-) create mode 100644 _includes/analytics/goatcounter.html create mode 100644 _includes/analytics/google.html delete mode 100644 _includes/goatcounter.html delete mode 100644 _includes/google-analytics.html create mode 100644 _includes/pageviews/goatcounter.html diff --git a/_config.yml b/_config.yml index 79d451fe0c1..79f153d5603 100644 --- a/_config.yml +++ b/_config.yml @@ -49,11 +49,16 @@ google_site_verification: # fill in to your verification string # ↑ -------------------------- # The end of `jekyll-seo-tag` settings -google_analytics: - id: # fill in your Google Analytics ID - -goatcounter: - id: # fill in your Goatcounter ID +# Web Analytics Settings +analytics: + google: + id: # fill in your Google Analytics ID + goatcounter: + id: # fill in your GoatCounter ID + +# Pageviews settings +pageviews: + provider: # now only supports 'goatcounter' # Prefer color scheme setting. # diff --git a/_includes/analytics/goatcounter.html b/_includes/analytics/goatcounter.html new file mode 100644 index 00000000000..78c90b72682 --- /dev/null +++ b/_includes/analytics/goatcounter.html @@ -0,0 +1,6 @@ + + diff --git a/_includes/analytics/google.html b/_includes/analytics/google.html new file mode 100644 index 00000000000..d0aac651c22 --- /dev/null +++ b/_includes/analytics/google.html @@ -0,0 +1,13 @@ + + + diff --git a/_includes/goatcounter.html b/_includes/goatcounter.html deleted file mode 100644 index 4d21d21ec38..00000000000 --- a/_includes/goatcounter.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/_includes/google-analytics.html b/_includes/google-analytics.html deleted file mode 100644 index e5e5119e555..00000000000 --- a/_includes/google-analytics.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/_includes/head.html b/_includes/head.html index 9bad78a729d..7c093597b71 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -72,7 +72,7 @@ {% endif %} - {% if jekyll.environment == 'production' and site.google_analytics.id != empty and site.google_analytics.id %} + {% if jekyll.environment == 'production' and site.analytics.google.id != empty and site.analytics.google.id %} diff --git a/_includes/js-selector.html b/_includes/js-selector.html index 1a1fa580bb7..b37d7103fff 100644 --- a/_includes/js-selector.html +++ b/_includes/js-selector.html @@ -95,19 +95,32 @@ {% endif %} + +{% if page.layout == 'post' %} + {% assign provider = site.pageviews.provider %} + + {% if provider and provider != empty %} + {% case provider %} + {% when 'goatcounter' %} + {% if site.analytics[provider].id != empty and site.analytics[provider].id %} + {% include pageviews/{{ provider }}.html %} + {% endif %} + {% endcase %} + {% endif %} +{% endif %} + {% if jekyll.environment == 'production' %} {% if site.pwa.enabled %} {% endif %} - - {% if site.google_analytics.id != empty and site.google_analytics.id %} - {% include google-analytics.html %} - {% endif %} - - - {% if site.goatcounter.id != empty and site.goatcounter.id %} - {% include goatcounter.html %} - {% endif %} + + {% for analytics in site.analytics %} + {% capture str %}{{ analytics }}{% endcapture %} + {% assign type = str | split: '{' | first %} + {% if site.analytics[type].id and site.analytics[type].id != empty %} + {% include analytics/{{ type }}.html %} + {% endif %} + {% endfor %} {% endif %} diff --git a/_includes/pageviews/goatcounter.html b/_includes/pageviews/goatcounter.html new file mode 100644 index 00000000000..af536dbdd7c --- /dev/null +++ b/_includes/pageviews/goatcounter.html @@ -0,0 +1,18 @@ + + diff --git a/_layouts/post.html b/_layouts/post.html index f7818bf6e0f..f666d71642c 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -74,12 +74,22 @@

{{ page.title }}

- - {% include read-time.html content=content prompt=true lang=lang %} +
+ + {% if site.pageviews.provider and site.analytics[site.pageviews.provider].id %} + + + + + {{ site.data.locales[lang].post.pageview_measure }} + + {% endif %} + + + {% include read-time.html content=content prompt=true lang=lang %} +
- -
diff --git a/_sass/layout/post.scss b/_sass/layout/post.scss index efbde822686..a6dc878cfea 100644 --- a/_sass/layout/post.scss +++ b/_sass/layout/post.scss @@ -15,7 +15,7 @@ } h1 + .post-meta { - > span + span::before { + span + span::before { @include dot; } From e4363871b5be0608d2b92b8aff482825a8044c1b Mon Sep 17 00:00:00 2001 From: Alexander Fuks Date: Mon, 26 Feb 2024 18:17:18 +0400 Subject: [PATCH 03/64] feat: change site verification settings (#1561) --- _config.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index 79f153d5603..215c6180385 100644 --- a/_config.yml +++ b/_config.yml @@ -44,7 +44,14 @@ social: # - https://www.facebook.com/username # - https://www.linkedin.com/in/username -google_site_verification: # fill in to your verification string +# Site Verification Settings +webmaster_verifications: + google: # fill in your Google verification code + bing: # fill in your Bing verification code + alexa: # fill in your Alexa verification code + yandex: # fill in your Yandex verification code + baidu: # fill in your Baidu verification code + facebook: # fill in your Facebook verification code # ↑ -------------------------- # The end of `jekyll-seo-tag` settings From f8390d4384600fb015728b1b186570fa58ca216f Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Tue, 27 Feb 2024 01:39:04 +0800 Subject: [PATCH 04/64] perf!: rename comment setting parameter (#1563) Rename `site.comments.active` to `site.comments.provider` --- _config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/_config.yml b/_config.yml index 215c6180385..aaaa2ad42fd 100644 --- a/_config.yml +++ b/_config.yml @@ -98,8 +98,9 @@ social_preview_image: # string, local or CORS resources toc: true comments: - active: # The global switch for posts comments, e.g., 'disqus'. Keep it empty means disable - # The active options are as follows: + # Global switch for the post comment system. Keeping it empty means disabled. + provider: # [disqus | utterances | giscus] + # The provider options are as follows: disqus: shortname: # fill with the Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname # utterances settings › https://utteranc.es/ From 9592146ca392236e69ee358412ecc32ef1662127 Mon Sep 17 00:00:00 2001 From: Alexander Fuks Date: Wed, 28 Feb 2024 00:51:33 +0400 Subject: [PATCH 05/64] feat: add support for embed video files (#1558) --- _includes/embed/bilibili.html | 7 +++-- _includes/embed/video.html | 38 +++++++++++++++++++++++++++ _includes/embed/youtube.html | 2 +- _posts/2019-08-08-write-a-new-post.md | 27 +++++++++++++++++++ _sass/addon/commons.scss | 18 +++++++++---- 5 files changed, 82 insertions(+), 10 deletions(-) create mode 100644 _includes/embed/video.html diff --git a/_includes/embed/bilibili.html b/_includes/embed/bilibili.html index eaa09d84607..0aa5552ddfe 100644 --- a/_includes/embed/bilibili.html +++ b/_includes/embed/bilibili.html @@ -1,10 +1,9 @@ \ No newline at end of file +> diff --git a/_includes/embed/video.html b/_includes/embed/video.html new file mode 100644 index 00000000000..eb46c257a84 --- /dev/null +++ b/_includes/embed/video.html @@ -0,0 +1,38 @@ +{% assign video_url = include.src %} +{% assign poster_url = include.poster %} + +{% unless video_url contains '://' %} + {%- capture video_url -%} + {% include img-url.html src=video_url img_path=page.img_path %} + {%- endcapture -%} +{% endunless %} + +{% if poster_url %} + {% unless poster_url contains '://' %} + {%- capture poster_url -%} + {% include img-url.html src=poster_url img_path=page.img_path %} + {%- endcapture -%} + {% endunless %} + {% assign poster = 'poster="' | append: poster_url | append: '"' %} +{% endif %} + +{% assign attributes = 'controls' %} + +{% if include.autoplay %} + {% assign attributes = attributes | append: ' ' | append: 'autoplay' %} +{% endif %} + +{% if include.loop %} + {% assign attributes = attributes | append: ' ' | append: 'loop' %} +{% endif %} + +{% if include.muted %} + {% assign attributes = attributes | append: ' ' | append: 'muted' %} +{% endif %} + +

+ + {{ include.title }} +

diff --git a/_includes/embed/youtube.html b/_includes/embed/youtube.html index 640011f885d..8f080021cc4 100644 --- a/_includes/embed/youtube.html +++ b/_includes/embed/youtube.html @@ -1,5 +1,5 @@