diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index f22921b70..fed8764eb 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,2 +1 @@ ko_fi: coteschung -custom: https://sponsor.cotes.page diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index c665f755e..cd67b6d28 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -14,14 +14,14 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: ruby/setup-ruby@v1 with: ruby-version: 3.3 bundler-cache: true - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v5 with: node-version: lts/* diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31b878632..118fc715a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 # for posts's lastmod @@ -42,7 +42,7 @@ jobs: bundler-cache: true - name: Setup Node - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version: lts/* diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 06feb7fd6..e460e49aa 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -24,11 +24,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: languages: "${{ matrix.language }}" config-file: .github/codeql/codeql-config.yml @@ -36,9 +36,9 @@ jobs: # 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@v3 + uses: github/codeql-action/autobuild@v4 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4 with: category: "/language:${{ matrix.language }}" diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 58f1a3ff3..ef14388bc 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -11,5 +11,5 @@ jobs: commitlint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: wagoid/commitlint-github-action@v6 diff --git a/.github/workflows/lint-js.yml b/.github/workflows/lint-js.yml new file mode 100644 index 000000000..205f47900 --- /dev/null +++ b/.github/workflows/lint-js.yml @@ -0,0 +1,30 @@ +name: Lint JS + +on: + push: + paths: + - "_javascript/**/*.js" + - ".github/workflows/scripts/**/*.js" + - "*.js" + pull_request: + paths: + - "_javascript/**/*.js" + - ".github/workflows/scripts/*.js" + - "*.js" + +jobs: + lint-js: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + + - name: Setup Node.js + uses: actions/setup-node@v5 + with: + node-version: lts/* + + - name: Install Dependencies + run: npm i + + - name: Lint JS + run: npm run lint:js diff --git a/.github/workflows/lint-scss.yml b/.github/workflows/lint-scss.yml new file mode 100644 index 000000000..48d8a7263 --- /dev/null +++ b/.github/workflows/lint-scss.yml @@ -0,0 +1,26 @@ +name: Lint SCSS + +on: + push: + paths: + - "_sass/**/*.scss" + pull_request: + paths: + - "_sass/**/*.scss" + +jobs: + lint-scss: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + + - name: Setup Node.js + uses: actions/setup-node@v5 + with: + node-version: lts/* + + - name: Install Dependencies + run: npm i + + - name: Lint SCSS + run: npm run lint:scss diff --git a/.github/workflows/pr-filter.yml b/.github/workflows/pr-filter.yml index 8e9a18b73..ee3f09db2 100644 --- a/.github/workflows/pr-filter.yml +++ b/.github/workflows/pr-filter.yml @@ -13,13 +13,13 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Check PR Content id: intercept - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const script = require('.github/workflows/scripts/pr-filter.js'); - await script({ github, context, core }); + const { default: filter } = await import('${{ github.workspace }}/.github/workflows/scripts/pr-filter.js'); + await filter({ github, context, core }); diff --git a/.github/workflows/scripts/pr-filter.js b/.github/workflows/scripts/pr-filter.js index 03f50dc5c..52e8d526a 100644 --- a/.github/workflows/scripts/pr-filter.js +++ b/.github/workflows/scripts/pr-filter.js @@ -9,7 +9,7 @@ function hasDescription(markdown) { ); } -module.exports = async ({ github, context, core }) => { +export default async ({ github, context, core }) => { const pr = context.payload.pull_request; const body = pr.body === null ? '' : pr.body; const markdown = body.replace(//g, ''); diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 4f6e91cbf..1c9913f54 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@v9 + - uses: actions/stale@v10 with: # 60 days before marking issues/PRs stale days-before-close: -1 # does not close automatically diff --git a/.stylelintrc.json b/.stylelintrc.json index b89029095..c0c1b95a5 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -8,8 +8,6 @@ "property-no-vendor-prefix": null, "selector-no-vendor-prefix": null, "value-no-vendor-prefix": null, - "color-function-notation": "legacy", - "alpha-value-notation": "number", "selector-not-notation": "simple", "color-hex-length": "long", "declaration-block-single-line-max-declarations": 3, diff --git a/_config.yml b/_config.yml index 0a78679d2..d727796fe 100644 --- a/_config.yml +++ b/_config.yml @@ -8,7 +8,7 @@ theme: jekyll-theme-chirpy # otherwise, the layout language will use the default value of 'en'. lang: en -# Change to your timezone › https://kevinnovak.github.io/Time-Zone-Picker +# Change to your timezone › https://zones.arilyn.cc timezone: Asia/Shanghai # jekyll-seo-tag settings › https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md diff --git a/_data/locales/da-DK.yml b/_data/locales/da-DK.yml new file mode 100644 index 000000000..4b41fb389 --- /dev/null +++ b/_data/locales/da-DK.yml @@ -0,0 +1,86 @@ +# The layout text of site + +# ----- Commons label ----- + +layout: + post: Opslag + category: Kategori + tag: Tag + +# The tabs of sidebar +tabs: + # format: : + home: Hjem + categories: Kategorier + tags: Tags + archives: Arkiv + about: Om siden + +# the text displayed in the search bar & search results +search: + hint: søg + cancel: Afbryd + no_results: Ups! Ingen resultater fundet. + +panel: + lastmod: Senest opdateret + trending_tags: Populære tags + toc: Indhold + +copyright: + # Shown at the bottom of the post + license: + template: Dette opslag er licenseret under :LICENSE_NAME af forfatteren. + name: CC BY 4.0 + link: https://creativecommons.org/licenses/by/4.0/ + + # Displayed in the footer + brief: Nogle rettigheder forbeholdes. + verbose: >- + Medmindre andet er angivet, er opslag på denne side beskyttet + under Creative Commons Attribution 4.0 International (CC BY 4.0) licensen af forfatteren. + +# meta: Using the :THEME theme for :PLATFORM. + +not_found: + statement: Beklager, vi har malpaceret denne URL, eller den peger på et sted, som ikke findes. + +notification: + update_found: En ny version af indholdet er fundet! + update: Opdater + +# ----- Posts related labels ----- + +post: + written_by: Af + posted: Udgivet + updated: Opdateret + words: ord + pageview_measure: visninger + read_time: + unit: min + prompt: læsetid + relate_posts: Læs videre + share: Del + button: + next: Nyere + previous: Ældre + copy_code: + succeed: Kopieret! + share_link: + title: Kopier link + succeed: Link kopieret! + +# Date time format. +# See: , +df: + post: + strftime: "%Y/%m/%d" + dayjs: "YYYY/MM/DD" + +# categories page +categories: + category_measure: + singular: kategori + plural: kategorier + post_measure: opslag diff --git a/_data/locales/dv‑MV.yml b/_data/locales/dv‑MV.yml new file mode 100644 index 000000000..680ca1f8b --- /dev/null +++ b/_data/locales/dv‑MV.yml @@ -0,0 +1,90 @@ +# The layout text of site in Dhivehi (Maldives) + +# ----- Commons label ----- + +layout: + post: ޕޯސްޓް + category: ނަތީޖާ + tag: ޓެގް + +# The tabs of sidebar +tabs: + # format: : + home: ހުންނަ + categories: ނަތީޖާތައް + tags: ޓެގްތައް + archives: އާރޗިވްސް + about: އިންސާން + +# the text displayed in the search bar & search results +search: + hint: ސާރޗް + cancel: ކެންސަލް + no_results: އޮޕްސް! އެއްވެސް ނުފެނުނީ. + +panel: + lastmod: އާދަމާ އޮޕްޑޭޓްކުރި + trending_tags: މަރާހު ޓެގްތައް + toc: ކޮންޓެންސް + +copyright: + # Shown at the bottom of the post + license: + template: މި ޕޯސްޓް :LICENSE_NAME އިން ލައިސަންސްކުރާ ނުވަތަ މުޤައްރާއަށް. + name: CC BY 4.0 + link: https://creativecommons.org/licenses/by/4.0/ + + # Displayed in the footer + brief: އެކީ ބާރަށް ހުށަހަޅާ. + verbose: >- + އަދި އެ ރަނގަޅުގައި ނުލާހެވެސް، މި ސައިޓުގެ ޕޯސްޓްތައް + މުޤައްރާއަށް Creative Commons Attribution 4.0 International (CC BY 4.0) ލައިސަންސްކުރަނީ. + +meta: :PLATFORM އަށް :THEME ތީމް ބަލާލާށެވެ. + +not_found: + statement: ސޯރީ، މި ޔޫ.އާރއެލް މަށެވެއްނެ ނުވަތަ އެކަމެއް ނުވެއެވެ. + +notification: + update_found: ޔޫ ވާރޝަން ހުރިހާ. + update: އޮޕްޑޭޓް + +# ----- Posts related labels ----- + +post: + written_by: ލެކްއޯލް + posted: ޕޯސްޓްކުރެވި + updated: އޮޕްޑޭޓްކުރެވި + words: ބަސް + pageview_measure: ބަނޑުކުރާ + read_time: + unit: މިނެޓް + prompt: އިސްކާރު + relate_posts: އެއްޗެހި ފަހުރަށްދަން + share: ސެއާރް + button: + next: އަދާވަނަ + previous: ކޮނޯނި + copy_code: + succeed: ކޮޕީ ކުރެވި! + share_link: + title: ލިންކް ކޮޕީ ކުރު + succeed: ލިންކް ހަދަންކުރެވި! + +# Date time format. +# See: , +df: + post: + strftime: "%b %e, %Y" + dayjs: "ll" + archives: + strftime: "%b" + dayjs: "MMM" + +categories: + category_measure: + singular: ނަތީޖާ + plural: ނަތީޖާތައް + post_measure: + singular: ޕޯސްޓް + plural: ޕޯސްޓްތައް diff --git a/_data/locales/fa-IR.yaml b/_data/locales/fa-IR.yml similarity index 85% rename from _data/locales/fa-IR.yaml rename to _data/locales/fa-IR.yml index d5c6e0eb6..7a33deb12 100644 --- a/_data/locales/fa-IR.yaml +++ b/_data/locales/fa-IR.yml @@ -37,10 +37,10 @@ copyright: # Displayed in the footer brief: برخی حقوق محفوظ است. verbose: >- - مگر اینکه خلاف آن ذکر شده باشد، پست‌های وبلاگ در این سایت + به‌جز مواردی که خلاف آن ذکر شده باشد، محتوای پست‌های این وبلاگ تحت مجوز Creative Commons Attribution 4.0 International (CC BY 4.0) توسط نویسنده منتشر شده‌اند. -meta: با استفاده از :PLATFORM قالب :THEME +meta: با استفاده از قالب :THEME برای :PLATFORM not_found: statement: متأسفیم، لینک زیر معتبر نیست یا به صفحه‌ای که وجود ندارد اشاره می‌کند. @@ -55,11 +55,11 @@ post: written_by: نوشته شده توسط posted: منتشر شده updated: به‌روزرسانی شده - words: کلمات - pageview_measure: بازدیدها + words: کلمه + pageview_measure: بازدید read_time: - unit: دقیقه - prompt: زمان مطالعه + unit: "دقیقه " + prompt: " زمان مطالعه" relate_posts: بیشتر بخوانید share: اشتراک‌گذاری button: @@ -85,7 +85,7 @@ df: categories: category_measure: singular: دسته‌بندی - plural: دسته‌بندی‌ها + plural: دسته‌بندی‌ post_measure: singular: پست - plural: پست‌ها + plural: پست‌ diff --git a/_data/locales/ku-IQ.yml b/_data/locales/ku-IQ.yml new file mode 100644 index 000000000..bcc53565f --- /dev/null +++ b/_data/locales/ku-IQ.yml @@ -0,0 +1,91 @@ +# The layout text of site in Kurdish (Sorani) + +# ----- Commons label ----- + +layout: + post: بابەت + category: هاوپۆل + tag: تاگ + +# The tabs of sidebar +tabs: + # format: : + home: سەرەکی + categories: هاوپۆلەکان + tags: تاگەکان + archives: ئەرشیف + about: دەربارە + +# the text displayed in the search bar & search results +search: + hint: گەڕان + cancel: هەڵوەشاندنەوە + no_results: ببوورە! هیچ ئەنجامێک نەدۆزرایەوە. + +panel: + lastmod: دوایین نوێکردنەوەکان + trending_tags: تاگە باوەکان + toc: ناوەڕۆک + +copyright: + # Shown at the bottom of the post + license: + template: ئەم بابەتە لەلایەن نووسەرەوە بە مۆڵەتی :LICENSE_NAME بڵاوکراوەتەوە. + name: CC BY 4.0 + link: https://creativecommons.org/licenses/by/4.0/ + + # Displayed in the footer + brief: هەندێک مافی پارێزراوە. + verbose: >- + تەنها لەو شوێنانەی کە بە پێچەوانەوە ئاماژەی پێدراوە، بابەتەکانی بڵۆگ لەم سایتەدا + لەژێر مۆڵەتی Creative Commons Attribution 4.0 International (CC BY 4.0) لەلایەن نووسەرەوە مۆڵەتیان پێدراوە. + +meta: بە بەکارهێنانی :PLATFORM لەگەڵ ڕووکاری :THEME + +not_found: + statement: ببوورە، ئەم بەستەرە نادۆزرێتەوە یان ئاماژە بە شتێک دەکات کە بوونی نییە. + +notification: + update_found: وەشانێکی نوێی ناوەڕۆک بەردەستە. + update: نوێکردنەوە + +# ----- Posts related labels ----- + +post: + written_by: نووسەر + posted: بڵاوکراوەتەوە + updated: نوێکراوەتەوە + words: وشە + pageview_measure: بینین + read_time: + unit: خولەک + prompt: خوێندنەوە + relate_posts: بابەتی پەیوەندیدار + share: بڵاوکردنەوە + button: + next: نوێتر + previous: کۆنتر + copy_code: + succeed: کۆپی کرا! + share_link: + title: کۆپی بەستەر + succeed: بەستەر بە سەرکەوتوویی کۆپی کرا! + +# Date time format. +# See: , +df: + post: + strftime: "%d %b, %Y" + dayjs: "DD MMM, YYYY" + archives: + strftime: "%b" + dayjs: "MMM" + +# categories page +categories: + category_measure: + singular: هاوپۆل + plural: هاوپۆل + post_measure: + singular: بابەت + plural: بابەت diff --git a/_data/locales/ps‑AF.yml b/_data/locales/ps‑AF.yml new file mode 100644 index 000000000..fca687723 --- /dev/null +++ b/_data/locales/ps‑AF.yml @@ -0,0 +1,90 @@ +# The layout text of site in Pashto (Afghanistan) + +# ----- Commons label ----- + +layout: + post: لیکنه + category: وېشنيزه + tag: ټګ + +# The tabs of sidebar +tabs: + # format: : + home: کورپاڼه + categories: وېشنيزې + tags: ټګونه + archives: آرشيف + about: په اړه + +# the text displayed in the search bar & search results +search: + hint: لټون + cancel: لغوه + no_results: ها! هېڅ پایله ونه موندل شوه. + +panel: + lastmod: وروستی تازه + trending_tags: مشهور ټګونه + toc: منځپانګه + +copyright: + # Shown at the bottom of the post + license: + template: دا لیکنه د :LICENSE_NAME جواز لاندې د لیکوال له خوا خپره شوې ده. + name: CC BY 4.0 + link: https://creativecommons.org/licenses/by/4.0/ + + # Displayed in the footer + brief: ځینې حقونه خوندي دي. + verbose: >- + تر هغه ځایه چې بل ډول نه وي یاد شوي، د دې سایټ لیکنې + د لیکوال له خوا د کریټېو کامنز د انتساب 4.0 نړیوال (CC BY 4.0) جواز لاندې خپرېږي. + +meta: د :PLATFORM لپاره د :THEME موضوع کاروي. + +not_found: + statement: بښنه غواړو، دغه URL ناسم دی یا هغه څه ته اشاره کوي چې شتون نه لري. + +notification: + update_found: نوې نسخه شتون لري. + update: تازه + +# ----- Posts related labels ----- + +post: + written_by: لیکوال + posted: خپره شوې + updated: تازه شوې + words: کلمې + pageview_measure: کتنې + read_time: + unit: دقیقې + prompt: لوستل + relate_posts: نوره لوستنه + share: شریکول + button: + next: نوی + previous: زوړ + copy_code: + succeed: کاپي شو! + share_link: + title: لینک کاپي کړئ + succeed: لینک بریالي کاپي شو! + +# Date time format. +# See: , +df: + post: + strftime: "%b %e, %Y" + dayjs: "ll" + archives: + strftime: "%b" + dayjs: "MMM" + +categories: + category_measure: + singular: وېشنيزه + plural: وېشنيزې + post_measure: + singular: لیکنه + plural: لیکنې diff --git a/_data/locales/ur-PK.yml b/_data/locales/ur-PK.yml new file mode 100644 index 000000000..e5184df17 --- /dev/null +++ b/_data/locales/ur-PK.yml @@ -0,0 +1,90 @@ +# The layout text of site in Urdu (Pakistan) + +# ----- Commons label ----- + +layout: + post: تحریر + category: زمرہ + tag: ٹیگ + +# The tabs of sidebar +tabs: + # format: : + home: گھر + categories: زمروں + tags: ٹیگز + archives: محفوظات + about: تعارف + +# the text displayed in the search bar & search results +search: + hint: تلاش + cancel: منسوخ + no_results: اوہ! کوئی نتیجہ نہیں ملا۔ + +panel: + lastmod: حال ہی میں اپ ڈیٹ + trending_tags: مقبول ٹیگز + toc: مواد + +copyright: + # Shown at the bottom of the post + license: + template: یہ تحریر :LICENSE_NAME کے تحت مصنف کی جانب سے لائسنس یافتہ ہے۔ + name: CC BY 4.0 + link: https://creativecommons.org/licenses/by/4.0/ + + # Displayed in the footer + brief: کچھ حقوق محفوظ ہیں۔ + verbose: >- + جب تک کہ دوسری صورت میں ذکر نہ ہو، اس سائٹ کی تحریریں + مصنف کی جانب سے تخلیقی العام انتساب 4.0 بین الاقوامی (CC BY 4.0) لائسنس کے تحت دستیاب ہیں۔ + +meta: :PLATFORM کے لیے :THEME تھیم استعمال کیا جا رہا ہے۔ + +not_found: + statement: معذرت، یہ URL غلط ہے یا جس چیز کی طرف اشارہ کر رہا ہے وہ موجود نہیں۔ + +notification: + update_found: نیا مواد دستیاب ہے۔ + update: اپ ڈیٹ + +# ----- Posts related labels ----- + +post: + written_by: از + posted: شائع شدہ + updated: اپ ڈیٹ شدہ + words: لفظ + pageview_measure: مشاہدات + read_time: + unit: منٹ + prompt: پڑھیں + relate_posts: مزید مطالعہ + share: شیئر + button: + next: نیا + previous: پرانا + copy_code: + succeed: کاپی ہو گیا! + share_link: + title: لنک کاپی کریں + succeed: لنک کامیابی سے کاپی ہو گیا! + +# Date time format. +# See: , +df: + post: + strftime: "%b %e, %Y" + dayjs: "ll" + archives: + strftime: "%b" + dayjs: "MMM" + +categories: + category_measure: + singular: زمرہ + plural: زمروں + post_measure: + singular: تحریر + plural: تحریریں diff --git a/_data/origin/cors.yml b/_data/origin/cors.yml index e9bb4eb9b..ce99f8141 100644 --- a/_data/origin/cors.yml +++ b/_data/origin/cors.yml @@ -20,24 +20,24 @@ webfonts: https://fonts.googleapis.com/css2?family=Lato:wght@300;400&family=Sour # Libraries toc: - css: https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css - js: https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.js + css: https://cdn.jsdelivr.net/npm/tocbot@4.36.4/dist/tocbot.min.css + js: https://cdn.jsdelivr.net/npm/tocbot@4.36.4/dist/tocbot.min.js fontawesome: - css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css + css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@7.1.0/css/all.min.css search: js: https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.10.0/dest/simple-jekyll-search.min.js mermaid: - js: https://cdn.jsdelivr.net/npm/mermaid@11.4.0/dist/mermaid.min.js + js: https://cdn.jsdelivr.net/npm/mermaid@11.12.0/dist/mermaid.min.js dayjs: js: - common: https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js - locale: https://cdn.jsdelivr.net/npm/dayjs@1.11.13/locale/:LOCALE.js - relativeTime: https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/relativeTime.js - localizedFormat: https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/localizedFormat.js + common: https://cdn.jsdelivr.net/npm/dayjs@1.11.18/dayjs.min.js + locale: https://cdn.jsdelivr.net/npm/dayjs@1.11.18/locale/:LOCALE.js + relativeTime: https://cdn.jsdelivr.net/npm/dayjs@1.11.18/plugin/relativeTime.js + localizedFormat: https://cdn.jsdelivr.net/npm/dayjs@1.11.18/plugin/localizedFormat.js glightbox: css: https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/css/glightbox.min.css diff --git a/_includes/embed/audio.html b/_includes/embed/audio.html index cf928a7f8..bb20688e4 100644 --- a/_includes/embed/audio.html +++ b/_includes/embed/audio.html @@ -9,7 +9,7 @@ {% endunless %}

-

' -%}
-      {%- assign content = content | replace: '
', '' -%}
-    {%- endif -%}
-
-    {{- content | strip_html | newline_to_br | replace: '
', ' ' | strip_newlines -}} - {%- endif -%} -{%- endcapture -%} - -{%- if include.json -%} - {%- assign description = description | jsonify -%} -{%- else -%} - {%- assign max_length = include.max_length | default: 200 -%} - {%- assign description = description | strip | truncate: max_length -%} -{%- endif -%} - -{{- description -}} diff --git a/_includes/post-summary.html b/_includes/post-summary.html new file mode 100644 index 000000000..c9314fc81 --- /dev/null +++ b/_includes/post-summary.html @@ -0,0 +1,39 @@ +{%- comment -%} + Get the post's description or body content. + + Arguments: + full_text: If true, return the full content. Default is false. + max_length: The maximum length of the returned content. Default is 200. +{%- endcomment -%} + +{%- if post.description and include.full_text != true -%} + {{- post.description -}} +{%- else -%} + {%- comment -%} Remove the line numbers from the code snippet. {%- endcomment -%} + + {%- assign content = post.content -%} + + {%- if content contains '
' -%}
+    {%- assign content = content
+      | replace: '
',
+        '' -%}
+  {%- endif -%}
+
+  {%- assign content = content
+    | markdownify
+    | strip_html
+    | newline_to_br
+    | replace: '
', ' ' + | strip_newlines + | strip + -%} + + {%- unless include.full_text -%} + {%- assign max_length = include.max_length | default: 200 -%} + {%- assign content = content | truncate: max_length -%} + {%- endunless -%} + + {{- content -}} +{%- endif -%} diff --git a/_includes/refactor-content.html b/_includes/refactor-content.html index 4586f5c47..5b6de2f1e 100644 --- a/_includes/refactor-content.html +++ b/_includes/refactor-content.html @@ -163,7 +163,7 @@ {% if page.layout == 'home' %} - {% assign _wrapper_start = '
' %} + {% assign _wrapper_start = '
' %} {% assign _img_content = _img_content | append: _wrapper_start %} {% assign _right = _right | prepend: '>{{ post.title }}
-

{% include post-description.html %}

+

{% include post-summary.html %}

diff --git a/_includes/sidebar.html b/_includes/sidebar.html index 569585f6f..1cd0ee8a7 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -52,13 +52,21 @@ {% endunless %} {% for entry in site.data.contact %} + {%- assign url = null -%} + {% case entry.type %} {% when 'github', 'twitter' %} + {%- unless site[entry.type].username -%} + {%- continue -%} + {%- endunless -%} {%- capture url -%} https://{{ entry.type }}.com/{{ site[entry.type].username }} {%- endcapture -%} {% when 'email' %} - {% assign email = site.social.email | split: '@' %} + {%- unless site.social.email -%} + {%- continue -%} + {%- endunless -%} + {%- assign email = site.social.email | split: '@' -%} {%- capture url -%} javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@') {%- endcapture -%} diff --git a/_layouts/home.html b/_layouts/home.html index 451e391cd..cb9ab244d 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -55,16 +55,15 @@ refactor: true {% if post.image %} {% assign src = post.image.path | default: post.image %} - {% unless src contains '//' %} - {% assign src = post.media_subpath | append: '/' | append: src | replace: '//', '/' %} - {% endunless %} + {% capture src %}{% include media-url.html src=src subpath=post.media_subpath %}{% endcapture %} {% assign alt = post.image.alt | xml_escape | default: 'Preview Image' %} {% assign lqip = null %} {% if post.image.lqip %} - {% capture lqip %}lqip="{{ post.image.lqip }}"{% endcapture %} + {% capture lqip_url %}{% include media-url.html src=post.image.lqip subpath=post.media_subpath %}{% endcapture %} + {% assign lqip = 'lqip="' | append: lqip_url | append: '"' %} {% endif %}
@@ -79,7 +78,7 @@ refactor: true

{{ post.title }}

-

{% include post-description.html %}

+

{% include post-summary.html %}