From 84ea68cab0c09492162aa9672421bca16651e689 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 Dec 2023 03:43:38 +0800 Subject: [PATCH 01/13] build(deps-dev): bump the npm group with 3 updates (#1399) Updates the requirements on [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core), [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) and [rollup](https://github.com/rollup/rollup) to permit the latest version. Updates `@babel/core` to 7.23.5 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.5/packages/babel-core) Updates `@babel/preset-env` to 7.23.5 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.5/packages/babel-preset-env) Updates `rollup` to 4.6.1 - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](https://github.com/rollup/rollup/compare/v4.3.0...v4.6.1) --- updated-dependencies: - dependency-name: "@babel/core" dependency-type: direct:development dependency-group: npm - dependency-name: "@babel/preset-env" dependency-type: direct:development dependency-group: npm - dependency-name: rollup dependency-type: direct:development dependency-group: npm ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 181159e..0f8cfc0 100644 --- a/package.json +++ b/package.json @@ -21,13 +21,13 @@ "fixlint": "npm run test -- --fix" }, "devDependencies": { - "@babel/core": "^7.23.2", + "@babel/core": "^7.23.5", "@babel/plugin-proposal-class-properties": "^7.18.6", - "@babel/preset-env": "^7.23.2", + "@babel/preset-env": "^7.23.5", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-terser": "^0.4.4", "rimraf": "^5.0.5", - "rollup": "^4.3.0", + "rollup": "^4.6.1", "rollup-plugin-license": "^3.2.0", "stylelint": "^15.11.0", "stylelint-config-standard-scss": "^11.1.0" From 2a4fbf6a7925da610a75c498116da7cf9ba857d7 Mon Sep 17 00:00:00 2001 From: Chuck Houpt Date: Wed, 6 Dec 2023 09:38:11 -0500 Subject: [PATCH 02/13] fix: url-less authors should not have empty links (#1410) The url field from authors.yml is optional, so no link should be build when the url is empty or not defined. Fix #1403 --- _layouts/post.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/_layouts/post.html b/_layouts/post.html index 4dd9efc..f7818bf 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -61,7 +61,11 @@ tail_includes: {% if authors %} {% for author in authors %} - {{ site.data.authors[author].name }} + {% if site.data.authors[author].url -%} + {{ site.data.authors[author].name }} + {%- else -%} + {{ site.data.authors[author].name }} + {%- endif %} {% unless forloop.last %}{{ ', ' }}{% endunless %} {% endfor %} {% else %} From 4a2b89d0b698d672486349131a89025fa47afcb6 Mon Sep 17 00:00:00 2001 From: Mill Haruto Date: Sat, 9 Dec 2023 21:48:19 +0800 Subject: [PATCH 03/13] feat: add bilibili embed video support (#1406) --------- Co-authored-by: Cotes Chung <11371340+cotes2020@users.noreply.github.com> --- _includes/embed/bilibili.html | 10 ++++++++++ _posts/2019-08-08-write-a-new-post.md | 11 +++++------ _sass/addon/commons.scss | 3 ++- 3 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 _includes/embed/bilibili.html diff --git a/_includes/embed/bilibili.html b/_includes/embed/bilibili.html new file mode 100644 index 0000000..eaa09d8 --- /dev/null +++ b/_includes/embed/bilibili.html @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/_posts/2019-08-08-write-a-new-post.md b/_posts/2019-08-08-write-a-new-post.md index 1da7b0d..9240f05 100644 --- a/_posts/2019-08-08-write-a-new-post.md +++ b/_posts/2019-08-08-write-a-new-post.md @@ -424,12 +424,11 @@ Where `Platform` is the lowercase of the platform name, and `ID` is the video ID The following table shows how to get the two parameters we need in a given video URL, and you can also know the currently supported video platforms. -| Video URL | Platform | ID | -|----------------------------------------------------------------------------------------------------|-----------|:--------------| -| [https://www.**youtube**.com/watch?v=**H-B46URT4mg**](https://www.youtube.com/watch?v=H-B46URT4mg) | `youtube` | `H-B46URT4mg` | -| [https://www.**twitch**.tv/videos/**1634779211**](https://www.twitch.tv/videos/1634779211) | `twitch` | `1634779211` | - - +| Video URL | Platform | ID | +| -------------------------------------------------------------------------------------------------- | ---------- | :------------- | +| [https://www.**youtube**.com/watch?v=**H-B46URT4mg**](https://www.youtube.com/watch?v=H-B46URT4mg) | `youtube` | `H-B46URT4mg` | +| [https://www.**twitch**.tv/videos/**1634779211**](https://www.twitch.tv/videos/1634779211) | `twitch` | `1634779211` | +| [https://www.**bilibili**.com/video/**BV1Q44y1B7Wf**](https://www.bilibili.com/video/BV1Q44y1B7Wf) | `bilibili` | `BV1Q44y1B7Wf` | ## Learn More diff --git a/_sass/addon/commons.scss b/_sass/addon/commons.scss index 78b7a89..c50bbff 100644 --- a/_sass/addon/commons.scss +++ b/_sass/addon/commons.scss @@ -551,7 +551,8 @@ main { @extend %rounded; - &.youtube { + &.youtube, + &.bilibili { aspect-ratio: 16 / 9; } From c45e0311552e320417bb3d6cab4296d678e14037 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Wed, 27 Dec 2023 23:56:39 +0800 Subject: [PATCH 04/13] build(deps): specify the minor version number of ruby (#1431) Resolves #1429 --- .github/workflows/ci.yml | 6 +++++- .github/workflows/pages-deploy.yml.hook | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee81876..c7b1f5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,10 @@ jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + ruby: ["3.0", "3.1", "3.2"] + steps: - name: Checkout uses: actions/checkout@v4 @@ -28,7 +32,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 3 + ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Setup Node diff --git a/.github/workflows/pages-deploy.yml.hook b/.github/workflows/pages-deploy.yml.hook index 87089c9..0d884bc 100644 --- a/.github/workflows/pages-deploy.yml.hook +++ b/.github/workflows/pages-deploy.yml.hook @@ -42,7 +42,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 3 + ruby-version: 3.2 bundler-cache: true - name: Build site From 746a31e125d6e934e84c67e531c891e79bbdd3a3 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sun, 31 Dec 2023 16:10:25 +0800 Subject: [PATCH 05/13] build(workflow): add more stale exemption labels (#1435) New exemption labels: - planning - in progress --- .github/workflows/stale.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index f54eb5a..de1f407 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -8,6 +8,14 @@ permissions: issues: write pull-requests: write +env: + STALE_LABEL: stale + EXEMPT_LABELS: "pending,planning,in progress" + MESSAGE: > + This conversation has been automatically marked as stale because it has not had recent activity. + It will be closed if no further activity occurs. + Thank you for your contributions. + jobs: stale: runs-on: ubuntu-latest @@ -16,15 +24,9 @@ jobs: with: days-before-stale: 30 days-before-close: 1 - stale-issue-label: stale - exempt-issue-labels: pending - stale-issue-message: > - This issue has been automatically marked as stale because it has not had recent activity. - It will be closed if no further activity occurs. - Thank you for your contributions. - stale-pr-label: stale - exempt-pr-labels: pending - stale-pr-message: > - This PR has been automatically marked as stale because it has not had recent activity. - It will be closed if no further activity occurs. - Thank you for your contributions. + stale-issue-label: ${{ env.STALE_LABEL }} + exempt-issue-labels: ${{ env.EXEMPT_LABELS }} + stale-issue-message: ${{ env.MESSAGE }} + stale-pr-label: ${{ env.STALE_LABEL }} + exempt-pr-labels: ${{ env.EXEMPT_LABELS }} + stale-pr-message: ${{ env.MESSAGE }} From 5234511a2f4b215acca3f580bb53ac6507e82dd6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 19:52:24 +0000 Subject: [PATCH 06/13] build(deps): bump the gh-actions group with 2 updates (#1448) --- .github/workflows/codeql.yml | 6 +++--- .github/workflows/stale.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 769e9c8..c194d8b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -29,16 +29,16 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: "${{ matrix.language }}" # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 with: category: "/language:${{ matrix.language }}" diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index de1f407..7edeb75 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -20,7 +20,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v8 + - uses: actions/stale@v9 with: days-before-stale: 30 days-before-close: 1 From ea2d238bd8adc018256862e05a5092311c87a671 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Tue, 2 Jan 2024 18:24:37 +0800 Subject: [PATCH 07/13] fix: image float breaks quotes and prompts (#1449) Fixes #1441 --- _sass/addon/commons.scss | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/_sass/addon/commons.scss b/_sass/addon/commons.scss index c50bbff..f53e0cb 100644 --- a/_sass/addon/commons.scss +++ b/_sass/addon/commons.scss @@ -85,6 +85,7 @@ blockquote { border-left: 5px solid var(--blockquote-border-color); padding-left: 1rem; color: var(--blockquote-text-color); + display: flex; &[class^='prompt-'] { border-left: 0; @@ -641,12 +642,12 @@ main { .left { float: left; - margin: 0.75rem 1rem 1rem 0 !important; + margin: 0.75rem 1rem 1rem 0; } .right { float: right; - margin: 0.75rem 0 1rem 1rem !important; + margin: 0.75rem 0 1rem 1rem; } /* --- Overriding --- */ From d420b3832922cb4e979d5ea89b9325eecb0da4d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Jan 2024 09:28:03 +0000 Subject: [PATCH 08/13] build(deps-dev): bump the npm group with 5 updates (#1447) --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 0f8cfc0..9bc2f07 100644 --- a/package.json +++ b/package.json @@ -21,16 +21,16 @@ "fixlint": "npm run test -- --fix" }, "devDependencies": { - "@babel/core": "^7.23.5", + "@babel/core": "^7.23.7", "@babel/plugin-proposal-class-properties": "^7.18.6", - "@babel/preset-env": "^7.23.5", + "@babel/preset-env": "^7.23.7", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-terser": "^0.4.4", "rimraf": "^5.0.5", - "rollup": "^4.6.1", + "rollup": "^4.9.2", "rollup-plugin-license": "^3.2.0", - "stylelint": "^15.11.0", - "stylelint-config-standard-scss": "^11.1.0" + "stylelint": "^16.1.0", + "stylelint-config-standard-scss": "^12.0.0" }, "prettier": { "trailingComma": "none" From f243cbd8584212adc53c4ac2525669004fdbc986 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sat, 6 Jan 2024 19:15:31 +0800 Subject: [PATCH 09/13] docs: update the credits section in README --- README.md | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 4ee1d6c..16d6ab1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg)][license]  [![996.icu](https://img.shields.io/badge/link-996.icu-%23FF4D5B.svg)](https://996.icu) - [**Live Demo →**][demo] + [**Live Demo** →][demo] [![Devices Mockup](https://chirpy-img.netlify.app/commons/devices-mockup.png)][demo] @@ -18,10 +18,6 @@ ## Features -
- Click to expand/close details -   - - Dark / Light Theme Mode - Localized UI language - Pinned Posts on Home Page @@ -41,8 +37,6 @@ - Google Analytics - SEO & Performance Optimization -
- ## Documentation To learn how to use, develop, and upgrade the project, please refer to the [Wiki][wiki]. @@ -55,22 +49,18 @@ For details, see the "[Contributing Guidelines][contribute-guide]". ## Credits -This project was built primarily with the [Jekyll][jekyllrb] ecosystem, -[Bootstrap][bootstrap], [Font Awesome][icons], and some other [wonderful tools][lib]. -The avatar and favicon design from [Clipart Max][image]. +### Contributors -Many thanks to the [contributors][contributors] who participated in the development -and to the folks who reported bugs or shared ideas. +Thanks to [all the contributors][contributors] involved in the development of the project! -Last but not least, thanks to [JetBrains][jetbrains] for providing the _Open Source License_. +[![all-contributors](https://contrib.rocks/image?repo=cotes2020/jekyll-theme-chirpy&columns=16)][contributors] + —— Made with [contrib.rocks](https://contrib.rocks) -## Sponsoring +### Third-Party Assets -If you like this project or have built something through it, please consider sponsoring it, and your support would be greatly appreciated. +This project is built on the [Jekyll][jekyllrb] ecosystem and some [great libraries][lib], and is developed using [VS Code][vscode] as well as tools provided by [JetBrains][jetbrains] under a non-commercial open-source software license. -[![Ko-fi](https://img.shields.io/badge/Support_Me_on_Ko--fi-ff5e5b?logo=ko-fi&logoColor=white)][ko-fi]  -[![Wechat Pay](https://img.shields.io/badge/Support_Me_on_WeChat-brightgreen?logo=wechat&logoColor=white)][donation]  -[![Alipay](https://img.shields.io/badge/Support_Me_on_Alipay-blue?logo=alipay&logoColor=white)][donation] +The avatar and favicon for the project's website are from [ClipartMAX][clipartmax]. ## License @@ -81,14 +71,11 @@ This project is published under [MIT License][license]. [codacy]: https://app.codacy.com/gh/cotes2020/jekyll-theme-chirpy/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade [license]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE [jekyllrb]: https://jekyllrb.com/ -[bootstrap]: https://getbootstrap.com/ -[icons]: https://fontawesome.com/ -[image]: https://www.clipartmax.com/middle/m2i8b1m2K9Z5m2K9_ant-clipart-childrens-ant-cute/ +[clipartmax]: https://www.clipartmax.com/middle/m2i8b1m2K9Z5m2K9_ant-clipart-childrens-ant-cute/ [demo]: https://cotes2020.github.io/chirpy-demo/ [wiki]: https://github.com/cotes2020/jekyll-theme-chirpy/wiki [contribute-guide]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/CONTRIBUTING.md [contributors]: https://github.com/cotes2020/jekyll-theme-chirpy/graphs/contributors [lib]: https://github.com/cotes2020/chirpy-static-assets +[vscode]: https://code.visualstudio.com/ [jetbrains]: https://www.jetbrains.com/?from=jekyll-theme-chirpy -[ko-fi]: https://ko-fi.com/coteschung/ -[donation]: https://sponsor.cotes.page/ From 9882244bd979756946f661422fab2787186b9e40 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sun, 7 Jan 2024 06:27:09 +0800 Subject: [PATCH 10/13] refactor: remove extra margins from text within `blockquote` Introduced by #1449 --- _sass/addon/commons.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_sass/addon/commons.scss b/_sass/addon/commons.scss index f53e0cb..5c30f78 100644 --- a/_sass/addon/commons.scss +++ b/_sass/addon/commons.scss @@ -87,6 +87,10 @@ blockquote { color: var(--blockquote-text-color); display: flex; + > p:last-child { + margin-bottom: 0; + } + &[class^='prompt-'] { border-left: 0; position: relative; @@ -104,10 +108,6 @@ blockquote { text-rendering: auto; -webkit-font-smoothing: antialiased; } - - > p:last-child { - margin-bottom: 0; - } } @include prompt('tip', '\f0eb', 'regular'); From 82d8f2db984711f334f55b6af5098ec16770e824 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Mon, 8 Jan 2024 05:13:56 +0800 Subject: [PATCH 11/13] perf: include the latest posts in the "Recently Updated" list (#1456) Improve the "Recently Updated" list to include the most recent (only one Git commit) posts. This change has two benefits: 1. The post update list is consistent with the git commit timeline. 2. Avoid users not having a list of updates to show when they first publish a site. --- _includes/update-list.html | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/_includes/update-list.html b/_includes/update-list.html index cdeebeb..93684c3 100644 --- a/_includes/update-list.html +++ b/_includes/update-list.html @@ -1,16 +1,17 @@ - + {% assign MAX_SIZE = 5 %} {% assign all_list = '' | split: '' %} {% for post in site.posts %} - {% if post.last_modified_at and post.last_modified_at != post.date %} - {% capture elem %} - {{- post.last_modified_at | date: "%Y%m%d%H%M%S" -}}::{{- forloop.index0 -}} - {% endcapture %} - {% assign all_list = all_list | push: elem %} - {% endif %} + {% assign datetime = post.last_modified_at | default: post.date %} + + {% capture elem %} + {{- datetime | date: "%Y%m%d%H%M%S" -}}::{{- forloop.index0 -}} + {% endcapture %} + + {% assign all_list = all_list | push: elem %} {% endfor %} {% assign all_list = all_list | sort | reverse %} From 241bb4df7878cff7f82014df660874a1dcddba76 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Wed, 10 Jan 2024 09:04:27 +0800 Subject: [PATCH 12/13] feat: add site-wide social preview image settings (#1463) - Add configuration field `social_preview_image` that sets the site-wide default social preview image. For pages that do not have `page.image` set in font matter, the seo tag will use the image specified by `site.social_preview_image` as the Open Graph image. - Refactored the generation of image URLs to reduce redundant code and enhance fault tolerance for missing or repeated slash `/` when defining image paths. --- _config.yml | 4 +++ _includes/head.html | 43 +++++++++++++++++++-------------- _includes/img-url.html | 24 ++++++++++++++++++ _includes/refactor-content.html | 23 +++++------------- _includes/sidebar.html | 18 +++++--------- 5 files changed, 65 insertions(+), 47 deletions(-) create mode 100644 _includes/img-url.html diff --git a/_config.yml b/_config.yml index 05044ca..4ab1726 100644 --- a/_config.yml +++ b/_config.yml @@ -75,6 +75,10 @@ img_cdn: "https://chirpy-img.netlify.app" # the avatar on sidebar, support local or CORS resources avatar: "/commons/avatar.jpg" +# The URL of the site-wide social preview image used in SEO `og:image` meta tag. +# It can be overridden by a customized `page.image` in front matter. +social_preview_image: # string, local or CORS resources + # boolean type, the global switch for TOC in posts. toc: true diff --git a/_includes/head.html b/_includes/head.html index fb12d99..3885ef2 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -1,5 +1,3 @@ - - @@ -11,29 +9,38 @@ content="width=device-width, user-scalable=no initial-scale=1, shrink-to-fit=no, viewport-fit=cover" > - {% capture seo_tags %} + {%- capture seo_tags -%} {% seo title=false %} - {% endcapture %} + {%- endcapture -%} + + {% if page.image %} - {% assign img = page.image.path | default: page.image %} + {% assign src = page.image.path | default: page.image %} - {% unless img contains '://' %} - {% assign img_path = page.img_path | append: '/' | append: img | replace: '//', '/' %} - {% capture target %}"{{ img | absolute_url }}"{% endcapture %} + {% unless src contains '://' %} + {%- capture img_url -%} + {% include img-url.html src=src img_path=page.img_path %} + {%- endcapture -%} - {% if site.img_cdn contains '//' %} - - {% capture replacement %}"{{ site.img_cdn }}{{ img_path }}"{% endcapture %} - {% else %} - - {%- capture replacement -%} - "{{ site.img_cdn | append: '/' | append: img_path | replace: '//', '/' | absolute_url }}" - {%- endcapture -%} - {% endif %} + {%- capture old_url -%}{{ src | absolute_url }}{%- endcapture -%} + {%- capture new_url -%}{{ img_url }}{%- endcapture -%} - {% assign seo_tags = seo_tags | replace: target, replacement %} + {% assign seo_tags = seo_tags | replace: old, new %} {% endunless %} + + {% elsif site.social_preview_image %} + {%- capture img_url -%} + {% include img-url.html src=site.social_preview_image %} + {%- endcapture -%} + + {%- capture og_image -%} + + {%- endcapture -%} + + {% assign old_meta_clip = ' - {% if site.img_cdn %} - {% if site.img_cdn contains '//' %} - {% assign _path_prefix = site.img_cdn %} - {% else %} - {% assign _path_prefix = site.img_cdn | relative_url %} - {% endif %} - {% else %} - {% assign _path_prefix = site.baseurl %} - {% endif %} - - - {% if page.img_path %} - {% assign _path = page.img_path | append: '/' | replace: '//', '/' %} - {% assign _path_prefix = _path_prefix | append: _path %} - {% endif %} - {% for _img_snippet in _img_snippets %} {% if forloop.first %} {% assign _img_content = _img_snippet %} @@ -113,6 +96,12 @@ {% assign _final_src = null %} {% assign _lazyload = true %} + {%- capture _img_url -%} + {% include img-url.html src=_src img_path=page.img_path %} + {%- endcapture -%} + + {% assign _path_prefix = _img_url | remove: _src %} + {% unless _src contains '//' %} {% assign _final_src = _path_prefix | append: _src %} {% assign _src_alt = 'src="' | append: _path_prefix %} diff --git a/_includes/sidebar.html b/_includes/sidebar.html index 99d6dcc..b8f92e3 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -3,18 +3,12 @@