pretty run

This commit is contained in:
Nuno Coração
2025-06-17 23:17:26 +01:00
parent 560e927b87
commit f2e224a042
137 changed files with 5771 additions and 5017 deletions

View File

@@ -51,4 +51,4 @@ jobs:
push_options: "--dry-run" push_options: "--dry-run"
file_pattern: "assets/css/compiled/main.css" file_pattern: "assets/css/compiled/main.css"
commit_message: "💄 Rebuild CSS" commit_message: "💄 Rebuild CSS"
- run: git push - run: git push

View File

@@ -9,8 +9,8 @@ jobs:
issues: write issues: write
pull-requests: write pull-requests: write
steps: steps:
- uses: actions/first-interaction@v1 - uses: actions/first-interaction@v1
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Thanks for contributing to Blowfish" issue-message: "Thanks for contributing to Blowfish"
pr-message: "Thanks for contributing to Blowfish" pr-message: "Thanks for contributing to Blowfish"

View File

@@ -2,7 +2,7 @@ name: Update Hugo version
on: on:
schedule: schedule:
- cron: '0 6 * * *' - cron: "0 6 * * *"
workflow_dispatch: workflow_dispatch:
@@ -10,30 +10,31 @@ jobs:
updateBlowfish: updateBlowfish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out code into the Go module directory - name: Check out code into the Go module directory
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
ref: dev ref: dev
submodules: true # Fetch Hugo themes (true OR recursive) submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Fetch release version - name: Fetch release version
id: fetch-release id: fetch-release
run: | run: |
curl -sL https://api.github.com/repos/gohugoio/hugo/releases/latest | \ curl -sL https://api.github.com/repos/gohugoio/hugo/releases/latest | \
jq -r ".tag_name" > release-versions/hugo-latest.txt jq -r ".tag_name" > release-versions/hugo-latest.txt
- name: Check for modified files - name: Check for modified files
id: git-check id: git-check
run: echo ::set-output name=modified::$([ -z "`git status --porcelain`" ] && echo "false" || echo "true") run:
echo ::set-output name=modified::$([ -z "`git status --porcelain`" ]
&& echo "false" || echo "true")
- name: Update config.toml - name: Update config.toml
id: update-config id: update-config
if: steps.git-check.outputs.modified == 'true' if: steps.git-check.outputs.modified == 'true'
run: | run: |
cat release-versions/hugo-latest.txt | \ cat release-versions/hugo-latest.txt | \
while read version; do sed -i'' -E "s/(max = \")[0-9]+\.[0-9]+\.[0-9]+(\")/\1${version#v}\2/g" config.toml; done while read version; do sed -i'' -E "s/(max = \")[0-9]+\.[0-9]+\.[0-9]+(\")/\1${version#v}\2/g" config.toml; done
- name: Create Pull Request - name: Create Pull Request
if: steps.git-check.outputs.modified == 'true' if: steps.git-check.outputs.modified == 'true'
@@ -43,9 +44,9 @@ jobs:
title: ⚙️ Update Hugo supported version title: ⚙️ Update Hugo supported version
body: | body: |
Updates [Hugo][1] support Updates [Hugo][1] support
Auto-generated by [create-pull-request][2] Auto-generated by [create-pull-request][2]
[1]: https://github.com/gohugoio/hugo [1]: https://github.com/gohugoio/hugo
[2]: https://github.com/peter-evans/create-pull-request [2]: https://github.com/peter-evans/create-pull-request
labels: dependencies, automated pr labels: dependencies, automated pr

View File

@@ -7,26 +7,28 @@ name: Mark stale issues and pull requests
on: on:
schedule: schedule:
- cron: '0 1 * * *' - cron: "0 1 * * *"
workflow_dispatch: workflow_dispatch:
jobs: jobs:
stale: stale:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
issues: write issues: write
pull-requests: write pull-requests: write
steps: steps:
- uses: actions/stale@v9 - uses: actions/stale@v9
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue will be closed since it has been stale for 60 days.' stale-issue-message:
stale-pr-message: 'This pull request will be closed since it has been stale for 60 days.' "This issue will be closed since it has been stale for 60 days."
stale-issue-label: 'no-issue-activity' stale-pr-message:
stale-pr-label: 'no-pr-activity' "This pull request will be closed since it has been stale for 60
days-before-stale: 60 days."
days-before-close: 0 stale-issue-label: "no-issue-activity"
remove-stale-when-updated: true stale-pr-label: "no-pr-activity"
operations-per-run: 100 days-before-stale: 60
days-before-close: 0
remove-stale-when-updated: true
operations-per-run: 100

View File

@@ -22,4 +22,6 @@ jobs:
- name: Build - name: Build
working-directory: ./exampleSite working-directory: ./exampleSite
run: hugo --minify --themesDir ../.. --baseURL https://nunocoracao.github.io/blowfish/ run:
hugo --minify --themesDir ../.. --baseURL
https://nunocoracao.github.io/blowfish/

View File

@@ -1,2 +1,6 @@
github: [nunocoracao] github: [nunocoracao]
custom: ["https://www.paypal.me/nunocoracao", "https://www.buymeacoffee.com/nunocoracao"] custom:
[
"https://www.paypal.me/nunocoracao",
"https://www.buymeacoffee.com/nunocoracao",
]

View File

@@ -1,16 +1,14 @@
#zen-mode-button { #zen-mode-button {
cursor:pointer cursor: pointer;
} }
.zen-mode { .zen-mode {
position: relative; position: relative;
} }
body.zen-mode-enable { body.zen-mode-enable {
#bmc-wbtn, .author { #bmc-wbtn,
display:none !important; .author {
} display: none !important;
}
} }

View File

@@ -1,6 +1,6 @@
/*! Blowfish | MIT License | https://github.com/nunocoracao/blowfish */ /*! Blowfish | MIT License | https://github.com/nunocoracao/blowfish */
@import './components/zen-mode.css'; @import "./components/zen-mode.css";
@import "tailwindcss"; @import "tailwindcss";
@config "../../tailwind.config.js"; @config "../../tailwind.config.js";
@@ -38,13 +38,13 @@ button,
@apply rtl:pr-4 rtl:border-l-0 rtl:border-r-4; @apply rtl:pr-4 rtl:border-l-0 rtl:border-r-4;
} }
.prose ul>li, .prose ul > li,
.prose ol>li { .prose ol > li {
@apply rtl:pl-0 rtl:pr-2 rtl:mr-7; @apply rtl:pl-0 rtl:pr-2 rtl:mr-7;
} }
.prose ol>li:before, .prose ol > li:before,
.prose ul>li:before { .prose ul > li:before {
@apply rtl:left-auto rtl:right-1; @apply rtl:left-auto rtl:right-1;
} }
@@ -59,7 +59,7 @@ button,
} }
/* Adjust first child within prose */ /* Adjust first child within prose */
.prose div.min-w-0.max-w-prose>*:first-child { .prose div.min-w-0.max-w-prose > *:first-child {
@apply mt-3; @apply mt-3;
} }
@@ -69,9 +69,9 @@ button,
} }
#TOCView { #TOCView {
max-height: calc(100vh - 150px); max-height: calc(100vh - 150px);
min-height: 0; min-height: 0;
overflow-x: hidden; overflow-x: hidden;
} }
.toc ul, .toc ul,
@@ -87,7 +87,7 @@ button,
@apply font-normal text-neutral-700 dark:text-neutral-400; @apply font-normal text-neutral-700 dark:text-neutral-400;
} }
.toc ul>li { .toc ul > li {
@apply rtl:mr-0; @apply rtl:mr-0;
} }
@@ -100,7 +100,7 @@ button,
@apply relative z-0; @apply relative z-0;
} }
.highlight:hover>.copy-button { .highlight:hover > .copy-button {
@apply visible; @apply visible;
} }
@@ -122,7 +122,9 @@ button,
} }
/* Fix long KaTeX equations on mobile (see https://katex.org/docs/issues.html#css-customization) */ /* Fix long KaTeX equations on mobile (see https://katex.org/docs/issues.html#css-customization) */
.katex-display { overflow: auto hidden } .katex-display {
overflow: auto hidden;
}
/* Fix katex overflow https://github.com/nunocoracao/blowfish/issues/2138 */ /* Fix katex overflow https://github.com/nunocoracao/blowfish/issues/2138 */
.katex-display { .katex-display {
@@ -132,21 +134,21 @@ button,
/* Fix long tables breaking out of article on mobile */ /* Fix long tables breaking out of article on mobile */
table { table {
display: block; display: block;
overflow: auto; overflow: auto;
} }
/* Fix long inline code sections breaking out of article on mobile */ /* Fix long inline code sections breaking out of article on mobile */
code { code {
word-wrap: break-word; /* All browsers since IE 5.5+ */ word-wrap: break-word; /* All browsers since IE 5.5+ */
overflow-wrap: break-word; /* Renamed property in CSS3 draft spec */ overflow-wrap: break-word; /* Renamed property in CSS3 draft spec */
} }
/* Fix long URLs breaking out of article bounds on mobile */ /* Fix long URLs breaking out of article bounds on mobile */
a { a {
word-break: break-word; word-break: break-word;
word-wrap: break-word; word-wrap: break-word;
overflow-wrap: break-word; overflow-wrap: break-word;
} }
/* -- Chroma Highlight -- */ /* -- Chroma Highlight -- */
@@ -156,7 +158,7 @@ a {
} }
.prose-invert .highlight pre > code { .prose-invert .highlight pre > code {
background-color: unset; background-color: unset;
} }
/* LineTableTD */ /* LineTableTD */
@@ -388,36 +390,36 @@ pre {
.thumbnail { .thumbnail {
min-width: 300px; min-width: 300px;
height: 180px; height: 180px;
background-repeat:no-repeat; background-repeat: no-repeat;
background-size:cover; background-size: cover;
background-position:center; background-position: center;
} }
.thumbnail_card { .thumbnail_card {
height: 200px; height: 200px;
background-repeat:no-repeat; background-repeat: no-repeat;
background-size:cover; background-size: cover;
background-position:center; background-position: center;
} }
.thumbnail_card_related { .thumbnail_card_related {
height: 150px; height: 150px;
background-repeat:no-repeat; background-repeat: no-repeat;
background-size:cover; background-size: cover;
background-position:center; background-position: center;
} }
.thumbnail_card_term { .thumbnail_card_term {
height: 150px; height: 150px;
background-repeat:no-repeat; background-repeat: no-repeat;
background-size:cover; background-size: cover;
background-position:center; background-position: center;
} }
.single_hero_basic { .single_hero_basic {
background-repeat:no-repeat; background-repeat: no-repeat;
background-size:cover; background-size: cover;
background-position:center; background-position: center;
} }
.single_hero_round { .single_hero_round {
@@ -426,9 +428,9 @@ pre {
} }
.single_hero_background { .single_hero_background {
background-repeat:no-repeat; background-repeat: no-repeat;
background-size:cover; background-size: cover;
background-position:center; background-position: center;
width: calc(100% + 40px); width: calc(100% + 40px);
z-index: -10; z-index: -10;
margin-left: -20px; margin-left: -20px;
@@ -452,47 +454,48 @@ pre {
} }
.center-relative-left { .center-relative-left {
left: calc(max(-50vw,-800px) + 50%); left: calc(max(-50vw, -800px) + 50%);
} }
.margin-0 { .margin-0 {
margin: 0; margin: 0;
} }
.margin-top-\[-15px\] { .margin-top-\[-15px\] {
margin-top: -15px; margin-top: -15px;
} }
.margin-top-\[0\.5rem\]{ .margin-top-\[0\.5rem\] {
margin-top: 0.5rem; margin-top: 0.5rem;
} }
.margin-right-\[10px\] { .margin-right-\[10px\] {
margin-right: 10px; margin-right: 10px;
} }
.margin-left-\[0px\] { .margin-left-\[0px\] {
margin-left: 0px; margin-left: 0px;
} }
.padding-main-menu { .padding-main-menu {
padding: 2px 0 3px 0 padding: 2px 0 3px 0;
} }
.padding-top-\[5px\] { .padding-top-\[5px\] {
padding-top: 5px; padding-top: 5px;
} }
.z-index-\[-10\] { .z-index-\[-10\] {
z-index: -10; z-index: -10;
} }
.z-index-80 { .z-index-80 {
z-index: 80; z-index: 80;
} }
.z-index-100 { .z-index-100 {
z-index: 100; z-index: 100;
} }
.z-index-500 { .z-index-500 {
z-index: 500; z-index: 500;
} }
/* Offset scroll position to avoid header overlap */ /* Offset scroll position to avoid header overlap */
[id^="fn"], [id^="fnref"] { [id^="fn"],
[id^="fnref"] {
scroll-margin-top: 145px; scroll-margin-top: 145px;
} }
@@ -524,19 +527,25 @@ pre {
.nested-menu:hover + .menuhide { .nested-menu:hover + .menuhide {
visibility: visible; visibility: visible;
opacity: 1; opacity: 1;
transition: visibility 0.3s, opacity 0.3s ease-in-out ; transition:
visibility 0.3s,
opacity 0.3s ease-in-out;
} }
.menuhide:hover { .menuhide:hover {
visibility: visible; visibility: visible;
opacity: 1; opacity: 1;
transition: visibility 0.3s, opacity 0.3s ease-in-out ; transition:
visibility 0.3s,
opacity 0.3s ease-in-out;
} }
.menuhide { .menuhide {
visibility: hidden; visibility: hidden;
opacity: 0; opacity: 0;
transition: visibility 0.3s, opacity 0.3s ease-in-out ; transition:
visibility 0.3s,
opacity 0.3s ease-in-out;
z-index: 1000; z-index: 1000;
} }
@@ -547,179 +556,593 @@ pre {
} }
/* Gallery Specific Styles */ /* Gallery Specific Styles */
.grid-w10 { width: calc(10% - 5px); margin: 0px !important; } .grid-w10 {
.grid-w15 { width: calc(15% - 5px); margin: 0px !important; } width: calc(10% - 5px);
.grid-w20 { width: calc(20% - 5px); margin: 0px !important; } margin: 0px !important;
.grid-w25 { width: calc(25% - 5px); margin: 0px !important; } }
.grid-w30 { width: calc(30% - 5px); margin: 0px !important; } .grid-w15 {
.grid-w33 { width: calc(33% - 5px); margin: 0px !important; } width: calc(15% - 5px);
.grid-w35 { width: calc(35% - 5px); margin: 0px !important; } margin: 0px !important;
.grid-w40 { width: calc(40% - 5px); margin: 0px !important; } }
.grid-w45 { width: calc(45% - 5px); margin: 0px !important; } .grid-w20 {
.grid-w50 { width: calc(50% - 5px); margin: 0px !important; } width: calc(20% - 5px);
.grid-w55 { width: calc(55% - 5px); margin: 0px !important; } margin: 0px !important;
.grid-w60 { width: calc(60% - 5px); margin: 0px !important; } }
.grid-w65 { width: calc(65% - 5px); margin: 0px !important; } .grid-w25 {
.grid-w66 { width: calc(66% - 5px); margin: 0px !important; } width: calc(25% - 5px);
.grid-w70 { width: calc(70% - 5px); margin: 0px !important; } margin: 0px !important;
.grid-w75 { width: calc(75% - 5px); margin: 0px !important; } }
.grid-w80 { width: calc(80% - 5px); margin: 0px !important; } .grid-w30 {
.grid-w85 { width: calc(85% - 5px); margin: 0px !important; } width: calc(30% - 5px);
.grid-w90 { width: calc(90% - 5px); margin: 0px !important; } margin: 0px !important;
.grid-w95 { width: calc(95% - 5px); margin: 0px !important; } }
.grid-w100 { width: calc(100% - 5px); margin: 0px !important; } .grid-w33 {
width: calc(33% - 5px);
margin: 0px !important;
}
.grid-w35 {
width: calc(35% - 5px);
margin: 0px !important;
}
.grid-w40 {
width: calc(40% - 5px);
margin: 0px !important;
}
.grid-w45 {
width: calc(45% - 5px);
margin: 0px !important;
}
.grid-w50 {
width: calc(50% - 5px);
margin: 0px !important;
}
.grid-w55 {
width: calc(55% - 5px);
margin: 0px !important;
}
.grid-w60 {
width: calc(60% - 5px);
margin: 0px !important;
}
.grid-w65 {
width: calc(65% - 5px);
margin: 0px !important;
}
.grid-w66 {
width: calc(66% - 5px);
margin: 0px !important;
}
.grid-w70 {
width: calc(70% - 5px);
margin: 0px !important;
}
.grid-w75 {
width: calc(75% - 5px);
margin: 0px !important;
}
.grid-w80 {
width: calc(80% - 5px);
margin: 0px !important;
}
.grid-w85 {
width: calc(85% - 5px);
margin: 0px !important;
}
.grid-w90 {
width: calc(90% - 5px);
margin: 0px !important;
}
.grid-w95 {
width: calc(95% - 5px);
margin: 0px !important;
}
.grid-w100 {
width: calc(100% - 5px);
margin: 0px !important;
}
@screen sm { @screen sm {
.sm\:grid-w10 { width: calc(10% - 5px); margin: 0px !important; } .sm\:grid-w10 {
.sm\:grid-w15 { width: calc(15% - 5px); margin: 0px !important; } width: calc(10% - 5px);
.sm\:grid-w20 { width: calc(20% - 5px); margin: 0px !important; } margin: 0px !important;
.sm\:grid-w25 { width: calc(25% - 5px); margin: 0px !important; } }
.sm\:grid-w30 { width: calc(30% - 5px); margin: 0px !important; } .sm\:grid-w15 {
.sm\:grid-w33 { width: calc(33% - 5px); margin: 0px !important; } width: calc(15% - 5px);
.sm\:grid-w35 { width: calc(35% - 5px); margin: 0px !important; } margin: 0px !important;
.sm\:grid-w40 { width: calc(40% - 5px); margin: 0px !important; } }
.sm\:grid-w45 { width: calc(45% - 5px); margin: 0px !important; } .sm\:grid-w20 {
.sm\:grid-w50 { width: calc(50% - 5px); margin: 0px !important; } width: calc(20% - 5px);
.sm\:grid-w55 { width: calc(55% - 5px); margin: 0px !important; } margin: 0px !important;
.sm\:grid-w60 { width: calc(60% - 5px); margin: 0px !important; } }
.sm\:grid-w65 { width: calc(65% - 5px); margin: 0px !important; } .sm\:grid-w25 {
.sm\:grid-w66 { width: calc(66% - 5px); margin: 0px !important; } width: calc(25% - 5px);
.sm\:grid-w70 { width: calc(70% - 5px); margin: 0px !important; } margin: 0px !important;
.sm\:grid-w75 { width: calc(75% - 5px); margin: 0px !important; } }
.sm\:grid-w80 { width: calc(80% - 5px); margin: 0px !important; } .sm\:grid-w30 {
.sm\:grid-w85 { width: calc(85% - 5px); margin: 0px !important; } width: calc(30% - 5px);
.sm\:grid-w90 { width: calc(90% - 5px); margin: 0px !important; } margin: 0px !important;
.sm\:grid-w95 { width: calc(95% - 5px); margin: 0px !important; } }
.sm\:grid-w100 { width: calc(100% - 5px); margin: 0px !important; } .sm\:grid-w33 {
width: calc(33% - 5px);
margin: 0px !important;
}
.sm\:grid-w35 {
width: calc(35% - 5px);
margin: 0px !important;
}
.sm\:grid-w40 {
width: calc(40% - 5px);
margin: 0px !important;
}
.sm\:grid-w45 {
width: calc(45% - 5px);
margin: 0px !important;
}
.sm\:grid-w50 {
width: calc(50% - 5px);
margin: 0px !important;
}
.sm\:grid-w55 {
width: calc(55% - 5px);
margin: 0px !important;
}
.sm\:grid-w60 {
width: calc(60% - 5px);
margin: 0px !important;
}
.sm\:grid-w65 {
width: calc(65% - 5px);
margin: 0px !important;
}
.sm\:grid-w66 {
width: calc(66% - 5px);
margin: 0px !important;
}
.sm\:grid-w70 {
width: calc(70% - 5px);
margin: 0px !important;
}
.sm\:grid-w75 {
width: calc(75% - 5px);
margin: 0px !important;
}
.sm\:grid-w80 {
width: calc(80% - 5px);
margin: 0px !important;
}
.sm\:grid-w85 {
width: calc(85% - 5px);
margin: 0px !important;
}
.sm\:grid-w90 {
width: calc(90% - 5px);
margin: 0px !important;
}
.sm\:grid-w95 {
width: calc(95% - 5px);
margin: 0px !important;
}
.sm\:grid-w100 {
width: calc(100% - 5px);
margin: 0px !important;
}
} }
@screen md { @screen md {
.md\:grid-w10 { width: calc(10% - 5px); margin: 0px !important; } .md\:grid-w10 {
.md\:grid-w15 { width: calc(15% - 5px); margin: 0px !important; } width: calc(10% - 5px);
.md\:grid-w20 { width: calc(20% - 5px); margin: 0px !important; } margin: 0px !important;
.md\:grid-w25 { width: calc(25% - 5px); margin: 0px !important; } }
.md\:grid-w30 { width: calc(30% - 5px); margin: 0px !important; } .md\:grid-w15 {
.md\:grid-w33 { width: calc(33% - 5px); margin: 0px !important; } width: calc(15% - 5px);
.md\:grid-w35 { width: calc(35% - 5px); margin: 0px !important; } margin: 0px !important;
.md\:grid-w40 { width: calc(40% - 5px); margin: 0px !important; } }
.md\:grid-w45 { width: calc(45% - 5px); margin: 0px !important; } .md\:grid-w20 {
.md\:grid-w50 { width: calc(50% - 5px); margin: 0px !important; } width: calc(20% - 5px);
.md\:grid-w55 { width: calc(55% - 5px); margin: 0px !important; } margin: 0px !important;
.md\:grid-w60 { width: calc(60% - 5px); margin: 0px !important; } }
.md\:grid-w65 { width: calc(65% - 5px); margin: 0px !important; } .md\:grid-w25 {
.md\:grid-w66 { width: calc(66% - 5px); margin: 0px !important; } width: calc(25% - 5px);
.md\:grid-w70 { width: calc(70% - 5px); margin: 0px !important; } margin: 0px !important;
.md\:grid-w75 { width: calc(75% - 5px); margin: 0px !important; } }
.md\:grid-w80 { width: calc(80% - 5px); margin: 0px !important; } .md\:grid-w30 {
.md\:grid-w85 { width: calc(85% - 5px); margin: 0px !important; } width: calc(30% - 5px);
.md\:grid-w90 { width: calc(90% - 5px); margin: 0px !important; } margin: 0px !important;
.md\:grid-w95 { width: calc(95% - 5px); margin: 0px !important; } }
.md\:grid-w100 { width: calc(100% - 5px); margin: 0px !important; } .md\:grid-w33 {
width: calc(33% - 5px);
margin: 0px !important;
}
.md\:grid-w35 {
width: calc(35% - 5px);
margin: 0px !important;
}
.md\:grid-w40 {
width: calc(40% - 5px);
margin: 0px !important;
}
.md\:grid-w45 {
width: calc(45% - 5px);
margin: 0px !important;
}
.md\:grid-w50 {
width: calc(50% - 5px);
margin: 0px !important;
}
.md\:grid-w55 {
width: calc(55% - 5px);
margin: 0px !important;
}
.md\:grid-w60 {
width: calc(60% - 5px);
margin: 0px !important;
}
.md\:grid-w65 {
width: calc(65% - 5px);
margin: 0px !important;
}
.md\:grid-w66 {
width: calc(66% - 5px);
margin: 0px !important;
}
.md\:grid-w70 {
width: calc(70% - 5px);
margin: 0px !important;
}
.md\:grid-w75 {
width: calc(75% - 5px);
margin: 0px !important;
}
.md\:grid-w80 {
width: calc(80% - 5px);
margin: 0px !important;
}
.md\:grid-w85 {
width: calc(85% - 5px);
margin: 0px !important;
}
.md\:grid-w90 {
width: calc(90% - 5px);
margin: 0px !important;
}
.md\:grid-w95 {
width: calc(95% - 5px);
margin: 0px !important;
}
.md\:grid-w100 {
width: calc(100% - 5px);
margin: 0px !important;
}
} }
@screen lg { @screen lg {
.lg\:grid-w10 { width: calc(10% - 5px); margin: 0px !important; } .lg\:grid-w10 {
.lg\:grid-w15 { width: calc(15% - 5px); margin: 0px !important; } width: calc(10% - 5px);
.lg\:grid-w20 { width: calc(20% - 5px); margin: 0px !important; } margin: 0px !important;
.lg\:grid-w25 { width: calc(25% - 5px); margin: 0px !important; } }
.lg\:grid-w30 { width: calc(30% - 5px); margin: 0px !important; } .lg\:grid-w15 {
.lg\:grid-w33 { width: calc(33% - 5px); margin: 0px !important; } width: calc(15% - 5px);
.lg\:grid-w35 { width: calc(35% - 5px); margin: 0px !important; } margin: 0px !important;
.lg\:grid-w40 { width: calc(40% - 5px); margin: 0px !important; } }
.lg\:grid-w45 { width: calc(45% - 5px); margin: 0px !important; } .lg\:grid-w20 {
.lg\:grid-w50 { width: calc(50% - 5px); margin: 0px !important; } width: calc(20% - 5px);
.lg\:grid-w55 { width: calc(55% - 5px); margin: 0px !important; } margin: 0px !important;
.lg\:grid-w60 { width: calc(60% - 5px); margin: 0px !important; } }
.lg\:grid-w65 { width: calc(65% - 5px); margin: 0px !important; } .lg\:grid-w25 {
.lg\:grid-w66 { width: calc(66% - 5px); margin: 0px !important; } width: calc(25% - 5px);
.lg\:grid-w70 { width: calc(70% - 5px); margin: 0px !important; } margin: 0px !important;
.lg\:grid-w75 { width: calc(75% - 5px); margin: 0px !important; } }
.lg\:grid-w80 { width: calc(80% - 5px); margin: 0px !important; } .lg\:grid-w30 {
.lg\:grid-w85 { width: calc(85% - 5px); margin: 0px !important; } width: calc(30% - 5px);
.lg\:grid-w90 { width: calc(90% - 5px); margin: 0px !important; } margin: 0px !important;
.lg\:grid-w95 { width: calc(95% - 5px); margin: 0px !important; } }
.lg\:grid-w100 { width: calc(100% - 5px); margin: 0px !important; } .lg\:grid-w33 {
width: calc(33% - 5px);
margin: 0px !important;
}
.lg\:grid-w35 {
width: calc(35% - 5px);
margin: 0px !important;
}
.lg\:grid-w40 {
width: calc(40% - 5px);
margin: 0px !important;
}
.lg\:grid-w45 {
width: calc(45% - 5px);
margin: 0px !important;
}
.lg\:grid-w50 {
width: calc(50% - 5px);
margin: 0px !important;
}
.lg\:grid-w55 {
width: calc(55% - 5px);
margin: 0px !important;
}
.lg\:grid-w60 {
width: calc(60% - 5px);
margin: 0px !important;
}
.lg\:grid-w65 {
width: calc(65% - 5px);
margin: 0px !important;
}
.lg\:grid-w66 {
width: calc(66% - 5px);
margin: 0px !important;
}
.lg\:grid-w70 {
width: calc(70% - 5px);
margin: 0px !important;
}
.lg\:grid-w75 {
width: calc(75% - 5px);
margin: 0px !important;
}
.lg\:grid-w80 {
width: calc(80% - 5px);
margin: 0px !important;
}
.lg\:grid-w85 {
width: calc(85% - 5px);
margin: 0px !important;
}
.lg\:grid-w90 {
width: calc(90% - 5px);
margin: 0px !important;
}
.lg\:grid-w95 {
width: calc(95% - 5px);
margin: 0px !important;
}
.lg\:grid-w100 {
width: calc(100% - 5px);
margin: 0px !important;
}
} }
@screen xl { @screen xl {
.xl\:grid-w10 { width: calc(10% - 5px); margin: 0px !important; } .xl\:grid-w10 {
.xl\:grid-w15 { width: calc(15% - 5px); margin: 0px !important; } width: calc(10% - 5px);
.xl\:grid-w20 { width: calc(20% - 5px); margin: 0px !important; } margin: 0px !important;
.xl\:grid-w25 { width: calc(25% - 5px); margin: 0px !important; } }
.xl\:grid-w30 { width: calc(30% - 5px); margin: 0px !important; } .xl\:grid-w15 {
.xl\:grid-w33 { width: calc(33% - 5px); margin: 0px !important; } width: calc(15% - 5px);
.xl\:grid-w35 { width: calc(35% - 5px); margin: 0px !important; } margin: 0px !important;
.xl\:grid-w40 { width: calc(40% - 5px); margin: 0px !important; } }
.xl\:grid-w45 { width: calc(45% - 5px); margin: 0px !important; } .xl\:grid-w20 {
.xl\:grid-w50 { width: calc(50% - 5px); margin: 0px !important; } width: calc(20% - 5px);
.xl\:grid-w55 { width: calc(55% - 5px); margin: 0px !important; } margin: 0px !important;
.xl\:grid-w60 { width: calc(60% - 5px); margin: 0px !important; } }
.xl\:grid-w65 { width: calc(65% - 5px); margin: 0px !important; } .xl\:grid-w25 {
.xl\:grid-w66 { width: calc(66% - 5px); margin: 0px !important; } width: calc(25% - 5px);
.xl\:grid-w70 { width: calc(70% - 5px); margin: 0px !important; } margin: 0px !important;
.xl\:grid-w75 { width: calc(75% - 5px); margin: 0px !important; } }
.xl\:grid-w80 { width: calc(80% - 5px); margin: 0px !important; } .xl\:grid-w30 {
.xl\:grid-w85 { width: calc(85% - 5px); margin: 0px !important; } width: calc(30% - 5px);
.xl\:grid-w90 { width: calc(90% - 5px); margin: 0px !important; } margin: 0px !important;
.xl\:grid-w95 { width: calc(95% - 5px); margin: 0px !important; } }
.xl\:grid-w100 { width: calc(100% - 5px); margin: 0px !important; } .xl\:grid-w33 {
width: calc(33% - 5px);
margin: 0px !important;
}
.xl\:grid-w35 {
width: calc(35% - 5px);
margin: 0px !important;
}
.xl\:grid-w40 {
width: calc(40% - 5px);
margin: 0px !important;
}
.xl\:grid-w45 {
width: calc(45% - 5px);
margin: 0px !important;
}
.xl\:grid-w50 {
width: calc(50% - 5px);
margin: 0px !important;
}
.xl\:grid-w55 {
width: calc(55% - 5px);
margin: 0px !important;
}
.xl\:grid-w60 {
width: calc(60% - 5px);
margin: 0px !important;
}
.xl\:grid-w65 {
width: calc(65% - 5px);
margin: 0px !important;
}
.xl\:grid-w66 {
width: calc(66% - 5px);
margin: 0px !important;
}
.xl\:grid-w70 {
width: calc(70% - 5px);
margin: 0px !important;
}
.xl\:grid-w75 {
width: calc(75% - 5px);
margin: 0px !important;
}
.xl\:grid-w80 {
width: calc(80% - 5px);
margin: 0px !important;
}
.xl\:grid-w85 {
width: calc(85% - 5px);
margin: 0px !important;
}
.xl\:grid-w90 {
width: calc(90% - 5px);
margin: 0px !important;
}
.xl\:grid-w95 {
width: calc(95% - 5px);
margin: 0px !important;
}
.xl\:grid-w100 {
width: calc(100% - 5px);
margin: 0px !important;
}
} }
@screen 2xl { @screen 2xl {
.2xl\:grid-w10 { width: calc(10% - 5px); margin: 0px !important; } .2xl\:grid-w10 {
.2xl\:grid-w15 { width: calc(15% - 5px); margin: 0px !important; } width: calc(10% - 5px);
.2xl\:grid-w20 { width: calc(20% - 5px); margin: 0px !important; } margin: 0px !important;
.2xl\:grid-w25 { width: calc(25% - 5px); margin: 0px !important; } }
.2xl\:grid-w30 { width: calc(30% - 5px); margin: 0px !important; } .2xl\:grid-w15 {
.2xl\:grid-w33 { width: calc(33% - 5px); margin: 0px !important; } width: calc(15% - 5px);
.2xl\:grid-w35 { width: calc(35% - 5px); margin: 0px !important; } margin: 0px !important;
.2xl\:grid-w40 { width: calc(40% - 5px); margin: 0px !important; } }
.2xl\:grid-w45 { width: calc(45% - 5px); margin: 0px !important; } .2xl\:grid-w20 {
.2xl\:grid-w50 { width: calc(50% - 5px); margin: 0px !important; } width: calc(20% - 5px);
.2xl\:grid-w55 { width: calc(55% - 5px); margin: 0px !important; } margin: 0px !important;
.2xl\:grid-w60 { width: calc(60% - 5px); margin: 0px !important; } }
.2xl\:grid-w65 { width: calc(65% - 5px); margin: 0px !important; } .2xl\:grid-w25 {
.2xl\:grid-w66 { width: calc(66% - 5px); margin: 0px !important; } width: calc(25% - 5px);
.2xl\:grid-w70 { width: calc(70% - 5px); margin: 0px !important; } margin: 0px !important;
.2xl\:grid-w75 { width: calc(75% - 5px); margin: 0px !important; } }
.2xl\:grid-w80 { width: calc(80% - 5px); margin: 0px !important; } .2xl\:grid-w30 {
.2xl\:grid-w85 { width: calc(85% - 5px); margin: 0px !important; } width: calc(30% - 5px);
.2xl\:grid-w90 { width: calc(90% - 5px); margin: 0px !important; } margin: 0px !important;
.2xl\:grid-w95 { width: calc(95% - 5px); margin: 0px !important; } }
.2xl\:grid-w100 { width: calc(100% - 5px); margin: 0px !important; } .2xl\:grid-w33 {
width: calc(33% - 5px);
margin: 0px !important;
}
.2xl\:grid-w35 {
width: calc(35% - 5px);
margin: 0px !important;
}
.2xl\:grid-w40 {
width: calc(40% - 5px);
margin: 0px !important;
}
.2xl\:grid-w45 {
width: calc(45% - 5px);
margin: 0px !important;
}
.2xl\:grid-w50 {
width: calc(50% - 5px);
margin: 0px !important;
}
.2xl\:grid-w55 {
width: calc(55% - 5px);
margin: 0px !important;
}
.2xl\:grid-w60 {
width: calc(60% - 5px);
margin: 0px !important;
}
.2xl\:grid-w65 {
width: calc(65% - 5px);
margin: 0px !important;
}
.2xl\:grid-w66 {
width: calc(66% - 5px);
margin: 0px !important;
}
.2xl\:grid-w70 {
width: calc(70% - 5px);
margin: 0px !important;
}
.2xl\:grid-w75 {
width: calc(75% - 5px);
margin: 0px !important;
}
.2xl\:grid-w80 {
width: calc(80% - 5px);
margin: 0px !important;
}
.2xl\:grid-w85 {
width: calc(85% - 5px);
margin: 0px !important;
}
.2xl\:grid-w90 {
width: calc(90% - 5px);
margin: 0px !important;
}
.2xl\:grid-w95 {
width: calc(95% - 5px);
margin: 0px !important;
}
.2xl\:grid-w100 {
width: calc(100% - 5px);
margin: 0px !important;
}
} }
/* Carousel Specific Styles */ /* Carousel Specific Styles */
.ratio-16-9 { padding-top: 56.25%; } /* 16:9 Aspect Ratio */ .ratio-16-9 {
.ratio-21-9 { padding-top: 42.85%; } /* 21:9 Aspect Ratio */ padding-top: 56.25%;
.ratio-32-9 { padding-top: 28.125%; } /* 32:9 Aspect Ratio */ } /* 16:9 Aspect Ratio */
.ratio-21-9 {
padding-top: 42.85%;
} /* 21:9 Aspect Ratio */
.ratio-32-9 {
padding-top: 28.125%;
} /* 32:9 Aspect Ratio */
@screen sm { @screen sm {
.sm\:ratio-16-9 { padding-top: 56.25%; } /* 16:9 Aspect Ratio */ .sm\:ratio-16-9 {
.sm\:ratio-21-9 { padding-top: 42.85%; } /* 21:9 Aspect Ratio */ padding-top: 56.25%;
.sm\:ratio-32-9 { padding-top: 28.125%; } /* 32:9 Aspect Ratio */ } /* 16:9 Aspect Ratio */
.sm\:ratio-21-9 {
padding-top: 42.85%;
} /* 21:9 Aspect Ratio */
.sm\:ratio-32-9 {
padding-top: 28.125%;
} /* 32:9 Aspect Ratio */
} }
@screen md { @screen md {
.md\:ratio-16-9 { padding-top: 56.25%; } /* 16:9 Aspect Ratio */ .md\:ratio-16-9 {
.md\:ratio-21-9 { padding-top: 42.85%; } /* 21:9 Aspect Ratio */ padding-top: 56.25%;
.md\:ratio-32-9 { padding-top: 28.125%; } /* 32:9 Aspect Ratio */ } /* 16:9 Aspect Ratio */
.md\:ratio-21-9 {
padding-top: 42.85%;
} /* 21:9 Aspect Ratio */
.md\:ratio-32-9 {
padding-top: 28.125%;
} /* 32:9 Aspect Ratio */
} }
@screen lg { @screen lg {
.lg\:ratio-16-9 { padding-top: 56.25%; } /* 16:9 Aspect Ratio */ .lg\:ratio-16-9 {
.lg\:ratio-21-9 { padding-top: 42.85%; } /* 21:9 Aspect Ratio */ padding-top: 56.25%;
.lg\:ratio-32-9 { padding-top: 28.125%; } /* 32:9 Aspect Ratio */ } /* 16:9 Aspect Ratio */
.lg\:ratio-21-9 {
padding-top: 42.85%;
} /* 21:9 Aspect Ratio */
.lg\:ratio-32-9 {
padding-top: 28.125%;
} /* 32:9 Aspect Ratio */
} }
@screen xl { @screen xl {
.xl\:ratio-16-9 { padding-top: 56.25%; } /* 16:9 Aspect Ratio */ .xl\:ratio-16-9 {
.xl\:ratio-21-9 { padding-top: 42.85%; } /* 21:9 Aspect Ratio */ padding-top: 56.25%;
.xl\:ratio-32-9 { padding-top: 28.125%; } /* 32:9 Aspect Ratio */ } /* 16:9 Aspect Ratio */
.xl\:ratio-21-9 {
padding-top: 42.85%;
} /* 21:9 Aspect Ratio */
.xl\:ratio-32-9 {
padding-top: 28.125%;
} /* 32:9 Aspect Ratio */
} }
@screen 2xl { @screen 2xl {
.2xl\:ratio-16-9 { padding-top: 56.25%; } /* 16:9 Aspect Ratio */ .2xl\:ratio-16-9 {
.2xl\:ratio-21-9 { padding-top: 42.85%; } /* 21:9 Aspect Ratio */ padding-top: 56.25%;
.2xl\:ratio-32-9 { padding-top: 28.125%; } /* 32:9 Aspect Ratio */ } /* 16:9 Aspect Ratio */
} .2xl\:ratio-21-9 {
padding-top: 42.85%;
} /* 21:9 Aspect Ratio */
.2xl\:ratio-32-9 {
padding-top: 28.125%;
} /* 32:9 Aspect Ratio */
}

View File

@@ -1,32 +1,33 @@
:root { --color-neutral: 255, 255, 255; :root {
--color-neutral-50: 255,255,255; --color-neutral: 255, 255, 255;
--color-neutral-100: 214,251,252; --color-neutral-50: 255, 255, 255;
--color-neutral-200: 142,245,247; --color-neutral-100: 214, 251, 252;
--color-neutral-300: 70,239,243; --color-neutral-200: 142, 245, 247;
--color-neutral-400: 15,217,222; --color-neutral-300: 70, 239, 243;
--color-neutral-500: 10,147,150; --color-neutral-400: 15, 217, 222;
--color-neutral-600: 7,110,112; --color-neutral-500: 10, 147, 150;
--color-neutral-700: 5,72,74; --color-neutral-600: 7, 110, 112;
--color-neutral-800: 2,35,35; --color-neutral-700: 5, 72, 74;
--color-neutral-900: 0,0,0; --color-neutral-800: 2, 35, 35;
--color-primary-50: 255,255,255; --color-neutral-900: 0, 0, 0;
--color-primary-100: 255,255,255; --color-primary-50: 255, 255, 255;
--color-primary-200: 255,240,212; --color-primary-100: 255, 255, 255;
--color-primary-300: 255,213,136; --color-primary-200: 255, 240, 212;
--color-primary-400: 255,187,59; --color-primary-300: 255, 213, 136;
--color-primary-500: 238,155,0; --color-primary-400: 255, 187, 59;
--color-primary-600: 197,128,0; --color-primary-500: 238, 155, 0;
--color-primary-700: 156,102,0; --color-primary-600: 197, 128, 0;
--color-primary-800: 116,75,0; --color-primary-700: 156, 102, 0;
--color-primary-900: 75,49,0; --color-primary-800: 116, 75, 0;
--color-secondary-50: 255,255,255; --color-primary-900: 75, 49, 0;
--color-secondary-100: 255,246,241; --color-secondary-50: 255, 255, 255;
--color-secondary-200: 254,194,166; --color-secondary-100: 255, 246, 241;
--color-secondary-300: 252,142,91; --color-secondary-200: 254, 194, 166;
--color-secondary-400: 251,91,15; --color-secondary-300: 252, 142, 91;
--color-secondary-500: 187,62,3; --color-secondary-400: 251, 91, 15;
--color-secondary-600: 147,49,2; --color-secondary-500: 187, 62, 3;
--color-secondary-700: 107,35,2; --color-secondary-600: 147, 49, 2;
--color-secondary-800: 67,22,1; --color-secondary-700: 107, 35, 2;
--color-secondary-900: 26,9,0; --color-secondary-800: 67, 22, 1;
} --color-secondary-900: 26, 9, 0;
}

View File

@@ -1,32 +1,33 @@
:root { --color-neutral: 255, 255, 255; :root {
--color-neutral-50: 255,255,255; --color-neutral: 255, 255, 255;
--color-neutral-100: 254,197,207; --color-neutral-50: 255, 255, 255;
--color-neutral-200: 253,121,144; --color-neutral-100: 254, 197, 207;
--color-neutral-300: 251,46,82; --color-neutral-200: 253, 121, 144;
--color-neutral-400: 217,4,41; --color-neutral-300: 251, 46, 82;
--color-neutral-500: 177,3,33; --color-neutral-400: 217, 4, 41;
--color-neutral-600: 137,3,26; --color-neutral-500: 177, 3, 33;
--color-neutral-700: 97,2,18; --color-neutral-600: 137, 3, 26;
--color-neutral-800: 57,1,11; --color-neutral-700: 97, 2, 18;
--color-neutral-900: 17,0,3; --color-neutral-800: 57, 1, 11;
--color-primary-50: 255,255,255; --color-neutral-900: 17, 0, 3;
--color-primary-100: 255,255,255; --color-primary-50: 255, 255, 255;
--color-primary-200: 230,233,238; --color-primary-100: 255, 255, 255;
--color-primary-300: 186,193,206; --color-primary-200: 230, 233, 238;
--color-primary-400: 141,153,174; --color-primary-300: 186, 193, 206;
--color-primary-500: 117,132,157; --color-primary-400: 141, 153, 174;
--color-primary-600: 97,111,136; --color-primary-500: 117, 132, 157;
--color-primary-700: 80,92,113; --color-primary-600: 97, 111, 136;
--color-primary-800: 63,72,89; --color-primary-700: 80, 92, 113;
--color-primary-900: 46,53,65; --color-primary-800: 63, 72, 89;
--color-secondary-50: 255,255,255; --color-primary-900: 46, 53, 65;
--color-secondary-100: 217,230,238; --color-secondary-50: 255, 255, 255;
--color-secondary-200: 164,195,215; --color-secondary-100: 217, 230, 238;
--color-secondary-300: 111,160,192; --color-secondary-200: 164, 195, 215;
--color-secondary-400: 69,123,157; --color-secondary-300: 111, 160, 192;
--color-secondary-500: 57,101,129; --color-secondary-400: 69, 123, 157;
--color-secondary-600: 44,79,100; --color-secondary-500: 57, 101, 129;
--color-secondary-700: 32,56,72; --color-secondary-600: 44, 79, 100;
--color-secondary-800: 19,34,44; --color-secondary-700: 32, 56, 72;
--color-secondary-900: 7,12,15; --color-secondary-800: 19, 34, 44;
} --color-secondary-900: 7, 12, 15;
}

View File

@@ -1,32 +1,33 @@
:root { --color-neutral: 255, 255, 255; :root {
--color-neutral-50: 255,255,255; --color-neutral: 255, 255, 255;
--color-neutral-100: 232,238,237; --color-neutral-50: 255, 255, 255;
--color-neutral-200: 188,206,203; --color-neutral-100: 232, 238, 237;
--color-neutral-300: 143,174,170; --color-neutral-200: 188, 206, 203;
--color-neutral-400: 101,140,134; --color-neutral-300: 143, 174, 170;
--color-neutral-500: 84,116,111; --color-neutral-400: 101, 140, 134;
--color-neutral-600: 67,93,89; --color-neutral-500: 84, 116, 111;
--color-neutral-700: 50,69,66; --color-neutral-600: 67, 93, 89;
--color-neutral-800: 33,45,43; --color-neutral-700: 50, 69, 66;
--color-neutral-900: 16,21,21; --color-neutral-800: 33, 45, 43;
--color-primary-50: 255,255,255; --color-neutral-900: 16, 21, 21;
--color-primary-100: 255,255,255; --color-primary-50: 255, 255, 255;
--color-primary-200: 205,252,247; --color-primary-100: 255, 255, 255;
--color-primary-300: 132,249,235; --color-primary-200: 205, 252, 247;
--color-primary-400: 59,245,223; --color-primary-300: 132, 249, 235;
--color-primary-500: 20,243,217; --color-primary-400: 59, 245, 223;
--color-primary-600: 11,212,188; --color-primary-500: 20, 243, 217;
--color-primary-700: 9,173,153; --color-primary-600: 11, 212, 188;
--color-primary-800: 7,134,119; --color-primary-700: 9, 173, 153;
--color-primary-900: 5,95,84; --color-primary-800: 7, 134, 119;
--color-secondary-50: 255,255,255; --color-primary-900: 5, 95, 84;
--color-secondary-100: 194,253,219; --color-secondary-50: 255, 255, 255;
--color-secondary-200: 120,251,175; --color-secondary-100: 194, 253, 219;
--color-secondary-300: 45,249,130; --color-secondary-200: 120, 251, 175;
--color-secondary-400: 6,212,92; --color-secondary-300: 45, 249, 130;
--color-secondary-500: 5,172,75; --color-secondary-400: 6, 212, 92;
--color-secondary-600: 4,133,58; --color-secondary-500: 5, 172, 75;
--color-secondary-700: 3,93,40; --color-secondary-600: 4, 133, 58;
--color-secondary-800: 2,53,23; --color-secondary-700: 3, 93, 40;
--color-secondary-900: 0,14,6; --color-secondary-800: 2, 53, 23;
} --color-secondary-900: 0, 14, 6;
}

View File

@@ -1,32 +1,33 @@
:root { --color-neutral: 255, 255, 255; :root {
--color-neutral-50: 255,255,255; --color-neutral: 255, 255, 255;
--color-neutral-100: 255,255,255; --color-neutral-50: 255, 255, 255;
--color-neutral-200: 201,209,244; --color-neutral-100: 255, 255, 255;
--color-neutral-300: 137,156,231; --color-neutral-200: 201, 209, 244;
--color-neutral-400: 74,103,217; --color-neutral-300: 137, 156, 231;
--color-neutral-500: 37,65,178; --color-neutral-400: 74, 103, 217;
--color-neutral-600: 30,53,144; --color-neutral-500: 37, 65, 178;
--color-neutral-700: 23,40,110; --color-neutral-600: 30, 53, 144;
--color-neutral-800: 16,28,77; --color-neutral-700: 23, 40, 110;
--color-neutral-900: 9,16,43; --color-neutral-800: 16, 28, 77;
--color-primary-50: 255,255,255; --color-neutral-900: 9, 16, 43;
--color-primary-100: 255,255,255; --color-primary-50: 255, 255, 255;
--color-primary-200: 252,211,226; --color-primary-100: 255, 255, 255;
--color-primary-300: 246,140,178; --color-primary-200: 252, 211, 226;
--color-primary-400: 240,69,131; --color-primary-300: 246, 140, 178;
--color-primary-500: 216,17,89; --color-primary-400: 240, 69, 131;
--color-primary-600: 178,14,73; --color-primary-500: 216, 17, 89;
--color-primary-700: 140,11,58; --color-primary-600: 178, 14, 73;
--color-primary-800: 103,8,42; --color-primary-700: 140, 11, 58;
--color-primary-900: 65,5,27; --color-primary-800: 103, 8, 42;
--color-secondary-50: 255,255,255; --color-primary-900: 65, 5, 27;
--color-secondary-100: 255,255,255; --color-secondary-50: 255, 255, 255;
--color-secondary-200: 255,255,255; --color-secondary-100: 255, 255, 255;
--color-secondary-300: 255,242,219; --color-secondary-200: 255, 255, 255;
--color-secondary-400: 255,215,143; --color-secondary-300: 255, 242, 219;
--color-secondary-500: 255,188,66; --color-secondary-400: 255, 215, 143;
--color-secondary-600: 255,174,25; --color-secondary-500: 255, 188, 66;
--color-secondary-700: 239,155,0; --color-secondary-600: 255, 174, 25;
--color-secondary-800: 199,128,0; --color-secondary-700: 239, 155, 0;
--color-secondary-900: 158,102,0; --color-secondary-800: 199, 128, 0;
} --color-secondary-900: 158, 102, 0;
}

View File

@@ -1,32 +1,33 @@
:root { --color-neutral: 255, 255, 255; :root {
--color-neutral-50: 255,255,255; --color-neutral: 255, 255, 255;
--color-neutral-100: 255,255,255; --color-neutral-50: 255, 255, 255;
--color-neutral-200: 218,196,249; --color-neutral-100: 255, 255, 255;
--color-neutral-300: 175,126,243; --color-neutral-200: 218, 196, 249;
--color-neutral-400: 131,56,236; --color-neutral-300: 175, 126, 243;
--color-neutral-500: 108,22,229; --color-neutral-400: 131, 56, 236;
--color-neutral-600: 91,18,192; --color-neutral-500: 108, 22, 229;
--color-neutral-700: 73,15,155; --color-neutral-600: 91, 18, 192;
--color-neutral-800: 56,11,118; --color-neutral-700: 73, 15, 155;
--color-neutral-900: 38,8,80; --color-neutral-800: 56, 11, 118;
--color-primary-50: 255,255,255; --color-neutral-900: 38, 8, 80;
--color-primary-100: 255,230,241; --color-primary-50: 255, 255, 255;
--color-primary-200: 255,153,197; --color-primary-100: 255, 230, 241;
--color-primary-300: 255,77,154; --color-primary-200: 255, 153, 197;
--color-primary-400: 255,0,110; --color-primary-300: 255, 77, 154;
--color-primary-500: 214,0,92; --color-primary-400: 255, 0, 110;
--color-primary-600: 173,0,75; --color-primary-500: 214, 0, 92;
--color-primary-700: 133,0,57; --color-primary-600: 173, 0, 75;
--color-primary-800: 92,0,40; --color-primary-700: 133, 0, 57;
--color-primary-900: 51,0,22; --color-primary-800: 92, 0, 40;
--color-secondary-50: 255,255,255; --color-primary-900: 51, 0, 22;
--color-secondary-100: 255,255,255; --color-secondary-50: 255, 255, 255;
--color-secondary-200: 211,228,255; --color-secondary-100: 255, 255, 255;
--color-secondary-300: 135,181,255; --color-secondary-200: 211, 228, 255;
--color-secondary-400: 58,134,255; --color-secondary-300: 135, 181, 255;
--color-secondary-500: 17,109,255; --color-secondary-400: 58, 134, 255;
--color-secondary-600: 0,89,231; --color-secondary-500: 17, 109, 255;
--color-secondary-700: 0,74,191; --color-secondary-600: 0, 89, 231;
--color-secondary-800: 0,58,150; --color-secondary-700: 0, 74, 191;
--color-secondary-900: 0,42,109; --color-secondary-800: 0, 58, 150;
} --color-secondary-900: 0, 42, 109;
}

View File

@@ -1,32 +1,33 @@
:root { --color-neutral: 255, 255, 255; :root {
--color-neutral-50: 255,255,255; --color-neutral: 255, 255, 255;
--color-neutral-100: 255,255,255; --color-neutral-50: 255, 255, 255;
--color-neutral-200: 214,219,222; --color-neutral-100: 255, 255, 255;
--color-neutral-300: 172,183,188; --color-neutral-200: 214, 219, 222;
--color-neutral-400: 129,146,154; --color-neutral-300: 172, 183, 188;
--color-neutral-500: 92,107,115; --color-neutral-400: 129, 146, 154;
--color-neutral-600: 74,86,92; --color-neutral-500: 92, 107, 115;
--color-neutral-700: 56,65,70; --color-neutral-600: 74, 86, 92;
--color-neutral-800: 38,44,47; --color-neutral-700: 56, 65, 70;
--color-neutral-900: 19,23,24; --color-neutral-800: 38, 44, 47;
--color-primary-50: 255,255,255; --color-neutral-900: 19, 23, 24;
--color-primary-100: 255,255,255; --color-primary-50: 255, 255, 255;
--color-primary-200: 255,255,255; --color-primary-100: 255, 255, 255;
--color-primary-300: 250,251,252; --color-primary-200: 255, 255, 255;
--color-primary-400: 204,216,222; --color-primary-300: 250, 251, 252;
--color-primary-500: 157,180,192; --color-primary-400: 204, 216, 222;
--color-primary-600: 132,161,176; --color-primary-500: 157, 180, 192;
--color-primary-700: 107,142,160; --color-primary-600: 132, 161, 176;
--color-primary-800: 89,121,138; --color-primary-700: 107, 142, 160;
--color-primary-900: 73,99,113; --color-primary-800: 89, 121, 138;
--color-secondary-50: 255,255,255; --color-primary-900: 73, 99, 113;
--color-secondary-100: 255,255,255; --color-secondary-50: 255, 255, 255;
--color-secondary-200: 182,240,255; --color-secondary-100: 255, 255, 255;
--color-secondary-300: 105,225,255; --color-secondary-200: 182, 240, 255;
--color-secondary-400: 28,209,255; --color-secondary-300: 105, 225, 255;
--color-secondary-500: 0,165,207; --color-secondary-400: 28, 209, 255;
--color-secondary-600: 0,132,166; --color-secondary-500: 0, 165, 207;
--color-secondary-700: 0,100,125; --color-secondary-600: 0, 132, 166;
--color-secondary-800: 0,67,85; --color-secondary-700: 0, 100, 125;
--color-secondary-900: 0,35,44; --color-secondary-800: 0, 67, 85;
} --color-secondary-900: 0, 35, 44;
}

View File

@@ -1,32 +1,33 @@
:root { --color-neutral: 255, 255, 255; :root {
--color-neutral-50: 255,255,255; --color-neutral: 255, 255, 255;
--color-neutral-100: 238,232,238; --color-neutral-50: 255, 255, 255;
--color-neutral-200: 206,188,206; --color-neutral-100: 238, 232, 238;
--color-neutral-300: 174,143,174; --color-neutral-200: 206, 188, 206;
--color-neutral-400: 140,101,140; --color-neutral-300: 174, 143, 174;
--color-neutral-500: 116,84,116; --color-neutral-400: 140, 101, 140;
--color-neutral-600: 93,67,93; --color-neutral-500: 116, 84, 116;
--color-neutral-700: 69,50,69; --color-neutral-600: 93, 67, 93;
--color-neutral-800: 45,33,45; --color-neutral-700: 69, 50, 69;
--color-neutral-900: 21,16,21; --color-neutral-800: 45, 33, 45;
--color-primary-50: 255,255,255; --color-neutral-900: 21, 16, 21;
--color-primary-100: 255,255,255; --color-primary-50: 255, 255, 255;
--color-primary-200: 252,205,252; --color-primary-100: 255, 255, 255;
--color-primary-300: 249,132,247; --color-primary-200: 252, 205, 252;
--color-primary-400: 245,59,242; --color-primary-300: 249, 132, 247;
--color-primary-500: 243,20,239; --color-primary-400: 245, 59, 242;
--color-primary-600: 212,11,208; --color-primary-500: 243, 20, 239;
--color-primary-700: 173,9,170; --color-primary-600: 212, 11, 208;
--color-primary-800: 134,7,132; --color-primary-700: 173, 9, 170;
--color-primary-900: 95,5,94; --color-primary-800: 134, 7, 132;
--color-secondary-50: 255,255,255; --color-primary-900: 95, 5, 94;
--color-secondary-100: 227,194,253; --color-secondary-50: 255, 255, 255;
--color-secondary-200: 192,120,251; --color-secondary-100: 227, 194, 253;
--color-secondary-300: 157,45,249; --color-secondary-200: 192, 120, 251;
--color-secondary-400: 119,6,212; --color-secondary-300: 157, 45, 249;
--color-secondary-500: 97,5,172; --color-secondary-400: 119, 6, 212;
--color-secondary-600: 74,4,133; --color-secondary-500: 97, 5, 172;
--color-secondary-700: 52,3,93; --color-secondary-600: 74, 4, 133;
--color-secondary-800: 30,2,53; --color-secondary-700: 52, 3, 93;
--color-secondary-900: 8,0,14; --color-secondary-800: 30, 2, 53;
} --color-secondary-900: 8, 0, 14;
}

View File

@@ -1,32 +1,33 @@
:root { --color-neutral: 255, 255, 255; :root {
--color-neutral-50: 203,255,227; --color-neutral: 255, 255, 255;
--color-neutral-100: 126,255,186; --color-neutral-50: 203, 255, 227;
--color-neutral-200: 49,255,145; --color-neutral-100: 126, 255, 186;
--color-neutral-300: 0,228,106; --color-neutral-200: 49, 255, 145;
--color-neutral-400: 0,152,71; --color-neutral-300: 0, 228, 106;
--color-neutral-500: 0,75,35; --color-neutral-400: 0, 152, 71;
--color-neutral-600: 0,50,23; --color-neutral-500: 0, 75, 35;
--color-neutral-700: 0,24,11; --color-neutral-600: 0, 50, 23;
--color-neutral-800: 0,24,11; --color-neutral-700: 0, 24, 11;
--color-neutral-900: 0,0,0; --color-neutral-800: 0, 24, 11;
--color-primary-50: 255,255,255; --color-neutral-900: 0, 0, 0;
--color-primary-100: 236,255,227; --color-primary-50: 255, 255, 255;
--color-primary-200: 184,255,150; --color-primary-100: 236, 255, 227;
--color-primary-300: 132,255,74; --color-primary-200: 184, 255, 150;
--color-primary-400: 80,252,0; --color-primary-300: 132, 255, 74;
--color-primary-500: 56,176,0; --color-primary-400: 80, 252, 0;
--color-primary-600: 48,151,0; --color-primary-500: 56, 176, 0;
--color-primary-700: 40,125,0; --color-primary-600: 48, 151, 0;
--color-primary-800: 40,125,0; --color-primary-700: 40, 125, 0;
--color-primary-900: 7,23,0; --color-primary-800: 40, 125, 0;
--color-secondary-50: 255,255,255; --color-primary-900: 7, 23, 0;
--color-secondary-100: 239,248,252; --color-secondary-50: 255, 255, 255;
--color-secondary-200: 173,220,242; --color-secondary-100: 239, 248, 252;
--color-secondary-300: 107,192,231; --color-secondary-200: 173, 220, 242;
--color-secondary-400: 41,164,220; --color-secondary-300: 107, 192, 231;
--color-secondary-500: 26,117,159; --color-secondary-400: 41, 164, 220;
--color-secondary-600: 22,101,137; --color-secondary-500: 26, 117, 159;
--color-secondary-700: 19,85,115; --color-secondary-600: 22, 101, 137;
--color-secondary-800: 19,85,115; --color-secondary-700: 19, 85, 115;
--color-secondary-900: 4,20,28; --color-secondary-800: 19, 85, 115;
} --color-secondary-900: 4, 20, 28;
}

View File

@@ -1,7 +1,9 @@
function setBackgroundBlur() { function setBackgroundBlur() {
const scriptElement = document.currentScript; const scriptElement = document.currentScript;
const targetId = scriptElement && scriptElement.getAttribute("data-target-id") ? scriptElement.getAttribute("data-target-id") const targetId =
: (console.error("data-target-id is null"), null); scriptElement && scriptElement.getAttribute("data-target-id")
? scriptElement.getAttribute("data-target-id")
: (console.error("data-target-id is null"), null);
window.addEventListener("scroll", () => { window.addEventListener("scroll", () => {
const scroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; const scroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;

View File

@@ -1,6 +1,10 @@
var scriptBundle = document.getElementById("script-bundle"); var scriptBundle = document.getElementById("script-bundle");
var copyText = scriptBundle && scriptBundle.getAttribute("data-copy")? scriptBundle.getAttribute("data-copy") : "Copy"; var copyText =
var copiedText = scriptBundle && scriptBundle.getAttribute("data-copied")? scriptBundle.getAttribute("data-copied") : "Copied"; scriptBundle && scriptBundle.getAttribute("data-copy") ? scriptBundle.getAttribute("data-copy") : "Copy";
var copiedText =
scriptBundle && scriptBundle.getAttribute("data-copied")
? scriptBundle.getAttribute("data-copied")
: "Copied";
function createCopyButton(highlightDiv) { function createCopyButton(highlightDiv) {
const button = document.createElement("button"); const button = document.createElement("button");

View File

@@ -1,26 +1,32 @@
function fetchRepo() { function fetchRepo() {
const scriptElement = document.currentScript; const scriptElement = document.currentScript;
const repoURL = scriptElement && scriptElement.getAttribute("data-repo-url") ? scriptElement.getAttribute("data-repo-url") const repoURL =
: (console.error("data-repo-url is null"), null); scriptElement && scriptElement.getAttribute("data-repo-url")
const repoId = scriptElement && scriptElement.getAttribute("data-repo-id") ? scriptElement.getAttribute("data-repo-id") ? scriptElement.getAttribute("data-repo-url")
: (console.error("data-repo-id is null"), null); : (console.error("data-repo-url is null"), null);
const requestObjects = const repoId =
repoId.startsWith("github") ? ["full_name", "description", "stargazers_count", "forks"] scriptElement && scriptElement.getAttribute("data-repo-id")
: repoId.startsWith("gitlab") ? ["name_with_namespace", "description", "star_count", "forks_count"] ? scriptElement.getAttribute("data-repo-id")
: ["full_name", "description", "stars_count", "forks_count"]; : (console.error("data-repo-id is null"), null);
const requestObjects = repoId.startsWith("github")
? ["full_name", "description", "stargazers_count", "forks"]
: repoId.startsWith("gitlab")
? ["name_with_namespace", "description", "star_count", "forks_count"]
: ["full_name", "description", "stars_count", "forks_count"];
fetch(repoURL, { fetch(repoURL, {
headers: new Headers({ headers: new Headers({
"User-agent": "Mozilla/4.0 Custom User Agent" "User-agent": "Mozilla/4.0 Custom User Agent",
}) }),
}) })
.then((response) => response.json()) .then((response) => response.json())
.then((data) => { .then((data) => {
requestObjects.forEach((requestObject) => { requestObjects.forEach((requestObject) => {
let element = document.getElementById(`${repoId}-${requestObject}`); let element = document.getElementById(`${repoId}-${requestObject}`);
if (requestObject === "stargazers_count" && repoId.startsWith("github")) { if (requestObject === "stargazers_count" && repoId.startsWith("github")) {
element = document.getElementById(`${repoId}-stargazers`); element = document.getElementById(`${repoId}-stargazers`);
} }
element ? (element.innerHTML = data[requestObject]) element
? (element.innerHTML = data[requestObject])
: (console.error(`Element '${repoId}-${requestObject}' not found`), null); : (console.error(`Element '${repoId}-${requestObject}' not found`), null);
}); });
}) })

View File

@@ -1,6 +1,12 @@
const pageScriptElement = document.currentScript; const pageScriptElement = document.currentScript;
const oid = pageScriptElement && pageScriptElement.getAttribute("data-oid") ? pageScriptElement.getAttribute("data-oid") : (console.error("data-oid is null"), null); const oid =
const oid_likes = pageScriptElement && pageScriptElement.getAttribute("data-oid-likes") ? pageScriptElement.getAttribute("data-oid-likes") : (console.error("data-oid-likes is null"), null); pageScriptElement && pageScriptElement.getAttribute("data-oid")
? pageScriptElement.getAttribute("data-oid")
: (console.error("data-oid is null"), null);
const oid_likes =
pageScriptElement && pageScriptElement.getAttribute("data-oid-likes")
? pageScriptElement.getAttribute("data-oid-likes")
: (console.error("data-oid-likes is null"), null);
const liked_page = false; const liked_page = false;
const id = oid ? oid.replaceAll("/", "-") : oid; const id = oid ? oid.replaceAll("/", "-") : oid;
const id_likes = oid_likes ? oid_likes.replaceAll("/", "-") : oid_likes; const id_likes = oid_likes ? oid_likes.replaceAll("/", "-") : oid_likes;
@@ -8,101 +14,118 @@ const id_likes = oid_likes ? oid_likes.replaceAll("/", "-") : oid_likes;
if (typeof auth !== "undefined") { if (typeof auth !== "undefined") {
const viewed = localStorage.getItem(id); const viewed = localStorage.getItem(id);
if (!viewed) { if (!viewed) {
auth.signInAnonymously() auth
.then(() => { .signInAnonymously()
const docRef = db.collection('views').doc(id) .then(() => {
localStorage.setItem(id, true); const docRef = db.collection("views").doc(id);
docRef.get().then((doc) => { localStorage.setItem(id, true);
if (doc.exists) { docRef
db.collection('views').doc(id).update({ .get()
views: firebase.firestore.FieldValue.increment(1) .then((doc) => {
}); if (doc.exists) {
} else { db.collection("views")
db.collection('views').doc(id).set({ views: 1 }) .doc(id)
} .update({
}).catch((error) => { views: firebase.firestore.FieldValue.increment(1),
console.log("Error getting document:", error);
}); });
}) } else {
.catch((error) => { db.collection("views").doc(id).set({ views: 1 });
const errorCode = error.code; }
const errorMessage = error.message; })
console.error(errorCode, errorMessage) .catch((error) => {
}); console.log("Error getting document:", error);
} });
})
.catch((error) => {
const errorCode = error.code;
const errorMessage = error.message;
console.error(errorCode, errorMessage);
});
}
const liked = localStorage.getItem(id_likes); const liked = localStorage.getItem(id_likes);
if (liked) {
liked_page = true
document.querySelectorAll("span[id='button_likes_heart']")[0].style.display = ""
document.querySelectorAll("span[id='button_likes_emtpty_heart']")[0].style.display = "none"
document.querySelectorAll("span[id='button_likes_text']")[0].innerText = ""
}
if (liked) {
liked_page = true;
document.querySelectorAll("span[id='button_likes_heart']")[0].style.display = "";
document.querySelectorAll("span[id='button_likes_emtpty_heart']")[0].style.display = "none";
document.querySelectorAll("span[id='button_likes_text']")[0].innerText = "";
}
} }
function like_article(id_likes) { function like_article(id_likes) {
auth.signInAnonymously() auth
.then(() => { .signInAnonymously()
const docRef = db.collection('likes').doc(id_likes) .then(() => {
docRef.get().then((doc) => { const docRef = db.collection("likes").doc(id_likes);
liked_page = true docRef
localStorage.setItem(id_likes, true); .get()
document.querySelectorAll("span[id='button_likes_heart']")[0].style.display = "" .then((doc) => {
document.querySelectorAll("span[id='button_likes_emtpty_heart']")[0].style.display = "none" liked_page = true;
document.querySelectorAll("span[id='button_likes_text']")[0].innerText = "" localStorage.setItem(id_likes, true);
if (doc.exists) { document.querySelectorAll("span[id='button_likes_heart']")[0].style.display = "";
db.collection('likes').doc(id_likes).update({ document.querySelectorAll("span[id='button_likes_emtpty_heart']")[0].style.display = "none";
likes: firebase.firestore.FieldValue.increment(1) document.querySelectorAll("span[id='button_likes_text']")[0].innerText = "";
}); if (doc.exists) {
} else { db.collection("likes")
db.collection('likes').doc(id_likes).set({ likes: 1 }) .doc(id_likes)
} .update({
}).catch((error) => { likes: firebase.firestore.FieldValue.increment(1),
console.log("Error getting document:", error); });
}); } else {
db.collection("likes").doc(id_likes).set({ likes: 1 });
}
}) })
.catch((error) => { .catch((error) => {
const errorCode = error.code; console.log("Error getting document:", error);
const errorMessage = error.message;
console.error(errorCode, errorMessage)
}); });
})
.catch((error) => {
const errorCode = error.code;
const errorMessage = error.message;
console.error(errorCode, errorMessage);
});
} }
function remove_like_article(id_likes) { function remove_like_article(id_likes) {
auth.signInAnonymously() auth
.then(() => { .signInAnonymously()
const docRef = db.collection('likes').doc(id_likes) .then(() => {
docRef.get().then((doc) => { const docRef = db.collection("likes").doc(id_likes);
liked_page = false docRef
localStorage.removeItem(id_likes); .get()
document.querySelectorAll("span[id='button_likes_heart']")[0].style.display = "none" .then((doc) => {
document.querySelectorAll("span[id='button_likes_emtpty_heart']")[0].style.display = "" liked_page = false;
document.querySelectorAll("span[id='button_likes_text']")[0].innerText = "\xa0Like" localStorage.removeItem(id_likes);
if (doc.exists) { document.querySelectorAll("span[id='button_likes_heart']")[0].style.display = "none";
db.collection('likes').doc(id_likes).update({ document.querySelectorAll("span[id='button_likes_emtpty_heart']")[0].style.display = "";
likes: firebase.firestore.FieldValue.increment(-1) document.querySelectorAll("span[id='button_likes_text']")[0].innerText = "\xa0Like";
}); if (doc.exists) {
} else { db.collection("likes")
db.collection('likes').doc(id_likes).set({ likes: 0 }) .doc(id_likes)
} .update({
}).catch((error) => { likes: firebase.firestore.FieldValue.increment(-1),
console.log("Error getting document:", error); });
}); } else {
db.collection("likes").doc(id_likes).set({ likes: 0 });
}
}) })
.catch((error) => { .catch((error) => {
const errorCode = error.code; console.log("Error getting document:", error);
const errorMessage = error.message;
console.error(errorCode, errorMessage)
}); });
})
.catch((error) => {
const errorCode = error.code;
const errorMessage = error.message;
console.error(errorCode, errorMessage);
});
} }
function process_article() { function process_article() {
if (!liked_page) { if (!liked_page) {
like_article(id_likes) like_article(id_likes);
} else { } else {
remove_like_article(id_likes) remove_like_article(id_likes);
} }
} }

View File

@@ -1,71 +1,70 @@
if (typeof auth !== 'undefined') { if (typeof auth !== "undefined") {
var viewsCollection = db.collection('views'); var viewsCollection = db.collection("views");
var likesCollection = db.collection('likes'); var likesCollection = db.collection("likes");
function numberWithCommas(x) { function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function toggleLoaders(node) {
var classesString = node.className;
if (classesString == "") return;
var classes = classesString.split(" ");
for (var i in classes) {
node.classList.toggle(classes[i]);
} }
}
function toggleLoaders(node){ var update_views = function (node, id) {
var classesString = node.className; viewsCollection.doc(id).onSnapshot((doc) => {
if(classesString == "") return var data = doc.data();
var classes = classesString.split(" "); if (data) {
for(var i in classes){ node.innerText = numberWithCommas(data.views);
node.classList.toggle(classes[i]) } else {
node.innerText = 0;
}
toggleLoaders(node);
});
};
var update_likes = function (node, id) {
likesCollection.doc(id).onSnapshot((doc) => {
var data = doc.data();
if (data) {
node.innerText = numberWithCommas(data.likes);
} else {
node.innerText = 0;
}
toggleLoaders(node);
});
};
auth
.signInAnonymously()
.then(() => {
var views_nodes = document.querySelectorAll("span[id^='views_']");
for (var i in views_nodes) {
var node = views_nodes[i];
var id = node.id ? node.id.replaceAll("/", "-") : node.id;
if (id) {
update_views(node, id);
} }
} }
var update_views = function (node, id) { var likes_nodes = document.querySelectorAll("span[id^='likes_']");
viewsCollection.doc(id).onSnapshot(doc => {
var data = doc.data();
if (data) {
node.innerText = numberWithCommas(data.views)
} else {
node.innerText = 0
}
toggleLoaders(node)
})
}
var update_likes = function (node, id) { for (var i in likes_nodes) {
likesCollection.doc(id).onSnapshot(doc => { var node = likes_nodes[i];
var data = doc.data(); var id = node.id ? node.id.replaceAll("/", "-") : node.id;
if (data) { if (id) {
node.innerText = numberWithCommas(data.likes) update_likes(node, id);
} else { }
node.innerText = 0 }
} })
toggleLoaders(node) .catch((error) => {
var errorCode = error.code;
}) var errorMessage = error.message;
} console.error(errorCode, errorMessage);
});
}
auth.signInAnonymously()
.then(() => {
var views_nodes = document.querySelectorAll("span[id^='views_']")
for (var i in views_nodes) {
var node = views_nodes[i]
var id = node.id ? node.id.replaceAll("/", "-") : node.id
if (id) {
update_views(node, id)
}
}
var likes_nodes = document.querySelectorAll("span[id^='likes_']")
for (var i in likes_nodes) {
var node = likes_nodes[i]
var id = node.id ? node.id.replaceAll("/", "-") : node.id
if (id) {
update_likes(node, id)
}
}
})
.catch((error) => {
var errorCode = error.code;
var errorMessage = error.message;
console.error(errorCode, errorMessage)
});
}

View File

@@ -13,8 +13,8 @@ var indexed = false;
var hasResults = false; var hasResults = false;
// Listen for events // Listen for events
showButton? showButton.addEventListener("click", displaySearch) : null; showButton ? showButton.addEventListener("click", displaySearch) : null;
showButtonMobile? showButtonMobile.addEventListener("click", displaySearch) : null; showButtonMobile ? showButtonMobile.addEventListener("click", displaySearch) : null;
hideButton.addEventListener("click", hideSearch); hideButton.addEventListener("click", hideSearch);
wrapper.addEventListener("click", hideSearch); wrapper.addEventListener("click", hideSearch);
modal.addEventListener("click", function (event) { modal.addEventListener("click", function (event) {
@@ -25,12 +25,9 @@ modal.addEventListener("click", function (event) {
document.addEventListener("keydown", function (event) { document.addEventListener("keydown", function (event) {
// Forward slash to open search wrapper // Forward slash to open search wrapper
if (event.key == "/") { if (event.key == "/") {
const active = document.activeElement const active = document.activeElement;
const tag = active.tagName const tag = active.tagName;
const isInputField = const isInputField = tag === "INPUT" || tag === "TEXTAREA" || active.isContentEditable;
tag === "INPUT" ||
tag === "TEXTAREA" ||
active.isContentEditable
if (!searchVisible && !isInputField) { if (!searchVisible && !isInputField) {
event.preventDefault(); event.preventDefault();
@@ -82,7 +79,6 @@ document.addEventListener("keydown", function (event) {
} }
} }
} }
}); });
// Update search on each keypress // Update search on each keypress
@@ -129,7 +125,7 @@ function fetchJSON(path, callback) {
function buildIndex() { function buildIndex() {
var baseURL = wrapper.getAttribute("data-url"); var baseURL = wrapper.getAttribute("data-url");
baseURL = baseURL.replace(/\/?$/, '/'); baseURL = baseURL.replace(/\/?$/, "/");
fetchJSON(baseURL + "index.json", function (data) { fetchJSON(baseURL + "index.json", function (data) {
var options = { var options = {
shouldSort: true, shouldSort: true,
@@ -165,8 +161,15 @@ function executeQuery(term) {
var div = document.createElement("div"); var div = document.createElement("div");
div.innerHTML = html; div.innerHTML = html;
value.item.summary = div.textContent || div.innerText || ""; value.item.summary = div.textContent || div.innerText || "";
var title = value.item.externalUrl? value.item.title + '<span class="text-xs ml-2 align-center cursor-default text-neutral-400 dark:text-neutral-500">'+value.item.externalUrl+'</span>' : value.item.title; var title = value.item.externalUrl
var linkconfig = value.item.externalUrl? 'target="_blank" rel="noopener" href="'+value.item.externalUrl+'"' : 'href="'+value.item.permalink+'"'; ? value.item.title +
'<span class="text-xs ml-2 align-center cursor-default text-neutral-400 dark:text-neutral-500">' +
value.item.externalUrl +
"</span>"
: value.item.title;
var linkconfig = value.item.externalUrl
? 'target="_blank" rel="noopener" href="' + value.item.externalUrl + '"'
: 'href="' + value.item.permalink + '"';
resultsHTML = resultsHTML =
resultsHTML + resultsHTML +
`<li class="mb-2"> `<li class="mb-2">
@@ -176,7 +179,7 @@ function executeQuery(term) {
<div class="-mb-1 text-lg font-bold"> <div class="-mb-1 text-lg font-bold">
${title} ${title}
</div> </div>
<div class="text-sm text-neutral-500 dark:text-neutral-400">${value.item.section}<span class="px-2 text-primary-500">&middot;</span>${value.item.date? value.item.date : ""}</span></div> <div class="text-sm text-neutral-500 dark:text-neutral-400">${value.item.section}<span class="px-2 text-primary-500">&middot;</span>${value.item.date ? value.item.date : ""}</span></div>
<div class="text-sm italic">${value.item.summary}</div> <div class="text-sm italic">${value.item.summary}</div>
</div> </div>
<div class="ml-2 ltr:block rtl:hidden text-neutral-500">&rarr;</div> <div class="ml-2 ltr:block rtl:hidden text-neutral-500">&rarr;</div>

View File

@@ -1,22 +1,21 @@
function _getDefaultPackeryOptions() { function _getDefaultPackeryOptions() {
return { return {
percentPosition: true, percentPosition: true,
gutter: 5, gutter: 5,
resize: true resize: true,
}; };
} }
(function init() { (function init() {
$(window).on("load", function () {
let packeries = [];
let nodeGalleries = document.querySelectorAll(".gallery");
$(window).on("load", function () { nodeGalleries.forEach((nodeGallery) => {
let packeries = []; // TODO : implement a reader of Packery configuration _getPackeryOptions; for example by reading data-attribute
let nodeGalleries = document.querySelectorAll('.gallery'); let packery = new Packery(nodeGallery, _getDefaultPackeryOptions());
packeries.push(packery);
nodeGalleries.forEach(nodeGallery => {
// TODO : implement a reader of Packery configuration _getPackeryOptions; for example by reading data-attribute
let packery = new Packery(nodeGallery, _getDefaultPackeryOptions());
packeries.push(packery);
});
console.groupEnd();
}); });
})(); console.groupEnd();
});
})();

View File

@@ -1,53 +1,50 @@
function _toogleZenMode(zendModeButton) { function _toogleZenMode(zendModeButton) {
// Nodes selection // Nodes selection
const body = document.querySelector('body'); const body = document.querySelector("body");
const footer = document.querySelector('footer'); const footer = document.querySelector("footer");
const tocRight = document.querySelector('.toc-right'); const tocRight = document.querySelector(".toc-right");
const tocInside = document.querySelector('.toc-inside'); const tocInside = document.querySelector(".toc-inside");
const articleContent = document.querySelector('.article-content'); const articleContent = document.querySelector(".article-content");
const header = document.querySelector('#single_header'); const header = document.querySelector("#single_header");
// Add semantic class into body tag // Add semantic class into body tag
body.classList.toggle('zen-mode-enable'); body.classList.toggle("zen-mode-enable");
// Show/Hide 'toc right' and 'toc inside' // Show/Hide 'toc right' and 'toc inside'
if (tocRight) if (tocRight) tocRight.classList.toggle("lg:block");
tocRight.classList.toggle('lg:block'); if (tocInside) tocInside.classList.toggle("lg:hidden");
if (tocInside)
tocInside.classList.toggle('lg:hidden');
// Change width of article content // Change width of article content
articleContent.classList.toggle('max-w-fit'); articleContent.classList.toggle("max-w-fit");
articleContent.classList.toggle('max-w-prose'); articleContent.classList.toggle("max-w-prose");
// Change width of article title and footer // Change width of article title and footer
header.classList.toggle('max-w-full'); header.classList.toggle("max-w-full");
header.classList.toggle('max-w-prose'); header.classList.toggle("max-w-prose");
footer.classList.toggle('max-w-full'); footer.classList.toggle("max-w-full");
footer.classList.toggle('max-w-prose'); footer.classList.toggle("max-w-prose");
// Read i18n title from data-attributes // Read i18n title from data-attributes
const titleI18nDisable = zendModeButton.getAttribute('data-title-i18n-disable'); const titleI18nDisable = zendModeButton.getAttribute("data-title-i18n-disable");
const titleI18nEnable = zendModeButton.getAttribute('data-title-i18n-enable'); const titleI18nEnable = zendModeButton.getAttribute("data-title-i18n-enable");
if (body.classList.contains('zen-mode-enable')) { if (body.classList.contains("zen-mode-enable")) {
// Persist configuration // Persist configuration
//localStorage.setItem('blowfish-zen-mode-enabled', 'true'); //localStorage.setItem('blowfish-zen-mode-enabled', 'true');
// Change title to enable // Change title to enable
zendModeButton.setAttribute('title', titleI18nEnable) zendModeButton.setAttribute("title", titleI18nEnable);
// Auto-scroll to title article // Auto-scroll to title article
window.scrollTo(window.scrollX, header.getBoundingClientRect().top - 90); window.scrollTo(window.scrollX, header.getBoundingClientRect().top - 90);
} else { } else {
//localStorage.setItem('blowfish-zen-mode-enabled', 'false'); //localStorage.setItem('blowfish-zen-mode-enabled', 'false');
zendModeButton.setAttribute('title', titleI18nDisable); zendModeButton.setAttribute("title", titleI18nDisable);
document.querySelector('body').scrollIntoView(); document.querySelector("body").scrollIntoView();
} }
} }
function _registerZendModeButtonClick(zendModeButton) { function _registerZendModeButtonClick(zendModeButton) {
zendModeButton.addEventListener('click', function (event) { zendModeButton.addEventListener("click", function (event) {
event.preventDefault(); event.preventDefault();
// Toggle zen-mode // Toggle zen-mode
@@ -58,9 +55,9 @@ function _registerZendModeButtonClick(zendModeButton) {
(function init() { (function init() {
window.addEventListener("DOMContentLoaded", (event) => { window.addEventListener("DOMContentLoaded", (event) => {
// Register click on 'zen-mode-button' node element // Register click on 'zen-mode-button' node element
const zendModeButton = document.getElementById('zen-mode-button'); const zendModeButton = document.getElementById("zen-mode-button");
if (zendModeButton !== null && zendModeButton !== undefined) { if (zendModeButton !== null && zendModeButton !== undefined) {
_registerZendModeButtonClick(zendModeButton); _registerZendModeButtonClick(zendModeButton);
} }
}); });
})(); })();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -53,5 +53,5 @@
"icon": "mastodon", "icon": "mastodon",
"title": "sharing.mastodon", "title": "sharing.mastodon",
"url": "https://s2f.kytta.dev/?text=%[2]s %[1]s" "url": "https://s2f.kytta.dev/?text=%[2]s %[1]s"
} }
} }

View File

@@ -1,20 +1,13 @@
var layouts = [ var layouts = ["background", "hero", "profile", "page", "card"];
"background",
"hero",
"profile",
"page",
"card"
]
var currentLayout = 0 var currentLayout = 0;
function switchHomeLayout() { function switchHomeLayout() {
var old = currentLayout;
currentLayout = currentLayout == layouts.length - 1 ? 0 : currentLayout + 1;
var old = currentLayout var oldDiv = document.getElementById(layouts[old]);
currentLayout = currentLayout == layouts.length - 1 ? 0 : currentLayout + 1 var currentDiv = document.getElementById(layouts[currentLayout]);
var oldDiv = document.getElementById(layouts[old])
var currentDiv = document.getElementById(layouts[currentLayout])
const layoutCode = document.querySelectorAll("code[id=layout]"); const layoutCode = document.querySelectorAll("code[id=layout]");
currentDiv.style.display = "block"; currentDiv.style.display = "block";
@@ -22,7 +15,6 @@ function switchHomeLayout() {
layoutCode.forEach(function (el) { layoutCode.forEach(function (el) {
el.innerText = layouts[currentLayout]; el.innerText = layouts[currentLayout];
}); });
} }
window.addEventListener("DOMContentLoaded", (event) => { window.addEventListener("DOMContentLoaded", (event) => {
@@ -30,31 +22,26 @@ window.addEventListener("DOMContentLoaded", (event) => {
button.addEventListener("click", function (e) { button.addEventListener("click", function (e) {
e.preventDefault(); e.preventDefault();
switchHomeLayout(); switchHomeLayout();
}) }),
); );
}); });
var list_config = [ var list_config = ["CardViewProse", "CardViewScreenWidth", "NormalView"];
"CardViewProse",
"CardViewScreenWidth",
"NormalView"
]
var titles = { var titles = {
"CardViewProse" : "card view with constrained width", CardViewProse: "card view with constrained width",
"CardViewScreenWidth" : "card view with full width", CardViewScreenWidth: "card view with full width",
"NormalView" : "standard list view" NormalView: "standard list view",
} };
var currentConfig = 0 var currentConfig = 0;
function switchList() { function switchList() {
var old = currentConfig;
currentConfig = currentConfig == list_config.length - 1 ? 0 : currentConfig + 1;
var old = currentConfig var oldDiv = document.getElementById(list_config[old]);
currentConfig = currentConfig == list_config.length - 1 ? 0 : currentConfig + 1 var currentDiv = document.getElementById(list_config[currentConfig]);
var oldDiv = document.getElementById(list_config[old])
var currentDiv = document.getElementById(list_config[currentConfig])
const configCode = document.querySelectorAll("code[id=config]"); const configCode = document.querySelectorAll("code[id=config]");
currentDiv.style.display = "block"; currentDiv.style.display = "block";
@@ -63,7 +50,6 @@ function switchList() {
configCode.forEach(function (el) { configCode.forEach(function (el) {
el.innerText = titles[list_config[currentConfig]]; el.innerText = titles[list_config[currentConfig]];
}); });
} }
window.addEventListener("DOMContentLoaded", (event) => { window.addEventListener("DOMContentLoaded", (event) => {
@@ -71,6 +57,6 @@ window.addEventListener("DOMContentLoaded", (event) => {
button.addEventListener("click", function (e) { button.addEventListener("click", function (e) {
e.preventDefault(); e.preventDefault();
switchList(); switchList();
}) }),
); );
}); });

View File

@@ -1,15 +1,15 @@
{ {
"name": "Nuno Coração", "name": "Nuno Coração",
"image" : "img/nuno_avatar.jpg", "image": "img/nuno_avatar.jpg",
"bio": "Theme Creator", "bio": "Theme Creator",
"social": [ "social": [
{ "linkedin": "https://linkedin.com/in/nunocoracao" }, { "linkedin": "https://linkedin.com/in/nunocoracao" },
{ "twitter": "https://twitter.com/nunocoracao" }, { "twitter": "https://twitter.com/nunocoracao" },
{ "instagram": "https://instagram.com/nunocoracao" }, { "instagram": "https://instagram.com/nunocoracao" },
{ "medium": "https://medium.com/@nunocoracao" }, { "medium": "https://medium.com/@nunocoracao" },
{ "github": "https://github.com/nunocoracao" }, { "github": "https://github.com/nunocoracao" },
{ "goodreads": "http://goodreads.com/nunocoracao" }, { "goodreads": "http://goodreads.com/nunocoracao" },
{ "keybase": "https://keybase.io/nunocoracao" }, { "keybase": "https://keybase.io/nunocoracao" },
{ "reddit": "https://reddit.com/user/nunoheart" } { "reddit": "https://reddit.com/user/nunoheart" }
] ]
} }

View File

@@ -1,15 +1,15 @@
{ {
"name": "Dummy Second Author", "name": "Dummy Second Author",
"image" : "img/author2.png", "image": "img/author2.png",
"bio": "Dummy", "bio": "Dummy",
"social": [ "social": [
{ "linkedin": "https://linkedin.com/in/nunocoracao" }, { "linkedin": "https://linkedin.com/in/nunocoracao" },
{ "twitter": "https://twitter.com/nunocoracao" }, { "twitter": "https://twitter.com/nunocoracao" },
{ "instagram": "https://instagram.com/nunocoracao" }, { "instagram": "https://instagram.com/nunocoracao" },
{ "medium": "https://medium.com/@nunocoracao" }, { "medium": "https://medium.com/@nunocoracao" },
{ "github": "https://github.com/nunocoracao" }, { "github": "https://github.com/nunocoracao" },
{ "goodreads": "http://goodreads.com/nunocoracao" }, { "goodreads": "http://goodreads.com/nunocoracao" },
{ "keybase": "https://keybase.io/nunocoracao" }, { "keybase": "https://keybase.io/nunocoracao" },
{ "reddit": "https://reddit.com/user/nunoheart" } { "reddit": "https://reddit.com/user/nunoheart" }
] ]
} }

View File

@@ -1 +1 @@
<a rel="me" href="https://masto.ai/@blowfish"></a> <a rel="me" href="https://masto.ai/@blowfish"></a>

View File

@@ -17,4 +17,8 @@
<section> <section>
{{ partial "recent-articles-demo.html" . }} {{ partial "recent-articles-demo.html" . }}
</section> </section>
<script defer type="text/javascript" src="{{ $jsHome.RelPermalink }}" integrity="{{ $jsHome.Data.Integrity }}"></script> <script
defer
type="text/javascript"
src="{{ $jsHome.RelPermalink }}"
integrity="{{ $jsHome.Data.Integrity }}"></script>

View File

@@ -1,44 +1,47 @@
{{ $recentArticles := 5 }} {{ $recentArticles := 5 }}
{{ $showMoreLinkDest := "/posts/" }} {{ $showMoreLinkDest := "/posts/" }}
{{ if index .Site.Params.homepage "showRecentItems" }} {{ if index .Site.Params.homepage "showRecentItems" }}
{{ $recentArticles = .Site.Params.homepage.showRecentItems }} {{ $recentArticles = .Site.Params.homepage.showRecentItems }}
{{ end }} {{ end }}
<h2 class="mt-8 text-2xl font-extrabold mb-10">{{ i18n "shortcode.recent_articles" | emojify }}</h2> <h2 class="mt-8 text-2xl font-extrabold mb-10">{{ i18n "shortcode.recent_articles" | emojify }}</h2>
<div class="flex mb-6 px-4 py-2 mb-8 text-base rounded-md bg-primary-100 dark:bg-primary-900"> <div class="flex mb-6 px-4 py-2 mb-8 text-base rounded-md bg-primary-100 dark:bg-primary-900">
<span class="flex items-center justify-between grow dark:text-neutral-300"> <span class="flex items-center justify-between grow dark:text-neutral-300">
<span class="prose dark:prose-invert">This is a demo of theme's list configurations: <code <span class="prose dark:prose-invert"
id="config">card view</code></span> >This is a demo of theme's list configurations: <code id="config">card view</code></span
<button id="switch-config-button" >
class="px-4 !text-neutral !no-underline rounded-md bg-primary-600 hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700"> <button
Switch config &orarr; id="switch-config-button"
</button> class="px-4 !text-neutral !no-underline rounded-md bg-primary-600 hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700">
</span> Switch config &orarr;
</button>
</span>
</div> </div>
<div id="CardViewProse" class="h-full"> <div id="CardViewProse" class="h-full">
{{ partial "recent-articles/cardview.html" . }} {{ partial "recent-articles/cardview.html" . }}
</div> </div>
<div id="CardViewScreenWidth" class="hidden h-full"> <div id="CardViewScreenWidth" class="hidden h-full">
{{ partial "recent-articles/cardview-fullwidth.html" . }} {{ partial "recent-articles/cardview-fullwidth.html" . }}
</div> </div>
<div id="NormalView" class="hidden h-full"> <div id="NormalView" class="hidden h-full">
{{ partial "recent-articles/list.html" . }} {{ partial "recent-articles/list.html" . }}
</div> </div>
{{ if .Site.Params.homepage.showMoreLink | default false }} {{ if .Site.Params.homepage.showMoreLink | default false }}
{{ if index .Site.Params.homepage "showRecentItems" }} {{ if index .Site.Params.homepage "showRecentItems" }}
{{ $showMoreLinkDest = .Site.Params.homepage.showMoreLinkDest }} {{ $showMoreLinkDest = .Site.Params.homepage.showMoreLinkDest }}
{{ end }} {{ end }}
<div class="mt-10 flex justify-center"> <div class="mt-10 flex justify-center">
<a href="{{ $showMoreLinkDest }}"> <a href="{{ $showMoreLinkDest }}">
<button <button
class="bg-transparent hover:text-primary-500 prose dark:prose-invert font-semibold hover:text-white py-2 px-4 border border-primary-500 hover:border-transparent rounded"> class="bg-transparent hover:text-primary-500 prose dark:prose-invert font-semibold hover:text-white py-2 px-4 border border-primary-500 hover:border-transparent rounded">
{{ i18n "recent.show_more" | markdownify }} {{ i18n "recent.show_more" | markdownify }}
</button> </button>
</a> </a>
</div> </div>
{{ end }} {{ end }}

View File

@@ -1,75 +1,71 @@
const fs = require('fs'); const fs = require("fs");
const configDir = "./exampleSite/config/_default"; const configDir = "./exampleSite/config/_default";
const contentDir = "./exampleSite/content"; const contentDir = "./exampleSite/content";
const defaultLang = "en"; const defaultLang = "en";
var targetLangs = [] var targetLangs = [];
function readConfigs() { function readConfigs() {
const files = fs.readdirSync(configDir); const files = fs.readdirSync(configDir);
files.forEach(file => { files.forEach((file) => {
//console.log(file) //console.log(file)
if(file.indexOf("languages.") > -1) { if (file.indexOf("languages.") > -1) {
var lang = file.split(".")[1]; var lang = file.split(".")[1];
//console.log(lang) //console.log(lang)
if(lang != defaultLang) { if (lang != defaultLang) {
targetLangs.push(lang); targetLangs.push(lang);
} }
} }
}); });
} }
async function processFile(filePath, file) { async function processFile(filePath, file) {
if (filePath.indexOf("index.md") > -1) { if (filePath.indexOf("index.md") > -1) {
//console.log("processing", filePath)
//console.log("processing", filePath) for (var i in targetLangs) {
const targetLang = targetLangs[i];
for(var i in targetLangs) { var targetFilePath = filePath.replace(".md", "." + targetLang + ".md");
const targetLang = targetLangs[i]; //var targetFileName = file.replace(".md", "." + targetLang + ".md");
var targetFilePath = filePath.replace(".md", "." + targetLang + ".md");
//var targetFileName = file.replace(".md", "." + targetLang + ".md");
if(fs.existsSync(targetFilePath)) { if (fs.existsSync(targetFilePath)) {
//console.log("file already exists", targetFilePath); //console.log("file already exists", targetFilePath);
const data = fs.readFileSync(filePath, 'utf8'); const data = fs.readFileSync(filePath, "utf8");
const data2 = fs.readFileSync(targetFilePath, 'utf8'); const data2 = fs.readFileSync(targetFilePath, "utf8");
if(data != data2) { if (data != data2) {
//console.log("file contents are different", targetFilePath); //console.log("file contents are different", targetFilePath);
}else{ } else {
//console.log("file contents are the same", targetFilePath); //console.log("file contents are the same", targetFilePath);
console.log(targetFilePath); console.log(targetFilePath);
//process.exit(1); //process.exit(1);
}
}else{
//console.log("file does not exist", targetFilePath);
}
} }
} else {
} else //console.log("file does not exist", targetFilePath);
return }
}
} else return;
} }
async function processFolder(folderPath) { async function processFolder(folderPath) {
const files = fs.readdirSync(folderPath); const files = fs.readdirSync(folderPath);
for (var i in files) { for (var i in files) {
const file = files[i]; const file = files[i];
const filePath = `${folderPath}/${file}`; const filePath = `${folderPath}/${file}`;
const isDir = fs.lstatSync(filePath).isDirectory(); const isDir = fs.lstatSync(filePath).isDirectory();
if (isDir) { if (isDir) {
await processFolder(filePath); await processFolder(filePath);
} else { } else {
await processFile(filePath, file); await processFile(filePath, file);
}
} }
}
} }
async function createLinks() { async function createLinks() {
processFolder(contentDir); processFolder(contentDir);
} }
readConfigs(); readConfigs();
createLinks(); createLinks();

View File

@@ -1,5 +1,5 @@
const fs = require('fs'); const fs = require("fs");
const translate = require('@iamtraction/google-translate'); const translate = require("@iamtraction/google-translate");
const defaultLang = "en"; const defaultLang = "en";
const targetLang = process.argv[2] || "en"; const targetLang = process.argv[2] || "en";
@@ -8,56 +8,57 @@ const targetLangIso = targetLang == "pt" ? "pt-pt" : targetLang;
const targetFilePath = filePath.replace(".md", "." + targetLangIso + ".md"); const targetFilePath = filePath.replace(".md", "." + targetLangIso + ".md");
async function convert(text, from, to) { async function convert(text, from, to) {
var options = { var options = {
from: from, from: from,
to: to to: to,
}; };
var translated_text = await translate(text, options); var translated_text = await translate(text, options);
return translated_text.text; return translated_text.text;
} }
console.log(filePath); console.log(filePath);
console.log(targetFilePath); console.log(targetFilePath);
async function processFrontMatter(block) { async function processFrontMatter(block) {
var array = block.split("\n"); var array = block.split("\n");
var translatedBlock = ""; var translatedBlock = "";
for (var i = 0; i < array.length; i++) { for (var i = 0; i < array.length; i++) {
if (array[i].indexOf(":") > -1) { if (array[i].indexOf(":") > -1) {
var elements = array[i].split(":"); var elements = array[i].split(":");
var newElement = ""; var newElement = "";
if (elements[0] == "title" || if (
elements[0] == "description" || elements[0] == "title" ||
elements[0] == "summary" || elements[0] == "description" ||
elements[0] == "description" || elements[0] == "summary" ||
elements[0] == "categories" || elements[0] == "description" ||
elements[0] == "tags") { elements[0] == "categories" ||
var translatedElement = elements[1] ? await convert(elements[1], defaultLang, targetLang) : elements[1]; elements[0] == "tags"
newElement = elements[0] + ": " + translatedElement; ) {
} else { var translatedElement = elements[1] ? await convert(elements[1], defaultLang, targetLang) : elements[1];
newElement = array[i]; newElement = elements[0] + ": " + translatedElement;
} } else {
} else { newElement = array[i];
newElement = array[i]; }
} } else {
translatedBlock += newElement + "\n"; newElement = array[i];
} }
return translatedBlock; translatedBlock += newElement + "\n";
}
return translatedBlock;
} }
async function main() { async function main() {
const fileContent = fs.readFileSync(filePath, 'utf8'); const fileContent = fs.readFileSync(filePath, "utf8");
var array = fileContent.split("---\n") var array = fileContent.split("---\n");
var frontMatter = array[1]; var frontMatter = array[1];
var content = array[2]; var content = array[2];
var translatedFrontMatter = await processFrontMatter(frontMatter); var translatedFrontMatter = await processFrontMatter(frontMatter);
var translatedContent = await convert(content, defaultLang, targetLang); var translatedContent = await convert(content, defaultLang, targetLang);
var newFileContent = "---\n" + translatedFrontMatter + "---\n" + translatedContent; var newFileContent = "---\n" + translatedFrontMatter + "---\n" + translatedContent;
fs.writeFileSync(targetFilePath, newFileContent, 'utf8'); fs.writeFileSync(targetFilePath, newFileContent, "utf8");
} }
main(); main();

View File

@@ -1,5 +1,5 @@
const fs = require('fs'); const fs = require("fs");
const translate = require('@iamtraction/google-translate'); const translate = require("@iamtraction/google-translate");
const configDir = "./exampleSite/config/_default"; const configDir = "./exampleSite/config/_default";
const contentDir = "./exampleSite/content"; const contentDir = "./exampleSite/content";
@@ -7,98 +7,94 @@ const defaultLang = "en";
const targetLang = process.argv[2] || "en"; const targetLang = process.argv[2] || "en";
const targetLangIso = targetLang == "pt" ? "pt-pt" : targetLang; const targetLangIso = targetLang == "pt" ? "pt-pt" : targetLang;
function createConfigs() { function createConfigs() {
const files = fs.readdirSync(configDir); const files = fs.readdirSync(configDir);
files.forEach(file => { files.forEach((file) => {
const filePath = `${configDir}/${file}`; const filePath = `${configDir}/${file}`;
if (filePath.indexOf("languages.en.toml") > -1 || if (filePath.indexOf("languages.en.toml") > -1 || filePath.indexOf("menus.en.toml") > -1) {
filePath.indexOf("menus.en.toml") > -1) { var fileContent = fs.readFileSync(filePath, "utf8");
var fileContent = fs.readFileSync(filePath, 'utf8'); fs.writeFileSync(filePath.replace(".en.toml", "." + targetLangIso + ".toml"), fileContent, "utf8");
fs.writeFileSync(filePath.replace(".en.toml", "." + targetLangIso + ".toml"), fileContent, 'utf8'); }
} });
});
} }
async function convert(text, from, to) { async function convert(text, from, to) {
var options = { var options = {
from: from, from: from,
to: to to: to,
}; };
var translated_text = await translate(text, options) var translated_text = await translate(text, options).catch((err) => {
.catch(err => { console.error(err);
console.error(err); });
});; return translated_text && translated_text.text ? translated_text.text : "";
return translated_text && translated_text.text? translated_text.text : '';
} }
async function processFrontMatter(block) { async function processFrontMatter(block) {
var array = block.split("\n"); var array = block.split("\n");
var translatedBlock = ""; var translatedBlock = "";
for (var i = 0; i < array.length; i++) { for (var i = 0; i < array.length; i++) {
if (array[i].indexOf(":") > -1) { if (array[i].indexOf(":") > -1) {
var elements = array[i].split(":"); var elements = array[i].split(":");
var newElement = ""; var newElement = "";
if (elements[0] == "title" || if (
elements[0] == "description" || elements[0] == "title" ||
elements[0] == "summary" || elements[0] == "description" ||
elements[0] == "description" || elements[0] == "summary" ||
elements[0] == "categories" || elements[0] == "description" ||
elements[0] == "tags") { elements[0] == "categories" ||
var translatedElement = elements[1] ? await convert(elements[1], defaultLang, targetLang) : elements[1]; elements[0] == "tags"
newElement = elements[0] + ": " + translatedElement; ) {
} else { var translatedElement = elements[1] ? await convert(elements[1], defaultLang, targetLang) : elements[1];
newElement = array[i]; newElement = elements[0] + ": " + translatedElement;
} } else {
} else { newElement = array[i];
newElement = array[i]; }
} } else {
translatedBlock += newElement + "\n"; newElement = array[i];
} }
return translatedBlock; translatedBlock += newElement + "\n";
}
return translatedBlock;
} }
async function processFile(filePath) { async function processFile(filePath) {
console.log("translating", filePath) console.log("translating", filePath);
if (filePath.indexOf("index.md") > -1) { if (filePath.indexOf("index.md") > -1) {
const targetFilePath = filePath.replace(".md", "." + targetLangIso + ".md");
const targetFilePath = filePath.replace(".md", "." + targetLangIso + ".md"); const fileContent = fs.readFileSync(filePath, "utf8");
const fileContent = fs.readFileSync(filePath, 'utf8'); var array = fileContent.split("---\n");
var frontMatter = array[1];
var content = array[2];
var array = fileContent.split("---\n") var translatedFrontMatter = await processFrontMatter(frontMatter);
var frontMatter = array[1]; var translatedContent = await convert(content, defaultLang, targetLang);
var content = array[2];
var translatedFrontMatter = await processFrontMatter(frontMatter); var newFileContent = "---\n" + translatedFrontMatter + "---\n" + translatedContent;
var translatedContent = await convert(content, defaultLang, targetLang); fs.writeFileSync(targetFilePath, newFileContent, "utf8");
} else return;
var newFileContent = "---\n" + translatedFrontMatter + "---\n" + translatedContent;
fs.writeFileSync(targetFilePath, newFileContent, 'utf8');
} else
return
} }
async function processFolder(folderPath) { async function processFolder(folderPath) {
const files = fs.readdirSync(folderPath); const files = fs.readdirSync(folderPath);
for (var i in files) { for (var i in files) {
const file = files[i]; const file = files[i];
const filePath = `${folderPath}/${file}`; const filePath = `${folderPath}/${file}`;
const isDir = fs.lstatSync(filePath).isDirectory(); const isDir = fs.lstatSync(filePath).isDirectory();
console.log(filePath, isDir); console.log(filePath, isDir);
if (isDir) { if (isDir) {
await processFolder(filePath); await processFolder(filePath);
} else { } else {
await processFile(filePath); await processFile(filePath);
}
} }
}
} }
async function createContent() { async function createContent() {
processFolder(contentDir); processFolder(contentDir);
} }
createConfigs(); createConfigs();
createContent(); createContent();

View File

@@ -1,66 +1,63 @@
const fs = require('fs'); const fs = require("fs");
const configDir = "./exampleSite/config/_default"; const configDir = "./exampleSite/config/_default";
const contentDir = "./exampleSite/content"; const contentDir = "./exampleSite/content";
const defaultLang = "en"; const defaultLang = "en";
var targetLangs = [] var targetLangs = [];
function readConfigs() { function readConfigs() {
const files = fs.readdirSync(configDir); const files = fs.readdirSync(configDir);
files.forEach(file => { files.forEach((file) => {
console.log(file) console.log(file);
if(file.indexOf("languages.") > -1) { if (file.indexOf("languages.") > -1) {
var lang = file.split(".")[1]; var lang = file.split(".")[1];
console.log(lang) console.log(lang);
if(lang != defaultLang) { if (lang != defaultLang) {
targetLangs.push(lang); targetLangs.push(lang);
} }
} }
}); });
} }
async function processFile(filePath, file) { async function processFile(filePath, file) {
if (filePath.indexOf("index.md") > -1) { if (filePath.indexOf("index.md") > -1) {
console.log("processing", filePath);
console.log("processing", filePath) for (var i in targetLangs) {
const targetLang = targetLangs[i];
for(var i in targetLangs) { var targetFilePath = filePath.replace(".md", "." + targetLang + ".md");
const targetLang = targetLangs[i]; //var targetFileName = file.replace(".md", "." + targetLang + ".md");
var targetFilePath = filePath.replace(".md", "." + targetLang + ".md");
//var targetFileName = file.replace(".md", "." + targetLang + ".md");
if(fs.existsSync(targetFilePath)) { if (fs.existsSync(targetFilePath)) {
console.log("file already exists", targetFilePath); console.log("file already exists", targetFilePath);
}else{ } else {
console.log("creating file", targetFilePath); console.log("creating file", targetFilePath);
//fs.symlinkSync(file, targetFilePath, 'junction'); //fs.symlinkSync(file, targetFilePath, 'junction');
fs.copyFileSync(filePath, targetFilePath); fs.copyFileSync(filePath, targetFilePath);
} }
} }
} else return;
} else
return
} }
async function processFolder(folderPath) { async function processFolder(folderPath) {
const files = fs.readdirSync(folderPath); const files = fs.readdirSync(folderPath);
for (var i in files) { for (var i in files) {
const file = files[i]; const file = files[i];
const filePath = `${folderPath}/${file}`; const filePath = `${folderPath}/${file}`;
const isDir = fs.lstatSync(filePath).isDirectory(); const isDir = fs.lstatSync(filePath).isDirectory();
if (isDir) { if (isDir) {
await processFolder(filePath); await processFolder(filePath);
} else { } else {
await processFile(filePath, file); await processFile(filePath, file);
}
} }
}
} }
async function createLinks() { async function createLinks() {
processFolder(contentDir); processFolder(contentDir);
} }
readConfigs(); readConfigs();
createLinks(); createLinks();

View File

@@ -68,4 +68,4 @@ shortcode:
recent_articles: "تم النشر مؤخرا" recent_articles: "تم النشر مؤخرا"
recent: recent:
show_more: "قراءة المزيد" show_more: "قراءة المزيد"

View File

@@ -26,7 +26,6 @@ article:
this_article: "Тази Статия" this_article: "Тази Статия"
related_articles: "Подобни" related_articles: "Подобни"
author: author:
byline_title: "Автор" byline_title: "Автор"

View File

@@ -1,72 +1,72 @@
global: global:
language: "BN" language: "BN"
article: article:
anchor_label: "Anchor" anchor_label: "Anchor"
date: "{{ .Date }}" date: "{{ .Date }}"
date_updated: "সর্বশেষ সম্পাদনার তারিখ: {{ .Date }}" date_updated: "সর্বশেষ সম্পাদনার তারিখ: {{ .Date }}"
draft: "খসড়া" draft: "খসড়া"
edit_title: "সম্পাদনা করুন" edit_title: "সম্পাদনা করুন"
reading_time: reading_time:
one: "{{ .Count }} মিনিট" one: "{{ .Count }} মিনিট"
other: "{{ .Count }} মিনিট" other: "{{ .Count }} মিনিট"
reading_time_title: "পড়ার সময়" reading_time_title: "পড়ার সময়"
table_of_contents: "বিষয়সূচী" table_of_contents: "বিষয়সূচী"
word_count: word_count:
one: "{{ .Count }} টি শব্দ" one: "{{ .Count }} টি শব্দ"
other: "{{ .Count }} টি শব্দ" other: "{{ .Count }} টি শব্দ"
views: views:
one: "{{ .Count }} বার দেখা হয়েছে" one: "{{ .Count }} বার দেখা হয়েছে"
other: "{{ .Count }} বার দেখা হয়েছে" other: "{{ .Count }} বার দেখা হয়েছে"
likes: likes:
one: "{{ .Count }} বার পছন্দ করা হয়েছে" one: "{{ .Count }} বার পছন্দ করা হয়েছে"
other: "{{ .Count }} বার পছন্দ করা হয়েছে" other: "{{ .Count }} বার পছন্দ করা হয়েছে"
part_of_series: "This article is part of a series." part_of_series: "This article is part of a series."
part: "Part" part: "Part"
this_article: "This Article" this_article: "This Article"
related_articles: "Related" related_articles: "Related"
author: author:
byline_title: "লেখক" byline_title: "লেখক"
code: code:
copy: "কপি করুন" copy: "কপি করুন"
copied: "কপি হয়ে গেছে" copied: "কপি হয়ে গেছে"
error: error:
404_title: "পেজটি খুঁজে পাওয়া যায়নি :confused:" 404_title: "পেজটি খুঁজে পাওয়া যায়নি :confused:"
404_error: "Error 404" 404_error: "Error 404"
404_description: "মনে হচ্ছে, আপনার অনুরোধ করা পেজটি খুঁজে পাওয়া যায়নি।" 404_description: "মনে হচ্ছে, আপনার অনুরোধ করা পেজটি খুঁজে পাওয়া যায়নি।"
footer: footer:
dark_appearance: "ডার্ক মোডে স্যুইচ করুন" dark_appearance: "ডার্ক মোডে স্যুইচ করুন"
light_appearance: "লাইট মোডে স্যুইচ করুন" light_appearance: "লাইট মোডে স্যুইচ করুন"
powered_by: "{{ .Hugo }} এবং {{ .Blowfish }} দ্বারা চালিত" powered_by: "{{ .Hugo }} এবং {{ .Blowfish }} দ্বারা চালিত"
list: list:
externalurl_title: "অন্য ওয়েবসাইটের লিংক" externalurl_title: "অন্য ওয়েবসাইটের লিংক"
no_articles: "এখানে তালিকাভুক্ত করার মতো আপাতত কিছুই নেই।" no_articles: "এখানে তালিকাভুক্ত করার মতো আপাতত কিছুই নেই।"
nav: nav:
scroll_to_top_title: "পেজের উপরের দিকে যান" scroll_to_top_title: "পেজের উপরের দিকে যান"
skip_to_main: "মূল বিষয়ে যান" skip_to_main: "মূল বিষয়ে যান"
search: search:
open_button_title: "খুঁজুন (/)" open_button_title: "খুঁজুন (/)"
close_button_title: "বন্ধ করুন (Esc)" close_button_title: "বন্ধ করুন (Esc)"
input_placeholder: "খুঁজুন" input_placeholder: "খুঁজুন"
sharing: sharing:
email: "ইমেল করুন" email: "ইমেল করুন"
facebook: "ফেসবুকে শেয়ার করুন" facebook: "ফেসবুকে শেয়ার করুন"
line: "লাইনে শেয়ার করুন" line: "লাইনে শেয়ার করুন"
linkedin: "লিংকডইনে শেয়ার করুন" linkedin: "লিংকডইনে শেয়ার করুন"
pinterest: "পিন্টারেস্টে পিন করুন" pinterest: "পিন্টারেস্টে পিন করুন"
reddit: "রেড্ডিটে জমা দিন" reddit: "রেড্ডিটে জমা দিন"
twitter: "ট্যুইট করুন" twitter: "ট্যুইট করুন"
shortcode: shortcode:
recent_articles: "সাম্প্রতিক" recent_articles: "সাম্প্রতিক"
recent: recent:
show_more: "আরো দেখুন" show_more: "আরো দেখুন"

View File

@@ -72,4 +72,4 @@ shortcode:
recent_articles: "Recent" recent_articles: "Recent"
recent: recent:
show_more: "Mostrar més" show_more: "Mostrar més"

View File

@@ -1,72 +1,72 @@
global: global:
language: "CS" language: "CS"
article: article:
anchor_label: "Kotva" anchor_label: "Kotva"
date: "{{ .Date }}" date: "{{ .Date }}"
date_updated: "Aktualizováno: {{ .Date }}" date_updated: "Aktualizováno: {{ .Date }}"
draft: "Návrh" draft: "Návrh"
edit_title: "Upravit" edit_title: "Upravit"
reading_time: reading_time:
one: "{{ .Count }} min" one: "{{ .Count }} min"
other: "{{ .Count }} min" other: "{{ .Count }} min"
reading_time_title: "Doba čtení" reading_time_title: "Doba čtení"
table_of_contents: "Obsah" table_of_contents: "Obsah"
word_count: word_count:
one: "{{ .Count }} slovo" one: "{{ .Count }} slovo"
other: "{{ .Count }} slov" other: "{{ .Count }} slov"
views: views:
one: "{{ .Count }} zhlédnutí" one: "{{ .Count }} zhlédnutí"
other: "{{ .Count }} zhlédnutí" other: "{{ .Count }} zhlédnutí"
likes: likes:
one: "{{ .Count }} líbí se mi" one: "{{ .Count }} líbí se mi"
other: "{{ .Count }} líbí se mi" other: "{{ .Count }} líbí se mi"
part_of_series: "Tento článek patří do série." part_of_series: "Tento článek patří do série."
part: "Část" part: "Část"
this_article: "Tento článek" this_article: "Tento článek"
related_articles: "Related" related_articles: "Related"
author: author:
byline_title: "Autor" byline_title: "Autor"
code: code:
copy: "Kopírovat" copy: "Kopírovat"
copied: "Zkopírováno" copied: "Zkopírováno"
error: error:
404_title: "Stránka nenalezena :confused:" 404_title: "Stránka nenalezena :confused:"
404_error: "Error 404" 404_error: "Error 404"
404_description: "Zdá se, že stránka neexistuje." 404_description: "Zdá se, že stránka neexistuje."
footer: footer:
dark_appearance: "Přepnout na tmavý režim" dark_appearance: "Přepnout na tmavý režim"
light_appearance: "Přepnout na světlý režim" light_appearance: "Přepnout na světlý režim"
powered_by: "Postaveno na technologiích {{ .Hugo }} &amp; {{ .Theme }}" powered_by: "Postaveno na technologiích {{ .Hugo }} &amp; {{ .Theme }}"
list: list:
externalurl_title: "Odkaz na externí stránku" externalurl_title: "Odkaz na externí stránku"
no_articles: "Tato sekce zatím neobsahuje žádné články." no_articles: "Tato sekce zatím neobsahuje žádné články."
nav: nav:
scroll_to_top_title: "Nahoru" scroll_to_top_title: "Nahoru"
skip_to_main: "Přeskočit na hlavní obsah" skip_to_main: "Přeskočit na hlavní obsah"
search: search:
open_button_title: "Vyhledat (/)" open_button_title: "Vyhledat (/)"
close_button_title: "Zavřít (Esc)" close_button_title: "Zavřít (Esc)"
input_placeholder: "Hledat" input_placeholder: "Hledat"
sharing: sharing:
email: "Poslat emailem" email: "Poslat emailem"
facebook: "Sdílet na Facebook" facebook: "Sdílet na Facebook"
line: "Sdílejte na LINE" line: "Sdílejte na LINE"
linkedin: "Sdílet na LinkedIn" linkedin: "Sdílet na LinkedIn"
pinterest: "Připnout na Pinterest" pinterest: "Připnout na Pinterest"
reddit: "Přidat na Reddit" reddit: "Přidat na Reddit"
twitter: "Tweet na Twitter" twitter: "Tweet na Twitter"
shortcode: shortcode:
recent_articles: "Nedávné" recent_articles: "Nedávné"
recent: recent:
show_more: "Zobrazit další" show_more: "Zobrazit další"

View File

@@ -13,8 +13,8 @@ article:
reading_time_title: "Lesezeit" reading_time_title: "Lesezeit"
table_of_contents: "Inhaltsverzeichnis" table_of_contents: "Inhaltsverzeichnis"
word_count: word_count:
one: "{{ .Count }} Wort" one: "{{ .Count }} Wort"
other: "{{ .Count }} Wörter" other: "{{ .Count }} Wörter"
part_of_series: "Dieser Artikel ist Teil einer Serie." part_of_series: "Dieser Artikel ist Teil einer Serie."
part: "Teil" part: "Teil"
this_article: "Dieser Artikel" this_article: "Dieser Artikel"
@@ -42,13 +42,13 @@ list:
no_articles: "Es gibt hier noch keine Beiträge." no_articles: "Es gibt hier noch keine Beiträge."
nav: nav:
scroll_to_top_title: "Zum Anfang scrollen" scroll_to_top_title: "Zum Anfang scrollen"
skip_to_main: "Zum Hauptinhalt springen" skip_to_main: "Zum Hauptinhalt springen"
search: search:
open_button_title: "Suche (/)" open_button_title: "Suche (/)"
close_button_title: "Schließen (Esc)" close_button_title: "Schließen (Esc)"
input_placeholder: "Suchen" input_placeholder: "Suchen"
sharing: sharing:
email: "Per E-Mail teilen" email: "Per E-Mail teilen"
@@ -62,6 +62,5 @@ sharing:
shortcode: shortcode:
recent_articles: "Neue Beiträge" recent_articles: "Neue Beiträge"
recent: recent:
show_more: "Zeige Mehr" show_more: "Zeige Mehr"

View File

@@ -72,4 +72,4 @@ shortcode:
recent_articles: "Reciente" recent_articles: "Reciente"
recent: recent:
show_more: "Mostrar más" show_more: "Mostrar más"

View File

@@ -63,4 +63,4 @@ shortcode:
recent_articles: "Viimeaikaiset" recent_articles: "Viimeaikaiset"
recent: recent:
show_more: "Näytä Lisää" show_more: "Näytä Lisää"

View File

@@ -63,4 +63,4 @@ shortcode:
recent_articles: "חדשים" recent_articles: "חדשים"
recent: recent:
show_more: "להראות יותר" show_more: "להראות יותר"

View File

@@ -63,4 +63,4 @@ shortcode:
recent_articles: "Friss" recent_articles: "Friss"
recent: recent:
show_more: "Mutass Többet" show_more: "Mutass Többet"

View File

@@ -63,4 +63,4 @@ shortcode:
recent_articles: "Recenti" recent_articles: "Recenti"
recent: recent:
show_more: "Mostra di Più" show_more: "Mostra di Più"

View File

@@ -36,7 +36,8 @@ code:
error: error:
404_title: "Strona nie znaleziona :confused:" 404_title: "Strona nie znaleziona :confused:"
404_error: "Błąd 404" 404_error: "Błąd 404"
404_description: "Wydaje się, że strona, którą chcesz wyświetlić, nie istnieje." 404_description:
"Wydaje się, że strona, którą chcesz wyświetlić, nie istnieje."
footer: footer:
dark_appearance: "Zmień na tryb ciemny" dark_appearance: "Zmień na tryb ciemny"
@@ -69,4 +70,4 @@ shortcode:
recent_articles: "Ostatnie artykuły" recent_articles: "Ostatnie artykuły"
recent: recent:
show_more: "Pokaż Więcej" show_more: "Pokaż Więcej"

View File

@@ -66,4 +66,4 @@ shortcode:
recent_articles: "Recente" recent_articles: "Recente"
recent: recent:
show_more: "Mostrar Mais" show_more: "Mostrar Mais"

View File

@@ -63,4 +63,4 @@ shortcode:
recent_articles: "Cele mai noi" recent_articles: "Cele mai noi"
recent: recent:
show_more: "Afișați mai multe" show_more: "Afișați mai multe"

View File

@@ -1,77 +1,77 @@
global: global:
language: "TH" language: "TH"
article: article:
anchor_label: "จุดยึด" anchor_label: "จุดยึด"
date: "{{ .Date }}" date: "{{ .Date }}"
date_updated: "อัปเดต: {{ .Date }}" date_updated: "อัปเดต: {{ .Date }}"
draft: "ฉบับร่าง" draft: "ฉบับร่าง"
edit_title: "แก้ไขเนื้อหา" edit_title: "แก้ไขเนื้อหา"
reading_time: reading_time:
one: "{{ .Count }} นาที" one: "{{ .Count }} นาที"
other: "{{ .Count }} นาที" other: "{{ .Count }} นาที"
reading_time_title: "ใช้เวลาอ่าน" reading_time_title: "ใช้เวลาอ่าน"
table_of_contents: "หัวข้อเนื้อหา" table_of_contents: "หัวข้อเนื้อหา"
word_count: word_count:
one: "{{ .Count }} คำ" one: "{{ .Count }} คำ"
other: "{{ .Count }} คำ" other: "{{ .Count }} คำ"
views: views:
one: "{{ .Count }} ครั้ง" one: "{{ .Count }} ครั้ง"
other: "{{ .Count }} ครั้ง" other: "{{ .Count }} ครั้ง"
likes: likes:
one: "{{ .Count }} ไลค์" one: "{{ .Count }} ไลค์"
other: "{{ .Count }} ไลค์" other: "{{ .Count }} ไลค์"
part_of_series: "บทความในชุดเดียวกัน" part_of_series: "บทความในชุดเดียวกัน"
part: "ตอนที่" part: "ตอนที่"
this_article: "บทความนี้" this_article: "บทความนี้"
related_articles: "บทความที่เกี่ยวข้อง" related_articles: "บทความที่เกี่ยวข้อง"
zen_mode_title: zen_mode_title:
enable: "เปิดโหมดเซน" enable: "เปิดโหมดเซน"
disable: "ปิดโหมดเซน" disable: "ปิดโหมดเซน"
author: author:
byline_title: "ผู้เขียน" byline_title: "ผู้เขียน"
code: code:
copy: "คัดลอก" copy: "คัดลอก"
copied: "คัดลอกแล้ว" copied: "คัดลอกแล้ว"
error: error:
404_title: "ไม่พบหน้าที่ต้องการ :confused:" 404_title: "ไม่พบหน้าที่ต้องการ :confused:"
404_error: "ข้อผิดพลาด 404" 404_error: "ข้อผิดพลาด 404"
404_description: "ดูเหมือนว่าหน้าที่คุณต้องการจะไม่มีอยู่" 404_description: "ดูเหมือนว่าหน้าที่คุณต้องการจะไม่มีอยู่"
footer: footer:
dark_appearance: "เปลี่ยนเป็นธีมมืด" dark_appearance: "เปลี่ยนเป็นธีมมืด"
light_appearance: "เปลี่ยนเป็นธีมสว่าง" light_appearance: "เปลี่ยนเป็นธีมสว่าง"
powered_by: "สร้างด้วย {{ .Hugo }} &amp; {{ .Theme }}" powered_by: "สร้างด้วย {{ .Hugo }} &amp; {{ .Theme }}"
list: list:
externalurl_title: "ลิงก์ไปยังเว็บไซต์ภายนอก" externalurl_title: "ลิงก์ไปยังเว็บไซต์ภายนอก"
no_articles: "ยังไม่มีบทความให้แสดงในส่วนนี้" no_articles: "ยังไม่มีบทความให้แสดงในส่วนนี้"
nav: nav:
scroll_to_top_title: "เลื่อนขึ้นด้านบน" scroll_to_top_title: "เลื่อนขึ้นด้านบน"
skip_to_main: "ข้ามไปยังเนื้อหาหลัก" skip_to_main: "ข้ามไปยังเนื้อหาหลัก"
search: search:
open_button_title: "ค้นหา (/)" open_button_title: "ค้นหา (/)"
close_button_title: "ปิด (Esc)" close_button_title: "ปิด (Esc)"
input_placeholder: "ค้นหา" input_placeholder: "ค้นหา"
sharing: sharing:
email: "ส่งทางอีเมล" email: "ส่งทางอีเมล"
facebook: "แชร์บน Facebook" facebook: "แชร์บน Facebook"
linkedin: "แชร์บน LinkedIn" linkedin: "แชร์บน LinkedIn"
pinterest: "ปักหมุดบน Pinterest" pinterest: "ปักหมุดบน Pinterest"
reddit: "โพสต์บน Reddit" reddit: "โพสต์บน Reddit"
twitter: "ทวีตบน Twitter" twitter: "ทวีตบน Twitter"
bluesky: "โพสต์บน Bluesky" bluesky: "โพสต์บน Bluesky"
whatsapp: "แชร์ทาง WhatsApp" whatsapp: "แชร์ทาง WhatsApp"
telegram: "แชร์ทาง Telegram" telegram: "แชร์ทาง Telegram"
shortcode: shortcode:
recent_articles: "บทความล่าสุด" recent_articles: "บทความล่าสุด"
recent: recent:
show_more: "แสดงเพิ่มเติม" show_more: "แสดงเพิ่มเติม"

View File

@@ -63,4 +63,4 @@ shortcode:
icon_none: "Icon bulunamadı." icon_none: "Icon bulunamadı."
recent: recent:
show_more: "Daha Fazla Göster" show_more: "Daha Fazla Göster"

View File

@@ -1,17 +1,21 @@
{{ define "RenderImageSimple" -}} {{ define "RenderImageSimple" -}}
<img class="my-0 rounded-md" loading="lazy" alt="{{ .alt }}" src="{{ .src }}" /> <img class="my-0 rounded-md" loading="lazy" alt="{{ .alt }}" src="{{ .src }}">
{{- end }} {{- end }}
{{ define "RenderImageResponsive" -}} {{ define "RenderImageResponsive" -}}
<img <img
class="my-0 rounded-md" loading="lazy" decoding="async" fetchpriority="low" alt="{{ .alt }}" class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="low"
alt="{{ .alt }}"
srcset=" srcset="
{{ (.resource.Resize "330x").RelPermalink }} 330w, {{ (.resource.Resize "330x").RelPermalink }} 330w,
{{ (.resource.Resize "660x").RelPermalink }} 660w, {{ (.resource.Resize "660x").RelPermalink }} 660w,
{{ (.resource.Resize "1280x").RelPermalink }} 1280w" {{ (.resource.Resize "1280x").RelPermalink }} 1280w
"
data-zoom-src="{{ .resource.RelPermalink }}" data-zoom-src="{{ .resource.RelPermalink }}"
src="{{ .resource.RelPermalink }}" src="{{ .resource.RelPermalink }}">
/>
{{- end }} {{- end }}
{{ define "RenderImageCaption" -}} {{ define "RenderImageCaption" -}}
@@ -31,6 +35,7 @@
{{- $resource = or ($.Page.Resources.GetMatch $url.String) (resources.Get $url.String) }} {{- $resource = or ($.Page.Resources.GetMatch $url.String) (resources.Get $url.String) }}
{{- end }} {{- end }}
<figure> <figure>
{{- if $isRemote }} {{- if $isRemote }}
{{ template "RenderImageSimple" (dict "src" $url.String "alt" $altText) }} {{ template "RenderImageSimple" (dict "src" $url.String "alt" $altText) }}

View File

@@ -1,7 +1,10 @@
<a href="{{ .Destination | safeURL }}" <a
{{- with .Title -}} href="{{ .Destination | safeURL }}"
{{- with .Title -}}
title="{{ . }}" title="{{ . }}"
{{- end }} {{- end }}
{{- if or (strings.HasPrefix .Destination "http:") (strings.HasPrefix .Destination "https:") }} target="_blank"{{ end }}> {{- if or (strings.HasPrefix .Destination "http:") (strings.HasPrefix .Destination "https:") }}
{{- .Text | safeHTML -}} target="_blank"
</a> {{ end }}>
{{- .Text | safeHTML -}}
</a>

View File

@@ -1,42 +1,58 @@
<!DOCTYPE html> <!doctype html>
<html lang="{{ with .Site.Params.isoCode | default (.Site.LanguageCode | default " en") }} {{- . -}} {{ end }}" dir="{{ if .Site.Params.rtl | default false -}} <html
lang="{{ with .Site.Params.isoCode | default (.Site.LanguageCode | default " en") }}{{- . -}}{{ end }}"
dir="{{ if .Site.Params.rtl | default false -}}
rtl rtl
{{- else -}} {{- else -}}
ltr ltr
{{- end }}" class="scroll-smooth" data-default-appearance="{{ .Site.Params.defaultAppearance | default " light" }}" {{- end }}"
class="scroll-smooth"
data-default-appearance="{{ .Site.Params.defaultAppearance | default " light" }}"
data-auto-appearance="{{ .Site.Params.autoSwitchAppearance | default " true" }}"> data-auto-appearance="{{ .Site.Params.autoSwitchAppearance | default " true" }}">
{{- partial "head.html" . -}} {{- partial "head.html" . -}}
<body
class="flex flex-col h-screen px-6 m-auto text-lg leading-7 max-w-7xl bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral sm:px-14 md:px-24 lg:px-32 scrollbar-thin scrollbar-track-neutral-200 scrollbar-thumb-neutral-400 dark:scrollbar-track-neutral-800 dark:scrollbar-thumb-neutral-600"> <body
<div id="the-top" class="absolute flex self-center"> class="flex flex-col h-screen px-6 m-auto text-lg leading-7 max-w-7xl bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral sm:px-14 md:px-24 lg:px-32 scrollbar-thin scrollbar-track-neutral-200 scrollbar-thumb-neutral-400 dark:scrollbar-track-neutral-800 dark:scrollbar-thumb-neutral-600">
<a class="px-3 py-1 text-sm -translate-y-8 rounded-b-lg bg-primary-200 focus:translate-y-0 dark:bg-neutral-600" <div id="the-top" class="absolute flex self-center">
href="#main-content"><span <a
class="font-bold text-primary-600 ltr:pr-2 rtl:pl-2 dark:text-primary-400">&darr;</span>{{ i18n class="px-3 py-1 text-sm -translate-y-8 rounded-b-lg bg-primary-200 focus:translate-y-0 dark:bg-neutral-600"
"nav.skip_to_main" }}</a> href="#main-content"
</div> ><span class="font-bold text-primary-600 ltr:pr-2 rtl:pl-2 dark:text-primary-400">&darr;</span>{{ i18n
{{ $header := print "header/" .Site.Params.header.layout ".html" }} "nav.skip_to_main"
{{ if templates.Exists ( printf "partials/%s" $header ) }} }}</a
{{ partial $header . }} >
{{ else }} </div>
{{ partial "header/basic.html" . }} {{ $header := print "header/" .Site.Params.header.layout ".html" }}
{{ end }} {{ if templates.Exists ( printf "partials/%s" $header ) }}
<div class="relative flex flex-col grow"> {{ partial $header . }}
<main id="main-content" class="grow"> {{ else }}
{{ block "main" . }}{{ end }} {{ partial "header/basic.html" . }}
{{ if and (.Site.Params.footer.showScrollToTop | default true) (gt .WordCount 1) }}
{{- partial "scroll-to-top.html" . -}}
{{ end }}
</main>
{{- partial "footer.html" . -}}
{{ if .Site.Params.enableSearch | default false }}
{{- partial "search.html" . -}}
{{ end }} {{ end }}
</div> <div class="relative flex flex-col grow">
</body> <main id="main-content" class="grow">
{{ if .Site.Params.buymeacoffee.globalWidget | default false }} {{ block "main" . }}{{ end }}
<script data-name="BMC-Widget" data-cfasync="false" src="https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js" {{ if and (.Site.Params.footer.showScrollToTop | default true) (gt .WordCount 1) }}
data-id="{{ .Site.Params.buymeacoffee.identifier }}" data-description="Support me on Buy me a coffee!" data-message="{{ .Site.Params.buymeacoffee.globalWidgetMessage | default "" }}" {{- partial "scroll-to-top.html" . -}}
data-color="{{ .Site.Params.buymeacoffee.globalWidgetColor | default "#FFDD00" }}" data-position="{{ .Site.Params.buymeacoffee.globalWidgetPosition | default "Left" }}" data-x_margin="18" data-y_margin="18"></script> {{ end }}
{{ end }} </main>
{{- partial "footer.html" . -}}
{{ if .Site.Params.enableSearch | default false }}
{{- partial "search.html" . -}}
{{ end }}
</div>
</body>
{{ if .Site.Params.buymeacoffee.globalWidget | default false }}
<script
data-name="BMC-Widget"
data-cfasync="false"
src="https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js"
data-id="{{ .Site.Params.buymeacoffee.identifier }}"
data-description="Support me on Buy me a coffee!"
data-message="{{ .Site.Params.buymeacoffee.globalWidgetMessage | default "" }}"
data-color="{{ .Site.Params.buymeacoffee.globalWidgetColor | default "#FFDD00" }}"
data-position="{{ .Site.Params.buymeacoffee.globalWidgetPosition | default "Left" }}"
data-x_margin="18"
data-y_margin="18"></script>
{{ end }}
</html> </html>

View File

@@ -1,108 +1,124 @@
{{ define "main" }} {{ define "main" }}
{{ .Scratch.Set "scope" "single" }} {{ .Scratch.Set "scope" "single" }}
<article>
{{ if .Params.showHero | default (.Site.Params.article.showHero | default false) }}
{{ $heroStyle := .Params.heroStyle }}
{{ if not $heroStyle }}{{ $heroStyle = .Site.Params.article.heroStyle }}{{ end }}
{{ $heroStyle := print "hero/" $heroStyle ".html" }}
{{ if templates.Exists ( printf "partials/%s" $heroStyle ) }}
{{ partial $heroStyle . }}
{{ else }}
{{ partial "hero/basic.html" . }}
{{ end }}
{{ end }}
<header id="single_header" class="mt-5 max-w-prose"> <article>
{{ if .Params.showBreadcrumbs | default (.Site.Params.article.showBreadcrumbs | default false) }} {{ if .Params.showHero | default (.Site.Params.article.showHero | default false) }}
{{ partial "breadcrumbs.html" . }} {{ $heroStyle := .Params.heroStyle }}
{{ end }} {{ if not $heroStyle }}{{ $heroStyle = .Site.Params.article.heroStyle }}{{ end }}
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral"> {{ $heroStyle := print "hero/" $heroStyle ".html" }}
{{ .Title | emojify }} {{ if templates.Exists ( printf "partials/%s" $heroStyle ) }}
</h1> {{ partial $heroStyle . }}
<div class="mt-1 mb-6 text-base text-neutral-500 dark:text-neutral-400 print:hidden"> {{ else }}
{{ partial "article-meta/basic.html" (dict "context" . "scope" "single") }} {{ partial "hero/basic.html" . }}
</div> {{ end }}
{{ $authorsData := .Site.Data.authors }}
{{ $taxonomies := .Site.Taxonomies.authors }}
{{ $baseURL := .Site.BaseURL }}
{{ $taxonomyLink := 0 }}
{{ $showAuthor := 0 }}
{{ if not (strings.HasSuffix $baseURL "/") }}
{{ $baseURL = delimit (slice $baseURL "/") "" }}
{{ end }} {{ end }}
{{ if not (.Params.showAuthorBottom | default ( .Site.Params.article.showAuthorBottom | default false)) }}
<header id="single_header" class="mt-5 max-w-prose">
{{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }} {{ if .Params.showBreadcrumbs | default (.Site.Params.article.showBreadcrumbs | default false) }}
{{ $showAuthor = 1 }} {{ partial "breadcrumbs.html" . }}
{{ partial "author.html" . }}
{{ end }} {{ end }}
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">
{{ range $author := .Page.Params.authors }} {{ .Title | emojify }}
{{ $authorData := index $authorsData $author }} </h1>
{{- if $authorData -}} <div class="mt-1 mb-6 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
{{ range $taxonomyname, $taxonomy := $taxonomies }} {{ partial "article-meta/basic.html" (dict "context" . "scope" "single") }}
{{ if (eq $taxonomyname $author) }}
{{ $taxonomyLink = delimit (slice $baseURL "authors/" $author "/") "" }}
{{ end }}
{{ end }}
{{ $finalLink := $taxonomyLink }}
{{ $currentLang := $.Site.Language.Lang }}
{{ if eq $.Site.LanguagePrefix "" }}
{{ $finalLink = printf "%sauthors/%s/" $baseURL $author }}
{{ else }}
{{ $finalLink = printf "%s%s/authors/%s/" $baseURL $currentLang $author }}
{{ end }}
{{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $finalLink) }}
{{- end -}}
{{ end }}
{{ if or $taxonomyLink $showAuthor }}
<div class="mb-5"></div>
{{ end }}
{{ end }}
</header>
<section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row">
{{ if or (and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in
.TableOfContents "<ul")) (.Site.Params.article.showRelatedPosts | default false) }} <div
class="order-first lg:ml-auto px-0 lg:order-last ltr:lg:pl-8 rtl:lg:pr-8">
<div class="toc ltr:pl-5 rtl:pr-5 print:hidden lg:sticky {{ if hasPrefix .Site.Params.header.layout "fixed" -}}
lg:top-[140px]{{ else }}lg:top-10{{ end }}">
{{ if and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in
.TableOfContents "<ul") }} {{ partial "toc.html" . }} {{ end }} {{ if .Site.Params.article.showRelatedPosts |
default false }} sd {{ end }} </div>
</div> </div>
{{ $authorsData := .Site.Data.authors }}
{{ $taxonomies := .Site.Taxonomies.authors }}
{{ $baseURL := .Site.BaseURL }}
{{ $taxonomyLink := 0 }}
{{ $showAuthor := 0 }}
{{ if not (strings.HasSuffix $baseURL "/") }}
{{ $baseURL = delimit (slice $baseURL "/") "" }}
{{ end }} {{ end }}
{{ if not (.Params.showAuthorBottom | default ( .Site.Params.article.showAuthorBottom | default false)) }}
{{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }}
{{ $showAuthor = 1 }}
{{ partial "author.html" . }}
{{ end }}
{{ range $author := .Page.Params.authors }}
{{ $authorData := index $authorsData $author }}
{{- if $authorData -}}
{{ range $taxonomyname, $taxonomy := $taxonomies }}
{{ if (eq $taxonomyname $author) }}
{{ $taxonomyLink = delimit (slice $baseURL "authors/" $author "/") "" }}
{{ end }}
{{ end }}
{{ $finalLink := $taxonomyLink }}
{{ $currentLang := $.Site.Language.Lang }}
{{ if eq $.Site.LanguagePrefix "" }}
{{ $finalLink = printf "%sauthors/%s/" $baseURL $author }}
{{ else }}
{{ $finalLink = printf "%s%s/authors/%s/" $baseURL $currentLang $author }}
{{ end }}
{{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $finalLink) }}
{{- end -}}
{{ end }}
{{ if or $taxonomyLink $showAuthor }}
<div class="mb-5"></div>
{{ end }}
{{ end }}
</header>
<section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row">
{{ if or (and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in
.TableOfContents "<ul")) (.Site.Params.article.showRelatedPosts | default false)
}}
<div class="order-first lg:ml-auto px-0 lg:order-last ltr:lg:pl-8 rtl:lg:pr-8">
<div
class="toc ltr:pl-5 rtl:pr-5 print:hidden lg:sticky {{ if hasPrefix .Site.Params.header.layout "fixed" -}}
lg:top-[140px]
{{ else }}
lg:top-10
{{ end }}
">
{{ if and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in
.TableOfContents "<ul")
}}
{{ partial "toc.html" . }}
{{ end }}
{{ if .Site.Params.article.showRelatedPosts |
default false
}}
sd
{{ end }}
</div>
</div>
{{ end }}
<div class="min-w-0 min-h-0 max-w-fit"> <div class="min-w-0 min-h-0 max-w-fit">
{{ partial "series/series.html" . }} {{ partial "series/series.html" . }}
<div class="article-content max-w-prose mb-20"> <div class="article-content max-w-prose mb-20">
{{ .Content }} {{ .Content }}
{{ $defaultReplyByEmail := .Site.Params.replyByEmail }} {{ $defaultReplyByEmail := .Site.Params.replyByEmail }}
{{ $replyByEmail := default $defaultReplyByEmail .Params.replyByEmail }} {{ $replyByEmail := default $defaultReplyByEmail .Params.replyByEmail }}
{{ if $replyByEmail }} {{ if $replyByEmail }}
<strong class="block mt-8"> <strong class="block mt-8">
<a target="_blank" <a
class="m-1 rounded bg-neutral-300 p-1.5 text-neutral-700 hover:bg-primary-500 hover:text-neutral dark:bg-neutral-700 dark:text-neutral-300 dark:hover:bg-primary-400 dark:hover:text-neutral-800" target="_blank"
href="mailto:{{ .Site.Params.Author.email }}?subject={{ replace (printf "Reply to %s" .Title) "\"" "'" }}"> class="m-1 rounded bg-neutral-300 p-1.5 text-neutral-700 hover:bg-primary-500 hover:text-neutral dark:bg-neutral-700 dark:text-neutral-300 dark:hover:bg-primary-400 dark:hover:text-neutral-800"
href="mailto:{{ .Site.Params.Author.email }}?subject={{ replace (printf "Reply to %s" .Title) "\"" "'" }}">
Reply by Email Reply by Email
</a> </a>
</strong> </strong>
{{ end }} {{ end }}
</div> </div>
{{ if (.Params.showAuthorBottom | default ( .Site.Params.article.showAuthorBottom | default false)) }} {{ if (.Params.showAuthorBottom | default ( .Site.Params.article.showAuthorBottom | default false)) }}
{{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }} {{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }}
@@ -123,44 +139,48 @@
{{ end }} {{ end }}
{{ if or $taxonomyLink $showAuthor }} {{ if or $taxonomyLink $showAuthor }}
<div class="mb-10"></div> <div class="mb-10"></div>
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ partial "series/series-closed.html" . }} {{ partial "series/series-closed.html" . }}
{{ partial "sharing-links.html" . }} {{ partial "sharing-links.html" . }}
{{ partial "related.html" . }} {{ partial "related.html" . }}
</div> </div>
{{ $translations := .AllTranslations }} {{ $translations := .AllTranslations }}
{{ with .File }} {{ with .File }}
{{ $path := .Path }} {{ $path := .Path }}
{{range $translations}} {{ range $translations }}
{{ $lang := print "." .Lang ".md" }} {{ $lang := print "." .Lang ".md" }}
{{ $path = replace $path $lang ".md" }} {{ $path = replace $path $lang ".md" }}
{{end}} {{ end }}
{{ $jsPage := resources.Get "js/page.js" }} {{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint ($.Site.Params.fingerprintAlgorithm | default "sha512") }} {{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint ($.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}" data-oid="views_{{ $path }}" data-oid-likes="likes_{{ $path }}"></script> <script
type="text/javascript"
src="{{ $jsPage.RelPermalink }}"
integrity="{{ $jsPage.Data.Integrity }}"
data-oid="views_{{ $path }}"
data-oid-likes="likes_{{ $path }}"></script>
{{ end }} {{ end }}
</section>
<footer class="pt-8 max-w-prose print:hidden">
{{ partial "article-pagination.html" . }} </section>
{{ if .Params.showComments | default (.Site.Params.article.showComments | default false) }} <footer class="pt-8 max-w-prose print:hidden">
{{ if templates.Exists "partials/comments.html" }} {{ partial "article-pagination.html" . }}
<div class="pt-3"> {{ if .Params.showComments | default (.Site.Params.article.showComments | default false) }}
<hr class="border-dotted border-neutral-300 dark:border-neutral-600" /> {{ if templates.Exists "partials/comments.html" }}
<div class="pt-3"> <div class="pt-3">
{{ partial "comments.html" . }} <hr class="border-dotted border-neutral-300 dark:border-neutral-600">
</div> <div class="pt-3">
</div> {{ partial "comments.html" . }}
{{ else }} </div>
{{ warnf "[BLOWFISH] Comments are enabled for %s but no comments partial exists." .File.Path }} </div>
{{ end }} {{ else }}
{{ end }} {{ warnf "[BLOWFISH] Comments are enabled for %s but no comments partial exists." .File.Path }}
</footer> {{ end }}
</article> {{ end }}
</footer>
</article>
{{ end }} {{ end }}

View File

@@ -1,127 +1,128 @@
{{ define "main" }} {{ define "main" }}
{{ .Scratch.Set "scope" "term" }}
{{ if .Site.Params.term.showHero | default false }}
{{ $heroStyle := print "hero/" .Site.Params.term.heroStyle ".html" }}
{{ if templates.Exists ( printf "partials/%s" $heroStyle ) }}
{{ partial $heroStyle . }}
{{ else }}
{{ partial "hero/basic.html" . }}
{{ end }}
{{- end -}}
{{ .Scratch.Set "scope" "term" }} {{ $toc := and (.Params.showTableOfContents | default (.Site.Params.term.showTableOfContents | default false)) (in
{{ if .Site.Params.term.showHero | default false }} .TableOfContents "<ul")
{{ $heroStyle := print "hero/" .Site.Params.term.heroStyle ".html" }} }}
{{ if templates.Exists ( printf "partials/%s" $heroStyle ) }} <header>
{{ partial $heroStyle . }} {{ if .Params.showBreadcrumbs | default (.Site.Params.term.showBreadcrumbs | default false) }}
{{ else }} {{ partial "breadcrumbs.html" . }}
{{ partial "hero/basic.html" . }} {{ end }}
{{ end }} <h1 class="mt-5 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
{{- end -}} <div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
{{ partial "article-meta/term.html" (dict "context" . "scope" "single") }}
{{ $toc := and (.Params.showTableOfContents | default (.Site.Params.term.showTableOfContents | default false)) (in </div>
.TableOfContents "<ul") }} <header>
{{ if .Params.showBreadcrumbs | default (.Site.Params.term.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-5 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
<div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
{{ partial "article-meta/term.html" (dict "context" . "scope" "single") }}
</div>
</header> </header>
<section class="flex flex-col max-w-full mt-0 mb-5 prose dark:prose-invert lg:flex-row"> <section class="flex flex-col max-w-full mt-0 mb-5 prose dark:prose-invert lg:flex-row">
{{ if .Content }} {{ if .Content }}
<div class="min-w-0 min-h-0 max-w-prose"> <div class="min-w-0 min-h-0 max-w-prose">
{{ .Content }} {{ .Content }}
</div> </div>
{{ $jsPage := resources.Get "js/page.js" }} {{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }} {{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}" data-oid="views_term_{{ .Data.Term }}" data-oid-likes="likes_term_{{ .Data.Term }}"></script> <script
type="text/javascript"
src="{{ $jsPage.RelPermalink }}"
integrity="{{ $jsPage.Data.Integrity }}"
data-oid="views_term_{{ .Data.Term }}"
data-oid-likes="likes_term_{{ .Data.Term }}"></script>
{{ end }} {{ end }}
</section> </section>
{{ if gt .Pages 0 }} {{ if gt .Pages 0 }}
{{ $cardView := .Params.cardView | default (.Site.Params.term.cardView | default false) }}
{{ $cardViewScreenWidth := .Site.Params.term.cardViewScreenWidth | default false }}
{{ $groupByYear := .Params.groupByYear | default ($.Site.Params.term.groupByYear | default false) }}
{{ $cardView := .Params.cardView | default (.Site.Params.term.cardView | default false) }} {{ if not $cardView }}
{{ $cardViewScreenWidth := .Site.Params.term.cardViewScreenWidth | default false }}
{{ $groupByYear := .Params.groupByYear | default ($.Site.Params.term.groupByYear | default false) }}
{{ if not $cardView }} <section class="space-y-10 w-full">
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ if $groupByYear }}
<h2 class="mt-12 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
{{ .Key }}
</h2>
{{ end }}
{{ range .Pages }}
{{ partial "article-link/simple.html" . }}
{{ end }}
{{ end }}
</section>
{{ else if and $cardView (not $cardViewScreenWidth) }}
{{ if $groupByYear }}
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
<h2 class="mt-12 mb-3 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
{{ .Key }}
</h2>
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
{{ range .Pages }}
{{ partial "article-link/card.html" . }}
{{ end }}
</section>
{{ end }}
{{ else }}
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ range .Pages }}
{{ partial "article-link/card.html" . }}
{{ end }}
{{ end }}
</section>
{{ end }}
{{ else if and $cardView $cardViewScreenWidth }}
{{ if $groupByYear }}
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
<div class="relative w-screen max-w-[1600px] px-[30px] center-relative-left">
<h2 class="mt-12 mb-3 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
{{ .Key }}
</h2>
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
{{ range .Pages }}
{{ partial "article-link/card.html" . }}
{{ end }}
</section>
</div>
{{ end }}
{{ else }}
<div class="relative w-screen max-w-[1600px] px-[30px] center-relative-left">
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ range .Pages }}
{{ partial "article-link/card.html" . }}
{{ end }}
{{ end }}
</section>
</div>
{{ end }}
<section class="space-y-10 w-full">
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ if $groupByYear }}
<h2 class="mt-12 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
{{ .Key }}
</h2>
{{ end }} {{ end }}
{{ range .Pages }}
{{ partial "article-link/simple.html" . }}
{{ end }}
{{ end }}
</section>
{{ else if and $cardView (not $cardViewScreenWidth) }}
{{ if $groupByYear }}
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
<h2 class="mt-12 mb-3 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
{{ .Key }}
</h2>
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
{{ range .Pages }}
{{ partial "article-link/card.html" . }}
{{ end }}
</section>
{{ end }}
{{ else }} {{ else }}
<section class="mt-10 prose dark:prose-invert">
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3"> <p class="py-8 border-t">
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} <em>{{ i18n "term.no_articles" | emojify }}</em>
{{ range .Pages }} </p>
{{ partial "article-link/card.html" . }}
{{ end }}
{{ end }}
</section>
{{ end }}
{{ else if and $cardView $cardViewScreenWidth }}
{{ if $groupByYear }}
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
<div class="relative w-screen max-w-[1600px] px-[30px] center-relative-left">
<h2 class="mt-12 mb-3 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
{{ .Key }}
</h2>
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
{{ range .Pages }}
{{ partial "article-link/card.html" . }}
{{ end }}
</section> </section>
</div>
{{ end }}
{{ else }}
<div class="relative w-screen max-w-[1600px] px-[30px] center-relative-left">
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ range .Pages }}
{{ partial "article-link/card.html" . }}
{{ end }}
{{ end }}
</section>
</div>
{{ end }}
{{end}}
{{ else }}
<section class="mt-10 prose dark:prose-invert">
<p class="py-8 border-t">
<em>{{ i18n "term.no_articles" | emojify }}</em>
</p>
</section>
{{ end }} {{ end }}
{{ partial "pagination.html" . }} {{ partial "pagination.html" . }}
{{ end }} {{ end }}

View File

@@ -1,17 +1,18 @@
{{ define "main" }} {{ define "main" }}
{{ .Scratch.Set "scope" "list" }}
{{ if .Site.Params.taxonomy.showHero | default false }}
{{ $heroStyle := print "hero/" .Site.Params.taxonomy.heroStyle ".html" }}
{{ if templates.Exists ( printf "partials/%s" $heroStyle ) }}
{{ partial $heroStyle . }}
{{ else }}
{{ partial "hero/basic.html" . }}
{{ end }}
{{- end -}}
{{ .Scratch.Set "scope" "list" }} {{ $toc := and (.Params.showTableOfContents | default (.Site.Params.taxonomy.showTableOfContents | default false)) (in
{{ if .Site.Params.taxonomy.showHero | default false }} .TableOfContents "<ul")
{{ $heroStyle := print "hero/" .Site.Params.taxonomy.heroStyle ".html" }} }}
{{ if templates.Exists ( printf "partials/%s" $heroStyle ) }}
{{ partial $heroStyle . }}
{{ else }}
{{ partial "hero/basic.html" . }}
{{ end }}
{{- end -}}
{{ $toc := and (.Params.showTableOfContents | default (.Site.Params.taxonomy.showTableOfContents | default false)) (in
.TableOfContents "<ul") }}
<header> <header>
{{ if .Params.showBreadcrumbs | default (.Site.Params.taxonomy.showBreadcrumbs | default false) }} {{ if .Params.showBreadcrumbs | default (.Site.Params.taxonomy.showBreadcrumbs | default false) }}
@@ -28,28 +29,29 @@
{{ .Content }} {{ .Content }}
</div> </div>
</section> </section>
{{ $jsPage := resources.Get "js/page.js" }} {{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }} {{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}" data-oid="views_taxonomy_{{ .Data.Plural }}" data-oid-likes="likes_taxonomy_{{ .Data.Plural }}"></script> <script
type="text/javascript"
src="{{ $jsPage.RelPermalink }}"
integrity="{{ $jsPage.Data.Integrity }}"
data-oid="views_taxonomy_{{ .Data.Plural }}"
data-oid-likes="likes_taxonomy_{{ .Data.Plural }}"></script>
{{ end }} {{ end }}
{{ if .Site.Params.taxonomy.cardView }} {{ if .Site.Params.taxonomy.cardView }}
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3"> {{ range .Data.Terms }}
{{ range .Data.Terms }} {{ partial "term-link/card.html" . }}
{{ partial "term-link/card.html" . }} {{ end }}
{{ end }} </section>
</section>
{{ else }} {{ else }}
<section class="flex flex-wrap max-w-prose -mx-2 overflow-hidden"> <section class="flex flex-wrap max-w-prose -mx-2 overflow-hidden">
{{ range .Data.Terms }} {{ range .Data.Terms }}
{{ partial "term-link/text.html" . }} {{ partial "term-link/text.html" . }}
{{ end }} {{ end }}
</section> </section>
{{ end }} {{ end }}
{{ end }} {{ end }}

View File

@@ -1,5 +1,11 @@
{{ if isset site.Params.fathomAnalytics "domain" }} {{ if isset site.Params.fathomAnalytics "domain" }}
<script defer src="https://{{ site.Params.fathomAnalytics.domain }}/script.js" data-site="{{ site.Params.fathomAnalytics.site }}"></script> <script
defer
src="https://{{ site.Params.fathomAnalytics.domain }}/script.js"
data-site="{{ site.Params.fathomAnalytics.site }}"></script>
{{ else }} {{ else }}
<script defer src="https://cdn.usefathom.com/script.js" data-site="{{ site.Params.fathomAnalytics.site }}"></script> <script
{{ end }} defer
src="https://cdn.usefathom.com/script.js"
data-site="{{ site.Params.fathomAnalytics.site }}"></script>
{{ end }}

View File

@@ -1,8 +1,10 @@
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.Config.Services.GoogleAnalytics.ID }}"></script> <script
async
src="https://www.googletagmanager.com/gtag/js?id={{ site.Config.Services.GoogleAnalytics.ID }}"></script>
<script> <script>
window.dataLayer = window.dataLayer || []; window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);} function gtag(){dataLayer.push(arguments);}
gtag('js', new Date()); gtag('js', new Date());
gtag('config', '{{ site.Config.Services.GoogleAnalytics.ID }}'); gtag('config', '{{ site.Config.Services.GoogleAnalytics.ID }}');
</script> </script>

View File

@@ -1,12 +1,12 @@
{{ with site.Params.fathomAnalytics.site }} {{ with site.Params.fathomAnalytics.site }}
{{ partial "analytics/fathom.html" }} {{ partial "analytics/fathom.html" }}
{{ end }} {{ end }}
{{ with site.Config.Services.GoogleAnalytics.ID }} {{ with site.Config.Services.GoogleAnalytics.ID }}
{{ partial "analytics/ga.html" }} {{ partial "analytics/ga.html" }}
{{ end }} {{ end }}
{{ with site.Params.umamiAnalytics.websiteid }} {{ with site.Params.umamiAnalytics.websiteid }}
{{ partial "analytics/umami.html" }} {{ partial "analytics/umami.html" }}
{{ end }} {{ end }}
{{ with site.Params.selineAnalytics.token }} {{ with site.Params.selineAnalytics.token }}
{{ partial "analytics/seline.html" }} {{ partial "analytics/seline.html" }}
{{ end }} {{ end }}

View File

@@ -1,18 +1,21 @@
<script async src="https://cdn.seline.so/seline.js" data-token="{{ site.Params.selineAnalytics.token }}" data-id="seline-script"></script> <script
async
src="https://cdn.seline.so/seline.js"
data-token="{{ site.Params.selineAnalytics.token }}"
data-id="seline-script"></script>
{{ if .Site.Params.selineAnalytics.enableTrackEvent | default true }} {{ if .Site.Params.selineAnalytics.enableTrackEvent | default true }}
<script type="text/javascript"> <script type="text/javascript">
document.querySelector('script[data-id="seline-script"]') document.querySelector('script[data-id="seline-script"]').addEventListener("load", function () {
.addEventListener('load', function () { const type = document.head.querySelector('meta[property = "og:type"]').getAttribute("content");
const type = document.head.querySelector('meta[property = "og:type"]').getAttribute('content'); let title = document.head.querySelector('meta[property = "og:title"]').getAttribute("content");
let title = document.head.querySelector('meta[property = "og:title"]').getAttribute('content'); let url = document.head.querySelector('meta[property = "og:url"]').getAttribute("content");
let url = document.head.querySelector('meta[property = "og:url"]').getAttribute('content');
seline.track("user:" + type + ':' + title, { seline.track("user:" + type + ":" + title, {
type: type, type: type,
title: title, title: title,
url: url url: url,
}); });
}); });
</script> </script>
{{ end }} {{ end }}

View File

@@ -1,23 +1,29 @@
{{ if isset site.Params.umamiAnalytics "domain" }} {{ if isset site.Params.umamiAnalytics "domain" }}
<script data-id="umami-script" async <script
src="https://{{ site.Params.umamiAnalytics.domain }}/{{ with site.Params.umamiAnalytics.scriptName }}{{ . }}{{ else }}script.js{{ end }}" data-id="umami-script"
data-website-id="{{ site.Params.umamiAnalytics.websiteid }}" async
{{ with site.Params.umamiAnalytics.dataDomains }}data-domains="{{ . }}"{{ end }}> src="https://{{ site.Params.umamiAnalytics.domain }}/{{ with site.Params.umamiAnalytics.scriptName }}
</script> {{ . }}
{{ else }}
script.js
{{ end }}"
data-website-id="{{ site.Params.umamiAnalytics.websiteid }}"
{{ with site.Params.umamiAnalytics.dataDomains }}data-domains="{{ . }}"{{ end }}></script>
{{ else }} {{ else }}
<script data-id="umami-script" async src="https://analytics.umami.is/script.js" <script
data-website-id="{{ site.Params.umamiAnalytics.websiteid }}"> data-id="umami-script"
</script> async
src="https://analytics.umami.is/script.js"
data-website-id="{{ site.Params.umamiAnalytics.websiteid }}"></script>
{{ end }} {{ end }}
{{ if .Site.Params.umamiAnalytics.enableTrackEvent | default true }} {{ if .Site.Params.umamiAnalytics.enableTrackEvent | default true }}
<script type="text/javascript"> <script type="text/javascript">
document.querySelector('script[data-id="umami-script"]') document.querySelector('script[data-id="umami-script"]').addEventListener("load", function () {
.addEventListener('load', function () { const type = document.head.querySelector('meta[property = "og:type"]').getAttribute("content");
const type = document.head.querySelector('meta[property = "og:type"]').getAttribute('content'); let title = document.head.querySelector('meta[property = "og:title"]').getAttribute("content");
let title = document.head.querySelector('meta[property = "og:title"]').getAttribute('content'); let url = document.head.querySelector('meta[property = "og:url"]').getAttribute("content");
let url = document.head.querySelector('meta[property = "og:url"]').getAttribute('content'); umami.track(type + ":" + title, { url: url });
umami.track(type + ':' + title, {'url': url});
}); });
</script> </script>
{{ end }} {{ end }}

View File

@@ -9,112 +9,117 @@
{{ end }} {{ end }}
{{ with $context }} {{ with $context }}
{{ $meta := newScratch }} {{ $meta := newScratch }}
{{/* Gather partials for this context */}} {{/* Gather partials for this context */}}
{{ $shouldShowDate := false }} {{ $shouldShowDate := false }}
{{ if and (eq $scope "single") (.Params.showDateOnlyInArticle | default (.Site.Params.article.showDateOnlyInArticle | default false)) }} {{ if and (eq $scope "single") (.Params.showDateOnlyInArticle | default (.Site.Params.article.showDateOnlyInArticle | default false)) }}
{{ $shouldShowDate = true }} {{ $shouldShowDate = true }}
{{ end }}
{{/* showDate has higher priority than showDateOnlyInArticle */}}
{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
{{ $shouldShowDate = true }}
{{ else }}
{{ $shouldShowDate = false }}
{{ end }}
{{ if $shouldShowDate }}
{{ $meta.Add "partials" (slice (partial "meta/date.html" .Date)) }}
{{ end }}
{{ if and (.Params.showDateUpdated | default (.Site.Params.article.showDateUpdated | default false)) (ne (partial
"functions/date.html" .Date) (partial "functions/date.html" .Lastmod)) (gt (.Lastmod | time.Format "2006") 1) }}
{{ $meta.Add "partials" (slice (partial "meta/date-updated.html" .Lastmod)) }}
{{ end }}
{{ if and (.Params.showWordCount | default (.Site.Params.article.showWordCount | default false)) (ne .WordCount 0) }}
{{ $meta.Add "partials" (slice (partial "meta/word-count.html" .)) }}
{{ end }}
{{ if and (.Params.showReadingTime | default (.Site.Params.article.showReadingTime | default true)) (ne .ReadingTime 0)
}}
{{ $meta.Add "partials" (slice (partial "meta/reading-time.html" .)) }}
{{ end }}
{{ if and (not .Params.externalURL) (.Params.showViews | default (.Site.Params.article.showViews | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
{{ end }}
{{ if and (not .Params.externalURL) (.Params.showLikes | default (.Site.Params.article.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (not .Params.externalURL) (.Params.showLikes | default (.Site.Params.article.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showEdit | default (.Site.Params.article.showEdit | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/edit.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showZenMode | default (.Site.Params.article.showZenMode | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/zen-mode.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML }}
{{ end }} {{ end }}
{{/* Output draft label */}} {{/* showDate has higher priority than showDateOnlyInArticle */}}
{{ if and (eq $scope "single") (and .Draft .Site.Params.article.showDraftLabel) }} {{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
<span class="pl-2">{{ partial "badge.html" (i18n "article.draft" | emojify) }}</span> {{ $shouldShowDate = true }}
{{ else }}
{{ $shouldShowDate = false }}
{{ end }} {{ end }}
</div>
{{ if .Params.showAuthorsBadges | default (.Site.Params.article.showAuthorsBadges | default false) }} {{ if $shouldShowDate }}
<div class="flex flex-row flex-wrap items-center"> {{ $meta.Add "partials" (slice (partial "meta/date.html" .Date)) }}
{{ range $taxonomy, $terms := .Site.Taxonomies }}
{{ if (eq $taxonomy "authors")}}
{{ if (gt (len ($context.GetTerms $taxonomy)) 0) }}
{{ range $i, $a := $context.GetTerms $taxonomy }}
{{ if not (eq $i 0) }} ,&nbsp; {{ end }} <div class="cursor-pointer" onclick="window.open({{ $a.RelPermalink }},'_self');return false;">{{ $a.LinkTitle }}</div>
{{ end }} {{ end }}
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}
{{/* Output taxonomies */}} {{ if and (.Params.showDateUpdated | default (.Site.Params.article.showDateUpdated | default false)) (ne (partial
{{ if .Params.showTaxonomies | default (.Site.Params.article.showTaxonomies | default false) }} "functions/date.html" .Date) (partial "functions/date.html" .Lastmod)) (gt (.Lastmod | time.Format "2006") 1)
<div class="flex flex-row flex-wrap items-center"> }}
{{ range $taxonomy, $terms := .Site.Taxonomies }} {{ $meta.Add "partials" (slice (partial "meta/date-updated.html" .Lastmod)) }}
{{ if and (not (eq $taxonomy "authors")) (not (eq $taxonomy "series"))}}
{{ if (gt (len ($context.GetTerms $taxonomy)) 0) }}
{{ range $context.GetTerms $taxonomy }}
<span class="mr-2 margin-top-[0.5rem]" onclick="window.open({{ .RelPermalink }},'_self');return false;">
{{ partial "badge.html" .LinkTitle }}
</span>
{{ end }} {{ end }}
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}
{{/* Output only category */}} {{ if and (.Params.showWordCount | default (.Site.Params.article.showWordCount | default false)) (ne .WordCount 0) }}
{{ if .Params.showCategoryOnly | default (.Site.Params.article.showCategoryOnly | default false) }} {{ $meta.Add "partials" (slice (partial "meta/word-count.html" .)) }}
<div class="flex flex-row flex-wrap items-center"> {{ end }}
{{ range (.GetTerms "categories") }}
<span class="mr-2 margin-top-[0.5rem]" onclick="window.open({{ .RelPermalink }},'_self');return false;"> {{ if and (.Params.showReadingTime | default (.Site.Params.article.showReadingTime | default true)) (ne .ReadingTime 0) }}
{{ partial "badge.html" .LinkTitle }} {{ $meta.Add "partials" (slice (partial "meta/reading-time.html" .)) }}
</span> {{ end }}
{{ end }}
</div> {{ if and (not .Params.externalURL) (.Params.showViews | default (.Site.Params.article.showViews | default false)) }}
{{ end }} {{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
{{ end }}
{{ if and (not .Params.externalURL) (.Params.showLikes | default (.Site.Params.article.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (not .Params.externalURL) (.Params.showLikes | default (.Site.Params.article.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showEdit | default (.Site.Params.article.showEdit | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/edit.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showZenMode | default (.Site.Params.article.showZenMode | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/zen-mode.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML }}
{{ end }}
{{/* Output draft label */}}
{{ if and (eq $scope "single") (and .Draft .Site.Params.article.showDraftLabel) }}
<span class="pl-2">{{ partial "badge.html" (i18n "article.draft" | emojify) }}</span>
{{ end }}
</div>
{{ if .Params.showAuthorsBadges | default (.Site.Params.article.showAuthorsBadges | default false) }}
<div class="flex flex-row flex-wrap items-center">
{{ range $taxonomy, $terms := .Site.Taxonomies }}
{{ if (eq $taxonomy "authors") }}
{{ if (gt (len ($context.GetTerms $taxonomy)) 0) }}
{{ range $i, $a := $context.GetTerms $taxonomy }}
{{ if not (eq $i 0) }},&nbsp;{{ end }}
<div class="cursor-pointer" onclick="window.open({{ $a.RelPermalink }},'_self');return false;">
{{ $a.LinkTitle }}
</div>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}
{{/* Output taxonomies */}}
{{ if .Params.showTaxonomies | default (.Site.Params.article.showTaxonomies | default false) }}
<div class="flex flex-row flex-wrap items-center">
{{ range $taxonomy, $terms := .Site.Taxonomies }}
{{ if and (not (eq $taxonomy "authors")) (not (eq $taxonomy "series")) }}
{{ if (gt (len ($context.GetTerms $taxonomy)) 0) }}
{{ range $context.GetTerms $taxonomy }}
<span
class="mr-2 margin-top-[0.5rem]"
onclick="window.open({{ .RelPermalink }},'_self');return false;">
{{ partial "badge.html" .LinkTitle }}
</span>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}
{{/* Output only category */}}
{{ if .Params.showCategoryOnly | default (.Site.Params.article.showCategoryOnly | default false) }}
<div class="flex flex-row flex-wrap items-center">
{{ range (.GetTerms "categories") }}
<span class="mr-2 margin-top-[0.5rem]" onclick="window.open({{ .RelPermalink }},'_self');return false;">
{{ partial "badge.html" .LinkTitle }}
</span>
{{ end }}
</div>
{{ end }}
{{ end }} {{ end }}

View File

@@ -4,33 +4,32 @@
{{ $scope := default nil }} {{ $scope := default nil }}
{{ if (reflect.IsMap . ) }} {{ if (reflect.IsMap . ) }}
{{ $context = .context }} {{ $context = .context }}
{{ $scope = cond (not .scope) nil .scope }} {{ $scope = cond (not .scope) nil .scope }}
{{ end }} {{ end }}
{{ with $context }} {{ with $context }}
{{ $meta := newScratch }} {{ $meta := newScratch }}
{{/* Gather partials for this context */}} {{/* Gather partials for this context */}}
{{ if (.Params.showViews | default (.Site.Params.list.showViews | default false)) }} {{ if (.Params.showViews | default (.Site.Params.list.showViews | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }} {{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
{{ end }}
{{ if (.Params.showLikes | default (.Site.Params.list.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.list.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML}}
{{ end }} {{ end }}
</div>
{{ end }} {{ if (.Params.showLikes | default (.Site.Params.list.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.list.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML }}
{{ end }}
</div>
{{ end }}

View File

@@ -4,33 +4,32 @@
{{ $scope := default nil }} {{ $scope := default nil }}
{{ if (reflect.IsMap . ) }} {{ if (reflect.IsMap . ) }}
{{ $context = .context }} {{ $context = .context }}
{{ $scope = cond (not .scope) nil .scope }} {{ $scope = cond (not .scope) nil .scope }}
{{ end }} {{ end }}
{{ with $context }} {{ with $context }}
{{ $meta := newScratch }} {{ $meta := newScratch }}
{{/* Gather partials for this context */}} {{/* Gather partials for this context */}}
{{ if (.Params.showViews | default (.Site.Params.taxonomy.showViews | default false)) }} {{ if (.Params.showViews | default (.Site.Params.taxonomy.showViews | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }} {{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
{{ end }}
{{ if (.Params.showLikes | default (.Site.Params.taxonomy.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.taxonomy.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML}}
{{ end }} {{ end }}
</div>
{{ end }} {{ if (.Params.showLikes | default (.Site.Params.taxonomy.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.taxonomy.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML }}
{{ end }}
</div>
{{ end }}

View File

@@ -4,33 +4,32 @@
{{ $scope := default nil }} {{ $scope := default nil }}
{{ if (reflect.IsMap . ) }} {{ if (reflect.IsMap . ) }}
{{ $context = .context }} {{ $context = .context }}
{{ $scope = cond (not .scope) nil .scope }} {{ $scope = cond (not .scope) nil .scope }}
{{ end }} {{ end }}
{{ with $context }} {{ with $context }}
{{ $meta := newScratch }} {{ $meta := newScratch }}
{{/* Gather partials for this context */}} {{/* Gather partials for this context */}}
{{ if (.Params.showViews | default (.Site.Params.term.showViews | default false)) }} {{ if (.Params.showViews | default (.Site.Params.term.showViews | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }} {{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
{{ end }}
{{ if (.Params.showLikes | default (.Site.Params.term.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.term.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML}}
{{ end }} {{ end }}
</div>
{{ end }} {{ if (.Params.showLikes | default (.Site.Params.term.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.term.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML }}
{{ end }}
</div>
{{ end }}

View File

@@ -7,7 +7,7 @@
{{ $prev = .NextInSection }} {{ $prev = .NextInSection }}
{{ end }} {{ end }}
<div class="pt-8"> <div class="pt-8">
<hr class="border-dotted border-neutral-300 dark:border-neutral-600" /> <hr class="border-dotted border-neutral-300 dark:border-neutral-600">
<div class="flex justify-between pt-3"> <div class="flex justify-between pt-3">
<span> <span>
{{ if $prev }} {{ if $prev }}
@@ -21,8 +21,7 @@
>&rarr;</span >&rarr;</span
> >
<span class="flex flex-col"> <span class="flex flex-col">
<span <span class="mt-[0.1rem] leading-6 group-hover:underline group-hover:decoration-primary-500"
class="mt-[0.1rem] leading-6 group-hover:underline group-hover:decoration-primary-500"
>{{ $prev.Title | emojify }}</span >{{ $prev.Title | emojify }}</span
> >
<span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400"> <span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400">
@@ -38,8 +37,7 @@
{{ if $next }} {{ if $next }}
<a class="flex text-right group ml-3" href="{{ $next.RelPermalink }}"> <a class="flex text-right group ml-3" href="{{ $next.RelPermalink }}">
<span class="flex flex-col"> <span class="flex flex-col">
<span <span class="mt-[0.1rem] leading-6 group-hover:underline group-hover:decoration-primary-500"
class="mt-[0.1rem] leading-6 group-hover:underline group-hover:decoration-primary-500"
>{{ $next.Title | emojify }}</span >{{ $next.Title | emojify }}</span
> >
<span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400"> <span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400">

View File

@@ -1,42 +1,56 @@
{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }} {{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
<div class="flex author author-extra mt-4"> <div class="flex author author-extra mt-4">
{{ with .data.image }} {{ with .data.image }}
{{ $authorImage := resources.Get . }} {{ $authorImage := resources.Get . }}
{{ if $authorImage }} {{ if $authorImage }}
{{ if not $disableImageOptimization }} {{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "192x192" }} {{ $authorImage = $authorImage.Fill "192x192" }}
{{ end }}
<img class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4" width="96" height="96"
src="{{ $authorImage.RelPermalink }}" />
{{ else }}
{{ $authorImage := resources.GetRemote . }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "192x192" }}
{{ end }}
<img class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4" width="96" height="96"
src="{{ $authorImage.RelPermalink }}" />
{{ end }} {{ end }}
<img
class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4"
width="96"
height="96"
src="{{ $authorImage.RelPermalink }}">
{{ else }}
{{ $authorImage := resources.GetRemote . }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "192x192" }}
{{ end }}
<img
class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4"
width="96"
height="96"
src="{{ $authorImage.RelPermalink }}">
{{ end }}
{{ end }} {{ end }}
<div class="place-self-center"> <div class="place-self-center">
{{ $link := .link}} {{ $link := .link }}
{{ with .data.name | markdownify | emojify }} {{ with .data.name | markdownify | emojify }}
<div class="text-[0.6rem] uppercase leading-3 text-neutral-500 dark:text-neutral-400"> <div class="text-[0.6rem] uppercase leading-3 text-neutral-500 dark:text-neutral-400">
{{ i18n "author.byline_title" | markdownify }} {{ i18n "author.byline_title" | markdownify }}
</div> </div>
<a {{ if $link }} href="{{ $link }}" {{ end }} class="font-semibold leading-6 text-neutral-800 dark:text-neutral-300"> <a
{{ . }} {{ if $link }}href="{{ $link }}"{{ end }}
</a> class="font-semibold leading-6 text-neutral-800 dark:text-neutral-300">
{{ . }}
</a>
{{ end }} {{ end }}
{{ with .data.bio | markdownify }} {{ with .data.bio | markdownify }}
<div class="text-sm text-neutral-700 dark:text-neutral-400">{{ . }}</div> <div class="text-sm text-neutral-700 dark:text-neutral-400">{{ . }}</div>
{{ end }} {{ end }}
<div class="text-2xl sm:text-lg"> <div class="text-2xl sm:text-lg">
<div class="flex flex-wrap text-neutral-400 dark:text-neutral-500"> <div class="flex flex-wrap text-neutral-400 dark:text-neutral-500">
{{ range .data.social }} {{ range .data.social }}
{{ range $name, $link := . }} {{ range $name, $link := . }}
<a class="px-1 hover:text-primary-700 dark:hover:text-primary-400" href="{{ $link }}" target="_blank" <a
aria-label="{{ $name | title }}" rel="me noopener noreferrer"><span class="inline-block align-text-bottom">{{ partial "icon.html" $name }}</span></a> class="px-1 hover:text-primary-700 dark:hover:text-primary-400"
{{ end }} href="{{ $link }}"
target="_blank"
aria-label="{{ $name | title }}"
rel="me noopener noreferrer"
><span class="inline-block align-text-bottom">{{ partial "icon.html" $name }}</span></a
>
{{ end }}
{{ end }} {{ end }}
</div> </div>
</div> </div>

View File

@@ -11,28 +11,36 @@
{{ if not $disableImageOptimization }} {{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "192x192" }} {{ $authorImage = $authorImage.Fill "192x192" }}
{{ end }} {{ end }}
<img class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4" width="96" height="96" <img
alt="{{ $.Site.Params.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" /> class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4"
width="96"
height="96"
alt="{{ $.Site.Params.Author.name | default " Author" }}"
src="{{ $authorImage.RelPermalink }}">
{{ else }} {{ else }}
{{ $authorImage := resources.GetRemote . }} {{ $authorImage := resources.GetRemote . }}
{{ if not $disableImageOptimization }} {{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "192x192" }} {{ $authorImage = $authorImage.Fill "192x192" }}
{{ end }} {{ end }}
<img class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4" width="96" height="96" <img
alt="{{ $.Site.Params.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" /> class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4"
width="96"
height="96"
alt="{{ $.Site.Params.Author.name | default " Author" }}"
src="{{ $authorImage.RelPermalink }}">
{{ end }} {{ end }}
{{ end }} {{ end }}
<div class="place-self-center"> <div class="place-self-center">
{{ with .Site.Params.Author.name | markdownify }} {{ with .Site.Params.Author.name | markdownify }}
<div class="text-[0.6rem] uppercase leading-3 text-neutral-500 dark:text-neutral-400"> <div class="text-[0.6rem] uppercase leading-3 text-neutral-500 dark:text-neutral-400">
{{ i18n "author.byline_title" | markdownify }} {{ i18n "author.byline_title" | markdownify }}
</div> </div>
<div class="font-semibold leading-6 text-neutral-800 dark:text-neutral-300"> <div class="font-semibold leading-6 text-neutral-800 dark:text-neutral-300">
{{ . }} {{ . }}
</div> </div>
{{ end }} {{ end }}
{{ with .Site.Params.Author.bio | markdownify }} {{ with .Site.Params.Author.bio | markdownify }}
<div class="text-sm text-neutral-700 dark:text-neutral-400">{{ . }}</div> <div class="text-sm text-neutral-700 dark:text-neutral-400">{{ . }}</div>
{{ end }} {{ end }}
<div class="text-2xl sm:text-lg">{{ partialCached "author-links.html" . }}</div> <div class="text-2xl sm:text-lg">{{ partialCached "author-links.html" . }}</div>
</div> </div>

View File

@@ -1,5 +1,6 @@
<span class="flex cursor-pointer"> <span class="flex cursor-pointer">
<span class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400"> <span
class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400">
{{ . }} {{ . }}
</span> </span>
</span> </span>

View File

@@ -7,10 +7,8 @@
{{ else if not .p1.IsHome }} {{ else if not .p1.IsHome }}
{{ template "crumb" (dict "p1" .p1.Site.Home "p2" .p2 ) }} {{ template "crumb" (dict "p1" .p1.Site.Home "p2" .p2 ) }}
{{ end }} {{ end }}
<li class="{{ if or (eq .p1 .p2) (.p1.IsHome) }}hidden{{else}}inline{{ end }}"> <li class="{{ if or (eq .p1 .p2) (.p1.IsHome) }}hidden{{ else }}inline{{ end }}">
<a <a class="hover:underline decoration-neutral-300 dark:underline-neutral-600" href="{{ .p1.RelPermalink }}"
class="hover:underline decoration-neutral-300 dark:underline-neutral-600"
href="{{ .p1.RelPermalink }}"
>{{ if .p1.Title }} >{{ if .p1.Title }}
{{- .p1.Title -}} {{- .p1.Title -}}
{{ else }} {{ else }}

View File

@@ -2,50 +2,53 @@
{{/* Footer menu */}} {{/* Footer menu */}}
{{ if .Site.Params.footer.showMenu | default true }} {{ if .Site.Params.footer.showMenu | default true }}
{{ if .Site.Menus.footer }} {{ if .Site.Menus.footer }}
<nav class="flex flex-row pb-4 text-base font-medium text-neutral-500 dark:text-neutral-400"> <nav class="flex flex-row pb-4 text-base font-medium text-neutral-500 dark:text-neutral-400">
<ul class="flex flex-col list-none sm:flex-row"> <ul class="flex flex-col list-none sm:flex-row">
{{ range .Site.Menus.footer }} {{ range .Site.Menus.footer }}
<li class="flex mb-1 ltr:text-right rtl:text-left sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0"> <li
<a class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2 flex items-center" href="{{ .URL }}" class="flex mb-1 ltr:text-right rtl:text-left sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0">
title="{{ .Title }}"> <a
{{ if .Pre }} class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2 flex items-center"
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}> href="{{ .URL }}"
{{ partial "icon.html" .Pre }} title="{{ .Title }}">
</span> {{ if .Pre }}
{{ end }} <span {{ if and .Pre .Name }}class="mr-1"{{ end }}>
{{ .Name | markdownify }} {{ partial "icon.html" .Pre }}
</a> </span>
</li> {{ end }}
{{ end }} {{ .Name | markdownify }}
</ul> </a>
</nav> </li>
{{ end }}
</ul>
</nav>
{{ end }} {{ end }}
{{ end }} {{ end }}
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
{{/* Copyright */}} {{/* Copyright */}}
{{ if .Site.Params.footer.showCopyright | default true }} {{ if .Site.Params.footer.showCopyright | default true }}
<p class="text-sm text-neutral-500 dark:text-neutral-400"> <p class="text-sm text-neutral-500 dark:text-neutral-400">
{{- with replace .Site.Params.copyright "{ year }" now.Year }} {{- with replace .Site.Params.copyright "{ year }" now.Year }}
{{ . | markdownify }} {{ . | markdownify }}
{{- else }} {{- else }}
&copy; &copy;
{{ now.Format "2006" }} {{ now.Format "2006" }}
{{ .Site.Params.Author.name | markdownify }} {{ .Site.Params.Author.name | markdownify }}
{{- end }} {{- end }}
</p> </p>
{{ end }} {{ end }}
{{/* Theme attribution */}} {{/* Theme attribution */}}
{{ if .Site.Params.footer.showThemeAttribution | default true }} {{ if .Site.Params.footer.showThemeAttribution | default true }}
<p class="text-xs text-neutral-500 dark:text-neutral-400"> <p class="text-xs text-neutral-500 dark:text-neutral-400">
{{ $hugo := printf `<a class="hover:underline hover:decoration-primary-400 hover:text-primary-500" {{ $hugo := printf `<a class="hover:underline hover:decoration-primary-400 hover:text-primary-500"
href="https://gohugo.io/" target="_blank" rel="noopener noreferrer">Hugo</a>` href="https://gohugo.io/" target="_blank" rel="noopener noreferrer">Hugo</a>`
}} }}
{{ $blowfish := printf `<a class="hover:underline hover:decoration-primary-400 hover:text-primary-500" {{ $blowfish := printf `<a class="hover:underline hover:decoration-primary-400 hover:text-primary-500"
href="https://blowfish.page/" target="_blank" rel="noopener noreferrer">Blowfish</a>` }} href="https://blowfish.page/" target="_blank" rel="noopener noreferrer">Blowfish</a>`
{{ i18n "footer.powered_by" (dict "Hugo" $hugo "Theme" $blowfish) | safeHTML }} }}
</p> {{ i18n "footer.powered_by" (dict "Hugo" $hugo "Theme" $blowfish) | safeHTML }}
</p>
{{ end }} {{ end }}
</div> </div>
@@ -57,12 +60,14 @@
scrollOffset: 0, scrollOffset: 0,
}) })
{{ end }} {{ end }}
</script> </script> {{ $jsProcess := resources.Get "js/process.js" }}
{{ $jsProcess := resources.Get "js/process.js" }}
{{ $jsProcess = $jsProcess | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }} {{ $jsProcess = $jsProcess | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script type="text/javascript" src="{{ $jsProcess.RelPermalink }}" integrity="{{ $jsProcess.Data.Integrity }}"></script> <script
type="text/javascript"
src="{{ $jsProcess.RelPermalink }}"
integrity="{{ $jsProcess.Data.Integrity }}"></script>
{{/* Extend footer - eg. for extra scripts, etc. */}} {{/* Extend footer - eg. for extra scripts, etc. */}}
{{ if templates.Exists "partials/extend-footer.html" }} {{ if templates.Exists "partials/extend-footer.html" }}
{{ partialCached "extend-footer.html" . }} {{ partialCached "extend-footer.html" . }}
{{ end }} {{ end }}
</footer> </footer>

View File

@@ -10,4 +10,4 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ return md5 $uid }} {{ return md5 $uid }}

View File

@@ -1,10 +1,16 @@
<div class="min-h-[148px]"></div> <div class="min-h-[148px]"></div>
<div class="fixed inset-x-0 pl-[24px] pr-[24px] z-index-100"> <div class="fixed inset-x-0 pl-[24px] pr-[24px] z-index-100">
<div id="menu-blur" class="absolute opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom bg-neutral dark:bg-neutral-800"></div> <div
id="menu-blur"
class="absolute opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom bg-neutral dark:bg-neutral-800"></div>
<div class="relative max-w-[64rem] ml-auto mr-auto"> <div class="relative max-w-[64rem] ml-auto mr-auto">
{{ partial "header/basic.html" . }} {{ partial "header/basic.html" . }}
</div> </div>
</div> </div>
{{ $backgroundBlur := resources.Get "js/background-blur.js" }} {{ $backgroundBlur := resources.Get "js/background-blur.js" }}
{{ $backgroundBlur = $backgroundBlur | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }} {{ $backgroundBlur = $backgroundBlur | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script type="text/javascript" src="{{ $backgroundBlur.RelPermalink }}" integrity="{{ $backgroundBlur.Data.Integrity }}" data-target-id="menu-blur"></script> <script
type="text/javascript"
src="{{ $backgroundBlur.RelPermalink }}"
integrity="{{ $backgroundBlur.Data.Integrity }}"
data-target-id="menu-blur"></script>

View File

@@ -1,11 +1,18 @@
<div class="min-h-[148px]"></div> <div class="min-h-[148px]"></div>
<div class="fixed inset-x-0 min-h-[130px] opacity-65 pl-[24px] pr-[24px] bg-gradient-to-b from-neutral from-60% dark:from-neutral-800 to-transparent mix-blend-normal z-index-80"></div> <div
class="fixed inset-x-0 min-h-[130px] opacity-65 pl-[24px] pr-[24px] bg-gradient-to-b from-neutral from-60% dark:from-neutral-800 to-transparent mix-blend-normal z-index-80"></div>
<div class="fixed inset-x-0 pl-[24px] pr-[24px] z-index-100"> <div class="fixed inset-x-0 pl-[24px] pr-[24px] z-index-100">
<div id="menu-blur" class="absolute opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl shadow-2xl"></div> <div
id="menu-blur"
class="absolute opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl shadow-2xl"></div>
<div class="relative max-w-[64rem] ml-auto mr-auto"> <div class="relative max-w-[64rem] ml-auto mr-auto">
{{ partial "header/basic.html" . }} {{ partial "header/basic.html" . }}
</div> </div>
</div> </div>
{{ $backgroundBlur := resources.Get "js/background-blur.js" }} {{ $backgroundBlur := resources.Get "js/background-blur.js" }}
{{ $backgroundBlur = $backgroundBlur | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }} {{ $backgroundBlur = $backgroundBlur | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script type="text/javascript" src="{{ $backgroundBlur.RelPermalink }}" integrity="{{ $backgroundBlur.Data.Integrity }}" data-target-id="menu-blur"></script> <script
type="text/javascript"
src="{{ $backgroundBlur.RelPermalink }}"
integrity="{{ $backgroundBlur.Data.Integrity }}"
data-target-id="menu-blur"></script>

View File

@@ -1,10 +1,16 @@
<div class="min-h-[148px]"></div> <div class="min-h-[148px]"></div>
<div class="fixed inset-x-0 pl-[24px] pr-[24px] z-index-100"> <div class="fixed inset-x-0 pl-[24px] pr-[24px] z-index-100">
<div id="menu-blur" class="absolute opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl shadow-2xl"></div> <div
id="menu-blur"
class="absolute opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl shadow-2xl"></div>
<div class="relative max-w-[64rem] ml-auto mr-auto"> <div class="relative max-w-[64rem] ml-auto mr-auto">
{{ partial "header/basic.html" . }} {{ partial "header/basic.html" . }}
</div> </div>
</div> </div>
{{ $backgroundBlur := resources.Get "js/background-blur.js" }} {{ $backgroundBlur := resources.Get "js/background-blur.js" }}
{{ $backgroundBlur = $backgroundBlur | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }} {{ $backgroundBlur = $backgroundBlur | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script type="text/javascript" src="{{ $backgroundBlur.RelPermalink }}" integrity="{{ $backgroundBlur.Data.Integrity }}" data-target-id="menu-blur"></script> <script
type="text/javascript"
src="{{ $backgroundBlur.RelPermalink }}"
integrity="{{ $backgroundBlur.Data.Integrity }}"
data-target-id="menu-blur"></script>

View File

@@ -1,31 +1,39 @@
<li class="mt-1"> <li class="mt-1">
<a href="{{ .URL }}" class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400"> <a
{{ if .Pre }} href="{{ .URL }}"
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}> class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ partial "icon.html" .Pre }} {{ if .Pre }}
</span> <span {{ if and .Pre .Name }}class="mr-1"{{ end }}>
{{ end }} {{ partial "icon.html" .Pre }}
<p class="text-bg font-bg" title="{{ .Title }}"> </span>
{{ .Name | markdownify }} {{ end }}
</p> <p class="text-bg font-bg" title="{{ .Title }}">
<span> {{ .Name | markdownify }}
{{ partial "icon.html" "chevron-down" }} </p>
</span> <span>
</a> {{ partial "icon.html" "chevron-down" }}
</span>
</a>
</li> </li>
{{ range .Children }} {{ range .Children }}
<li class="mt-1"> <li class="mt-1">
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" <a
) }} target="_blank" {{ end }} class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400"> href="{{ .URL }}"
{{ if .Pre }} {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:"
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}> )
{{ partial "icon.html" .Pre }} }}
target="_blank"
{{ end }}
class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<span {{ if and .Pre .Name }}class="mr-1"{{ end }}>
{{ partial "icon.html" .Pre }}
</span> </span>
{{ end }} {{ end }}
<p class="text-sm font-small" title="{{ .Title }}"> <p class="text-sm font-small" title="{{ .Title }}">
{{ .Name | markdownify }} {{ .Name | markdownify }}
</p> </p>
</a> </a>
</li> </li>
{{ end }} {{ end }}
<li class="mb-2"></li> <li class="mb-2"></li>

View File

@@ -1,13 +1,19 @@
<li class="mt-1"> <li class="mt-1">
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" <a
) }} target="_blank" {{ end }} class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400"> href="{{ .URL }}"
{{ if .Pre }} {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:"
<div {{ if and .Pre .Name}} class="mr-2" {{ end }}> )
{{ partial "icon.html" .Pre }} }}
</div> target="_blank"
{{ end }} {{ end }}
<p class="text-bg font-bg" title="{{ .Title }}"> class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ .Name | markdownify }} {{ if .Pre }}
</p> <div {{ if and .Pre .Name }}class="mr-2"{{ end }}>
</a> {{ partial "icon.html" .Pre }}
</div>
{{ end }}
<p class="text-bg font-bg" title="{{ .Title }}">
{{ .Name | markdownify }}
</p>
</a>
</li> </li>

View File

@@ -1,4 +1,4 @@
{{ if .HasChildren }} {{ if .HasChildren }}
{{ partial "header/header-mobile-option-nested.html" . }} {{ partial "header/header-mobile-option-nested.html" . }}
{{ else }} {{ else }}
{{ partial "header/header-mobile-option-simple.html" . }} {{ partial "header/header-mobile-option-simple.html" . }}

View File

@@ -1,12 +1,19 @@
<div> <div>
<div class="cursor-pointer flex items-center nested-menu"> <div class="cursor-pointer flex items-center nested-menu">
{{ if .Pre }} {{ if .Pre }}
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}> <span {{ if and .Pre .Name }}class="mr-1"{{ end }}>
{{ partial "icon.html" .Pre }} {{ partial "icon.html" .Pre }}
</span> </span>
{{ end }} {{ end }}
<a {{ if .URL }} href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }} <a
target="_blank" {{ end }} {{ end }} class="text-base font-medium text-gray-500 hover:text-primary-600 dark:hover:text-primary-400" title="{{ .Title }}"> {{ if .URL }}
href="{{ .URL }}"
{{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}
target="_blank"
{{ end }}
{{ end }}
class="text-base font-medium text-gray-500 hover:text-primary-600 dark:hover:text-primary-400"
title="{{ .Title }}">
{{ .Name | markdownify }} {{ .Name | markdownify }}
</a> </a>
<span> <span>
@@ -17,17 +24,21 @@
<div class="pt-2 p-5 mt-2 rounded-xl backdrop-blur shadow-2xl"> <div class="pt-2 p-5 mt-2 rounded-xl backdrop-blur shadow-2xl">
<div class="flex flex-col space-y-3"> <div class="flex flex-col space-y-3">
{{ range .Children }} {{ range .Children }}
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }} <a
target="_blank" {{ end }} class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400"> href="{{ .URL }}"
{{ if .Pre }} {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}> target="_blank"
{{ partial "icon.html" .Pre }} {{ end }}
</span> class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ end }} {{ if .Pre }}
<p class="text-sm font-sm" title="{{ .Title }}"> <span {{ if and .Pre .Name }}class="mr-1"{{ end }}>
{{ .Name | markdownify }} {{ partial "icon.html" .Pre }}
</p> </span>
</a> {{ end }}
<p class="text-sm font-sm" title="{{ .Title }}">
{{ .Name | markdownify }}
</p>
</a>
{{ end }} {{ end }}
</div> </div>
</div> </div>

View File

@@ -1,11 +1,13 @@
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }} target="_blank" {{ <a
end }} class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400"> href="{{ .URL }}"
{{ if .Pre }} {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}target="_blank"{{ end }}
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}> class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ partial "icon.html" .Pre }} {{ if .Pre }}
<span {{ if and .Pre .Name }}class="mr-1"{{ end }}>
{{ partial "icon.html" .Pre }}
</span> </span>
{{ end }} {{ end }}
<p class="text-base font-medium" title="{{ .Title }}"> <p class="text-base font-medium" title="{{ .Title }}">
{{ .Name | markdownify }} {{ .Name | markdownify }}
</p> </p>
</a> </a>

View File

@@ -1,4 +1,4 @@
{{ if .HasChildren }} {{ if .HasChildren }}
{{ partial "header/header-option-nested.html" . }} {{ partial "header/header-option-nested.html" . }}
{{ else }} {{ else }}
{{ partial "header/header-option-simple.html" . }} {{ partial "header/header-option-simple.html" . }}

View File

@@ -6,28 +6,32 @@
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{ if and .Params.featureimage (not $featured) }} {{ if and .Params.featureimage (not $featured) }}
{{- $url:= .Params.featureimage -}} {{- $url:= .Params.featureimage -}}
{{ $featured = resources.GetRemote $url }} {{ $featured = resources.GetRemote $url }}
{{ end }} {{ end }}
{{- if not $featured }} {{- if not $featured }}
{{ with .Site.Params.defaultBackgroundImage }} {{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $featured = resources.GetRemote . }} {{ $featured = resources.GetRemote . }}
{{ else }} {{ else }}
{{ $featured = resources.Get . }} {{ $featured = resources.Get . }}
{{ end }}
{{ end }} {{ end }}
{{ end }}
{{ end -}} {{ end -}}
{{- with $featured -}} {{- with $featured -}}
{{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg")}} {{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg") }}
{{ with . }} {{ with . }}
<div class="w-full h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div> <div
{{ end }} class="w-full h-36 md:h-56 lg:h-72 single_hero_basic nozoom"
{{ else }} style="background-image:url({{ .RelPermalink }});"></div>
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
<div class="w-full h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }} {{ end }}
{{- end -}} {{ else }}
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
<div
class="w-full h-36 md:h-56 lg:h-72 single_hero_basic nozoom"
style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }}
{{- end -}}

View File

@@ -6,55 +6,71 @@
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{ if .Params.featureimage }} {{ if .Params.featureimage }}
{{- $url:= .Params.featureimage -}} {{- $url:= .Params.featureimage -}}
{{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}} {{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}}
{{ end }} {{ end }}
{{- if not $featured }} {{- if not $featured }}
{{ with .Site.Params.defaultBackgroundImage }} {{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $featured = resources.GetRemote . }} {{ $featured = resources.GetRemote . }}
{{ else }} {{ else }}
{{ $featured = resources.Get . }} {{ $featured = resources.Get . }}
{{ end }}
{{ end }} {{ end }}
{{ end }}
{{ end -}} {{ end -}}
{{ $caption := "" }} {{ $caption := "" }}
{{ if .Params.featureimagecaption }} {{ if .Params.featureimagecaption }}
{{- $caption = .Params.featureimagecaption -}} {{- $caption = .Params.featureimagecaption -}}
{{ end }} {{ end }}
{{- $alt := .Page.Title -}} {{- $alt := .Page.Title -}}
{{- with .Page.Params.alt }}{{ $alt = . }}{{ end -}} {{- with .Page.Params.alt }}{{ $alt = . }}{{ end -}}
{{- with $featured -}} {{- with $featured -}}
{{ if strings.HasSuffix $featured ".svg" }} {{ if strings.HasSuffix $featured ".svg" }}
{{ with . }} {{ with . }}
<figure> <figure>
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" src="{{ .RelPermalink }}"> <img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" src="{{ .RelPermalink }}">
{{ if $caption }} {{ if $caption }}
<figcaption class="text-sm text-neutral-700 dark:text-neutral-400 hover:underline text-center"> {{ $caption | markdownify }} </figcaption> <figcaption class="text-sm text-neutral-700 dark:text-neutral-400 hover:underline text-center">
{{end}} {{ $caption | markdownify }}
</figure> </figcaption>
{{ end }}
{{ else if $disableImageOptimization }}
{{ with . }}
<figure>
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}">
{{ if $caption }}
<figcaption class="text-sm text-neutral-700 dark:text-neutral-400 hover:underline text-center"> {{ $caption | markdownify }} </figcaption>
{{end}}
</figure>
{{ end }}
{{ else }}
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
<figure>
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}">
{{ if $caption }}
<figcaption class="text-sm text-neutral-700 dark:text-neutral-400 hover:underline text-center"> {{ $caption | markdownify }} </figcaption>
{{end}}
</figure>
{{ end }} {{ end }}
</figure>
{{ end }} {{ end }}
{{- end -}} {{ else if $disableImageOptimization }}
{{ with . }}
<figure>
<img
class="w-full rounded-lg single_hero_round nozoom"
alt="{{ $alt }}"
width="{{ .Width }}"
height="{{ .Height }}"
src="{{ .RelPermalink }}">
{{ if $caption }}
<figcaption class="text-sm text-neutral-700 dark:text-neutral-400 hover:underline text-center">
{{ $caption | markdownify }}
</figcaption>
{{ end }}
</figure>
{{ end }}
{{ else }}
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
<figure>
<img
class="w-full rounded-lg single_hero_round nozoom"
alt="{{ $alt }}"
width="{{ .Width }}"
height="{{ .Height }}"
src="{{ .RelPermalink }}">
{{ if $caption }}
<figcaption class="text-sm text-neutral-700 dark:text-neutral-400 hover:underline text-center">
{{ $caption | markdownify }}
</figcaption>
{{ end }}
</figure>
{{ end }}
{{ end }}
{{- end -}}

View File

@@ -4,13 +4,13 @@
{{- $background := $images.GetMatch "*background*" -}} {{- $background := $images.GetMatch "*background*" -}}
{{- if not $background }} {{- if not $background }}
{{ with .Site.Params.defaultBackgroundImage }} {{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $background = resources.GetRemote . }} {{ $background = resources.GetRemote . }}
{{ else }} {{ else }}
{{ $background = resources.Get . }} {{ $background = resources.Get . }}
{{ end }}
{{ end }} {{ end }}
{{ end }}
{{ end -}} {{ end -}}
{{- if not $background }}{{ $background = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} {{- if not $background }}{{ $background = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
@@ -18,69 +18,81 @@
{{- $featured := $images.GetMatch "*feature*" -}} {{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{ if .Params.featureimage }} {{ if .Params.featureimage }}
{{- $url:= .Params.featureimage -}} {{- $url:= .Params.featureimage -}}
{{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}} {{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}}
{{ end }} {{ end }}
{{- if not $featured }}{{ $featured = $images.GetMatch "*background*" }}{{ end -}} {{- if not $featured }}{{ $featured = $images.GetMatch "*background*" }}{{ end -}}
{{- if not $featured }} {{- if not $featured }}
{{ with .Site.Params.defaultFeaturedImage }} {{ with .Site.Params.defaultFeaturedImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $featured = resources.GetRemote . }} {{ $featured = resources.GetRemote . }}
{{ else }} {{ else }}
{{ $featured = resources.Get . }} {{ $featured = resources.Get . }}
{{ end }}
{{ end }} {{ end }}
{{ end }}
{{ end -}} {{ end -}}
{{ $isParentList := eq (.Scratch.Get "scope") "list" }} {{ $isParentList := eq (.Scratch.Get "scope") "list" }}
{{ $shouldBlur := $.Params.layoutBackgroundBlur | default (or {{ $shouldBlur := $.Params.layoutBackgroundBlur | default (or
(and ($.Site.Params.article.layoutBackgroundBlur | default true) (not $isParentList)) (and ($.Site.Params.article.layoutBackgroundBlur | default true) (not $isParentList))
(and ($.Site.Params.list.layoutBackgroundBlur | default true) ($isParentList)) (and ($.Site.Params.list.layoutBackgroundBlur | default true) ($isParentList))
) }} )
}}
{{- with $featured -}} {{- with $featured -}}
{{ if or $disableImageOptimization (strings.HasSuffix . ".svg")}} {{ if or $disableImageOptimization (strings.HasSuffix . ".svg") }}
{{ with . }} {{ with . }}
<div class="w-full rounded-md h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div> <div
{{ end }} class="w-full rounded-md h-36 md:h-56 lg:h-72 single_hero_basic nozoom"
{{ else }} style="background-image:url({{ .RelPermalink }});"></div>
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }} {{ end }}
<div class="w-full rounded-md h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div> {{ else }}
{{ end }} {{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
{{ end }} <div
class="w-full rounded-md h-36 md:h-56 lg:h-72 single_hero_basic nozoom"
style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }}
{{- end -}} {{- end -}}
{{- with $background -}} {{- with $background -}}
{{ if or $disableImageOptimization (strings.HasSuffix . ".svg")}} {{ if or $disableImageOptimization (strings.HasSuffix . ".svg") }}
{{ with . }} {{ with . }}
<div class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom" <div
style="background-image:url({{ .RelPermalink }});"> class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom"
<div class="absolute inset-0 bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal"> style="background-image:url({{ .RelPermalink }});">
</div> <div
<div class="absolute inset-0 bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal"></div>
class="absolute inset-0 opacity-30 dark:opacity-60 bg-gradient-to-t from-neutral dark:from-neutral-800 to-neutral dark:to-neutral-800 mix-blend-normal"> <div
</div> class="absolute inset-0 opacity-30 dark:opacity-60 bg-gradient-to-t from-neutral dark:from-neutral-800 to-neutral dark:to-neutral-800 mix-blend-normal"></div>
</div>{{ end }} </div>
{{ else }} {{ end }}
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }} {{ else }}
<div class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom" {{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
style="background-image:url({{ .RelPermalink }});"> <div
<div class="absolute inset-0 bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal"> class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom"
</div> style="background-image:url({{ .RelPermalink }});">
<div <div
class="absolute inset-0 opacity-30 dark:opacity-60 bg-gradient-to-t from-neutral dark:from-neutral-800 to-neutral dark:to-neutral-800 mix-blend-normal"> class="absolute inset-0 bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal"></div>
</div> <div
</div>{{ end }} class="absolute inset-0 opacity-30 dark:opacity-60 bg-gradient-to-t from-neutral dark:from-neutral-800 to-neutral dark:to-neutral-800 mix-blend-normal"></div>
{{ end }} </div>
{{ end }}
{{ end }}
{{- end -}} {{- end -}}
{{ if $shouldBlur | default false }} {{ if $shouldBlur | default false }}
<div id="background-blur" class="fixed opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl"></div> <div
{{ $backgroundBlur := resources.Get "js/background-blur.js" }} id="background-blur"
{{ $backgroundBlur = $backgroundBlur | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }} class="fixed opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl"></div>
<script type="text/javascript" src="{{ $backgroundBlur.RelPermalink }}" integrity="{{ $backgroundBlur.Data.Integrity }}" data-target-id="background-blur"></script> {{ $backgroundBlur := resources.Get "js/background-blur.js" }}
{{ $backgroundBlur = $backgroundBlur | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
type="text/javascript"
src="{{ $backgroundBlur.RelPermalink }}"
integrity="{{ $backgroundBlur.Data.Integrity }}"
data-target-id="background-blur"></script>
{{ end }} {{ end }}

View File

@@ -1,84 +1,102 @@
{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }} {{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
<article class="max-w-full prose dark:prose-invert"> <article class="max-w-full prose dark:prose-invert">
<div class="relative"> <div class="relative">
<div class="absolute inset-x-0 bottom-0 h-1/2 bg-gray-100"></div> <div class="absolute inset-x-0 bottom-0 h-1/2 bg-gray-100"></div>
<div class="mx-auto max-w-7xl p-0"> <div class="mx-auto max-w-7xl p-0">
<div class="relative sm:overflow-hidden"> <div class="relative sm:overflow-hidden">
<div class="fixed inset-x-0 top-0 z-index-[-10]"> <div class="fixed inset-x-0 top-0 z-index-[-10]">
{{ $homepageImage := "" }} {{ $homepageImage := "" }}
{{ with .Site.Params.defaultBackgroundImage }} {{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }} {{ $homepageImage = resources.GetRemote . }}
{{ else }} {{ else }}
{{ $homepageImage = resources.Get . }} {{ $homepageImage = resources.Get . }}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ with .Site.Params.homepage.homepageImage }} {{ with .Site.Params.homepage.homepageImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }} {{ $homepageImage = resources.GetRemote . }}
{{ else }} {{ else }}
{{ $homepageImage = resources.Get . }} {{ $homepageImage = resources.Get . }}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ if $homepageImage }} {{ if $homepageImage }}
<img class="w-full h-[1000px] object-cover m-0 nozoom margin-0" src="{{ $homepageImage.RelPermalink }}" role="presentation"> <img
<div class="w-full h-[1000px] object-cover m-0 nozoom margin-0"
class="absolute inset-0 h-[1000px] bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal"> src="{{ $homepageImage.RelPermalink }}"
</div> role="presentation">
<div <div
class="opacity-60 absolute inset-0 h-[1000px] bg-gradient-to-t from-neutral dark:from-neutral-800 to-neutral-100 dark:to-neutral-800 mix-blend-normal"> class="absolute inset-0 h-[1000px] bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal"></div>
</div> <div
{{ end }} class="opacity-60 absolute inset-0 h-[1000px] bg-gradient-to-t from-neutral dark:from-neutral-800 to-neutral-100 dark:to-neutral-800 mix-blend-normal"></div>
</div> {{ end }}
<div class="relative px-1 py-1 flex flex-col items-center justify-center text-center">
{{ with .Site.Params.Author.image }}
{{ $authorImage := "" }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $authorImage = resources.GetRemote . }}
{{ else }}
{{ $authorImage = resources.Get . }}
{{ end }}
{{ if $authorImage }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
{{ end }}
<img class="mb-2 rounded-full h-36 w-36" width="144" height="144"
alt="{{ $.Site.Params.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
{{ end }}
{{ end }}
<h1 class="mb-2 text-4xl font-extrabold text-neutral-800 dark:text-neutral-200">
{{ .Site.Params.Author.name | default .Site.Title }}
</h1>
{{ with .Site.Params.Author.headline }}
<h2 class="mt-0 mb-0 text-xl text-neutral-800 dark:text-neutral-300">
{{ . | markdownify }}
</h2>
{{ end }}
<div class="mt-3 mb-10 text-2xl">
{{ with .Site.Params.Author.links }}
<div class="flex flex-wrap">
{{ range $links := . }}
{{ range $name, $url := $links }}
<a class="px-1 hover:text-primary-400 text-primary-800 dark:text-primary-200" href="{{ $url }}" target="_blank"
aria-label="{{ $name | title }}" rel="me noopener noreferrer">{{ partial
"icon.html" $name }}</a>
{{ end }}
{{ end }}
</div>
{{ end }}
</div>
<section class="prose dark:prose-invert">{{ .Content }}</section>
</div>
</div>
</div> </div>
<div class="relative px-1 py-1 flex flex-col items-center justify-center text-center">
{{ with .Site.Params.Author.image }}
{{ $authorImage := "" }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $authorImage = resources.GetRemote . }}
{{ else }}
{{ $authorImage = resources.Get . }}
{{ end }}
{{ if $authorImage }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
{{ end }}
<img
class="mb-2 rounded-full h-36 w-36"
width="144"
height="144"
alt="{{ $.Site.Params.Author.name | default " Author" }}"
src="{{ $authorImage.RelPermalink }}">
{{ end }}
{{ end }}
<h1 class="mb-2 text-4xl font-extrabold text-neutral-800 dark:text-neutral-200">
{{ .Site.Params.Author.name | default .Site.Title }}
</h1>
{{ with .Site.Params.Author.headline }}
<h2 class="mt-0 mb-0 text-xl text-neutral-800 dark:text-neutral-300">
{{ . | markdownify }}
</h2>
{{ end }}
<div class="mt-3 mb-10 text-2xl">
{{ with .Site.Params.Author.links }}
<div class="flex flex-wrap">
{{ range $links := . }}
{{ range $name, $url := $links }}
<a
class="px-1 hover:text-primary-400 text-primary-800 dark:text-primary-200"
href="{{ $url }}"
target="_blank"
aria-label="{{ $name | title }}"
rel="me noopener noreferrer"
>{{ partial
"icon.html" $name
}}</a
>
{{ end }}
{{ end }}
</div>
{{ end }}
</div>
<section class="prose dark:prose-invert">{{ .Content }}</section>
</div>
</div>
</div> </div>
</div>
</article> </article>
<section> <section>
{{ partial "recent-articles/main.html" . }} {{ partial "recent-articles/main.html" . }}
</section> </section>
{{ if .Site.Params.homepage.layoutBackgroundBlur | default false }} {{ if .Site.Params.homepage.layoutBackgroundBlur | default false }}
<div id="background-blur" class="fixed opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl"></div> <div
{{ $backgroundBlur := resources.Get "js/background-blur.js" }} id="background-blur"
{{ $backgroundBlur = $backgroundBlur | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }} class="fixed opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl"></div>
<script type="text/javascript" src="{{ $backgroundBlur.RelPermalink }}" integrity="{{ $backgroundBlur.Data.Integrity }}" data-target-id="background-blur"></script> {{ $backgroundBlur := resources.Get "js/background-blur.js" }}
{{ $backgroundBlur = $backgroundBlur | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
type="text/javascript"
src="{{ $backgroundBlur.RelPermalink }}"
integrity="{{ $backgroundBlur.Data.Integrity }}"
data-target-id="background-blur"></script>
{{ end }} {{ end }}

View File

@@ -1,43 +1,44 @@
<div class="relative pt-16 pb-32"> <div class="relative pt-16 pb-32">
<div aria-hidden="true" class="absolute inset-x-0 top-0 h-48 bg-gradient-to-b from-gray-100"></div> <div aria-hidden="true" class="absolute inset-x-0 top-0 h-48 bg-gradient-to-b from-gray-100"></div>
<div class="relative"> <div class="relative">
<div class="lg:mx-auto lg:grid lg:max-w-7xl lg:grid-flow-col-dense lg:grid-cols-2 lg:gap-24 lg:px-8"> <div class="lg:mx-auto lg:grid lg:max-w-7xl lg:grid-flow-col-dense lg:grid-cols-2 lg:gap-24 lg:px-8">
<div class="mx-auto max-w-xl px-4 sm:px-6 lg:mx-0 lg:max-w-none lg:py-16 lg:px-0"> <div class="mx-auto max-w-xl px-4 sm:px-6 lg:mx-0 lg:max-w-none lg:py-16 lg:px-0">
<article class="max-w-full prose dark:prose-invert"> <article class="max-w-full prose dark:prose-invert">
{{ with .Title }} {{ with .Title }}
<header> <header>
<h1>{{ . | emojify }}</h1> <h1>{{ . | emojify }}</h1>
</header> </header>
{{ end }} {{ end }}
<section>{{ .Content }}</section> <section>{{ .Content }}</section>
</article> </article>
</div> </div>
<div class="mt-6 sm:mt-16 lg:mt-0 mx-auto max-w-xl px-4 sm:px-6 lg:mx-0 lg:max-w-none lg:py-16 lg:px-0"> <div class="mt-6 sm:mt-16 lg:mt-0 mx-auto max-w-xl px-4 sm:px-6 lg:mx-0 lg:max-w-none lg:py-16 lg:px-0">
<div class="-mr-48 md:-mr-16 lg:relative lg:m-0 lg:h-full lg:px-0 w-full"> <div class="-mr-48 md:-mr-16 lg:relative lg:m-0 lg:h-full lg:px-0 w-full">
{{ $homepageImage := "" }} {{ $homepageImage := "" }}
{{ with .Site.Params.defaultBackgroundImage }} {{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }} {{ $homepageImage = resources.GetRemote . }}
{{ else }} {{ else }}
{{ $homepageImage = resources.Get . }} {{ $homepageImage = resources.Get . }}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ with .Site.Params.homepage.homepageImage }} {{ with .Site.Params.homepage.homepageImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }} {{ $homepageImage = resources.GetRemote . }}
{{ else }} {{ else }}
{{ $homepageImage = resources.Get . }} {{ $homepageImage = resources.Get . }}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ if $homepageImage }} {{ if $homepageImage }}
<img class="w-full rounded-xl shadow-xl lg:absolute lg:left-0 lg:h-full lg:w-auto lg:max-w-none" <img
src="{{ $homepageImage.RelPermalink }}"> class="w-full rounded-xl shadow-xl lg:absolute lg:left-0 lg:h-full lg:w-auto lg:max-w-none"
{{ end }} src="{{ $homepageImage.RelPermalink }}">
</div> {{ end }}
</div>
</div> </div>
</div>
</div> </div>
</div>
</div> </div>
<section> <section>
{{ partial "recent-articles/main.html" . }} {{ partial "recent-articles/main.html" . }}
</section> </section>

View File

@@ -1,99 +1,116 @@
{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }} {{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
{{ $disableHeroImageFilter := .Site.Params.homepage.disableHeroImageFilter | default false }} {{ $disableHeroImageFilter := .Site.Params.homepage.disableHeroImageFilter | default false }}
<article class="max-w-full prose dark:prose-invert"> <article class="max-w-full prose dark:prose-invert">
<div class="relative"> <div class="relative">
<div class="absolute inset-x-0 bottom-0 h-1/2 bg-gray-100"></div> <div class="absolute inset-x-0 bottom-0 h-1/2 bg-gray-100"></div>
<div class="mx-auto max-w-7xl p-0"> <div class="mx-auto max-w-7xl p-0">
<div class="relative shadow-xl sm:overflow-hidden rounded-2xl"> <div class="relative shadow-xl sm:overflow-hidden rounded-2xl">
<div class="absolute inset-0"> <div class="absolute inset-0">
{{ $homepageImage := "" }} {{ $homepageImage := "" }}
{{ with .Site.Params.defaultBackgroundImage }} {{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }} {{ $homepageImage = resources.GetRemote . }}
{{ else }} {{ else }}
{{ $homepageImage = resources.Get . }} {{ $homepageImage = resources.Get . }}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ with .Site.Params.homepage.homepageImage }} {{ with .Site.Params.homepage.homepageImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }} {{ $homepageImage = resources.GetRemote . }}
{{ else }} {{ else }}
{{ $homepageImage = resources.Get . }} {{ $homepageImage = resources.Get . }}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ if $homepageImage }} {{ if $homepageImage }}
<img class="h-full w-full object-cover m-0 nozoom margin-0" src="{{ $homepageImage.RelPermalink }}"> <img class="h-full w-full object-cover m-0 nozoom margin-0" src="{{ $homepageImage.RelPermalink }}">
{{ if not $disableHeroImageFilter }} {{ if not $disableHeroImageFilter }}
<div <div
class="absolute inset-0 bg-gradient-to-r from-primary-500 to-secondary-600 dark:from-primary-600 dark:to-secondary-800 mix-blend-multiply"> class="absolute inset-0 bg-gradient-to-r from-primary-500 to-secondary-600 dark:from-primary-600 dark:to-secondary-800 mix-blend-multiply"></div>
</div> {{ else }}
{{ else }} <div
<div class="absolute inset-0 from-primary-500 to-secondary-600 dark:from-primary-600 dark:to-secondary-800 mix-blend-multiply"></div>
class="absolute inset-0 from-primary-500 to-secondary-600 dark:from-primary-600 dark:to-secondary-800 mix-blend-multiply"> {{ end }}
</div> {{ end }}
{{ end }}
{{ end }}
</div>
<div class="relative px-4 py-16 sm:px-6 sm:py-24 lg:py-32 lg:px-8 flex flex-col items-center justify-center text-center">
{{ with .Site.Params.Author.image }}
{{ $authorImage := "" }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $authorImage = resources.GetRemote . }}
{{ else }}
{{ $authorImage = resources.Get . }}
{{ end }}
{{ if $authorImage }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
{{ end }}
<img class="mb-2 rounded-full h-36 w-36" width="144" height="144"
alt="{{ $.Site.Params.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
{{ end }}
{{ end }}
{{ if not $disableHeroImageFilter }}
<h1 class="mb-2 text-4xl font-extrabold text-neutral-200">
{{ .Site.Params.Author.name | default .Site.Title }}
</h1>
{{ with .Site.Params.Author.headline }}
<h2 class="mt-0 mb-0 text-xl text-neutral-300">
{{ . | markdownify }}
</h2>
{{ end }}
{{ else }}
<h1 class="mb-2 text-4xl font-extrabold text-neutral-800 dark:text-neutral-200">
{{ .Site.Params.Author.name | default .Site.Title }}
</h1>
{{ with .Site.Params.Author.headline }}
<h2 class="mt-0 mb-0 text-xl text-neutral-800 dark:text-neutral-300">
{{ . | markdownify }}
</h2>
{{ end }}
{{ end }}
<div class="mt-3 mb-10 text-2xl">
{{ with .Site.Params.Author.links }}
<div class="flex flex-wrap">
{{ range $links := . }}
{{ range $name, $url := $links }}
{{ if not $disableHeroImageFilter }}
<a class="px-1 hover:text-primary-400 text-primary-300" href="{{ $url }}" target="_blank"
aria-label="{{ $name | title }}" rel="me noopener noreferrer">{{ partial
"icon.html" $name }}</a>
{{ else }}
<a class="px-1 hover:text-primary-400 text-primary-800 dark:text-primary-200" href="{{ $url }}" target="_blank"
aria-label="{{ $name | title }}" rel="me noopener noreferrer">{{ partial
"icon.html" $name }}</a>
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}
</div>
<section class="prose prose-invert">{{ .Content }}</section>
</div>
</div>
</div> </div>
<div
class="relative px-4 py-16 sm:px-6 sm:py-24 lg:py-32 lg:px-8 flex flex-col items-center justify-center text-center">
{{ with .Site.Params.Author.image }}
{{ $authorImage := "" }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $authorImage = resources.GetRemote . }}
{{ else }}
{{ $authorImage = resources.Get . }}
{{ end }}
{{ if $authorImage }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
{{ end }}
<img
class="mb-2 rounded-full h-36 w-36"
width="144"
height="144"
alt="{{ $.Site.Params.Author.name | default " Author" }}"
src="{{ $authorImage.RelPermalink }}">
{{ end }}
{{ end }}
{{ if not $disableHeroImageFilter }}
<h1 class="mb-2 text-4xl font-extrabold text-neutral-200">
{{ .Site.Params.Author.name | default .Site.Title }}
</h1>
{{ with .Site.Params.Author.headline }}
<h2 class="mt-0 mb-0 text-xl text-neutral-300">
{{ . | markdownify }}
</h2>
{{ end }}
{{ else }}
<h1 class="mb-2 text-4xl font-extrabold text-neutral-800 dark:text-neutral-200">
{{ .Site.Params.Author.name | default .Site.Title }}
</h1>
{{ with .Site.Params.Author.headline }}
<h2 class="mt-0 mb-0 text-xl text-neutral-800 dark:text-neutral-300">
{{ . | markdownify }}
</h2>
{{ end }}
{{ end }}
<div class="mt-3 mb-10 text-2xl">
{{ with .Site.Params.Author.links }}
<div class="flex flex-wrap">
{{ range $links := . }}
{{ range $name, $url := $links }}
{{ if not $disableHeroImageFilter }}
<a
class="px-1 hover:text-primary-400 text-primary-300"
href="{{ $url }}"
target="_blank"
aria-label="{{ $name | title }}"
rel="me noopener noreferrer"
>{{ partial
"icon.html" $name
}}</a
>
{{ else }}
<a
class="px-1 hover:text-primary-400 text-primary-800 dark:text-primary-200"
href="{{ $url }}"
target="_blank"
aria-label="{{ $name | title }}"
rel="me noopener noreferrer"
>{{ partial
"icon.html" $name
}}</a
>
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}
</div>
<section class="prose prose-invert">{{ .Content }}</section>
</div>
</div>
</div> </div>
</div>
</article> </article>
<section> <section>
{{ partial "recent-articles/main.html" . }} {{ partial "recent-articles/main.html" . }}
</section> </section>

View File

@@ -1,5 +1,6 @@
{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }} {{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
<article class="{{ if not .Site.Params.homepage.showRecent }} <article
class="{{ if not .Site.Params.homepage.showRecent }}
h-full h-full
{{ end }} flex flex-col items-center justify-center text-center"> {{ end }} flex flex-col items-center justify-center text-center">
<header class="relative px-1 py-1 flex flex-col items-center mb-3"> <header class="relative px-1 py-1 flex flex-col items-center mb-3">
@@ -14,17 +15,21 @@
{{ if not $disableImageOptimization }} {{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }} {{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
{{ end }} {{ end }}
<img class="mb-2 rounded-full h-36 w-36" width="144" height="144" alt="{{ $.Site.Params.Author.name | default " Author" }}" <img
src="{{ $authorImage.RelPermalink }}" /> class="mb-2 rounded-full h-36 w-36"
width="144"
height="144"
alt="{{ $.Site.Params.Author.name | default " Author" }}"
src="{{ $authorImage.RelPermalink }}">
{{ end }} {{ end }}
{{ end }} {{ end }}
<h1 class="text-4xl font-extrabold"> <h1 class="text-4xl font-extrabold">
{{ .Site.Params.Author.name | default .Site.Title }} {{ .Site.Params.Author.name | default .Site.Title }}
</h1> </h1>
{{ with .Site.Params.Author.headline }} {{ with .Site.Params.Author.headline }}
<h2 class="text-xl text-neutral-500 dark:text-neutral-400"> <h2 class="text-xl text-neutral-500 dark:text-neutral-400">
{{ . | markdownify }} {{ . | markdownify }}
</h2> </h2>
{{ end }} {{ end }}
<div class="mt-1 text-2xl"> <div class="mt-1 text-2xl">
{{ partialCached "author-links.html" . }} {{ partialCached "author-links.html" . }}

View File

@@ -8,15 +8,18 @@
{{ $translations := .AllTranslations }} {{ $translations := .AllTranslations }}
{{ with .File }} {{ with .File }}
{{ $path := .Path }} {{ $path := .Path }}
{{range $translations}} {{ range $translations }}
{{ $lang := print "." .Lang ".md" }} {{ $lang := print "." .Lang ".md" }}
{{ $path = replace $path $lang ".md" }} {{ $path = replace $path $lang ".md" }}
{{end}} {{ end }}
{{ $id = delimit (slice "likes_" $path) "" }} {{ $id = delimit (slice "likes_" $path) "" }}
{{ end }} {{ end }}
{{ end }} {{ end }}
<span id="{{ $id }}" <span
id="{{ $id }}"
class="animate-pulse inline-block text-transparent max-h-3 rounded-full mt-[-2px] align-middle bg-neutral-300 dark:bg-neutral-400" class="animate-pulse inline-block text-transparent max-h-3 rounded-full mt-[-2px] align-middle bg-neutral-300 dark:bg-neutral-400"
title="likes">loading</span> title="likes"
>loading</span
>
<span class="inline-block align-text-bottom">{{ partial "icon.html" "heart" }}</span> <span class="inline-block align-text-bottom">{{ partial "icon.html" "heart" }}</span>
</span> </span>

View File

@@ -1,10 +1,15 @@
<span> <span>
<button id="button_likes" <button
class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400" id="button_likes"
onclick="process_article()"> class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400"
<span id="button_likes_heart" class="inline-block align-text-bottom hidden">{{ partial "icon.html" "heart" }} </span> onclick="process_article()">
<span id="button_likes_emtpty_heart" class="inline-block align-text-bottom">{{ partial "icon.html" "heart-empty" }}</span> <span id="button_likes_heart" class="inline-block align-text-bottom hidden"
<span id="button_likes_text">&nbsp;Like</span> >{{ partial "icon.html" "heart" }}
</button> </span>
<span id="button_likes_emtpty_heart" class="inline-block align-text-bottom"
>{{ partial "icon.html" "heart-empty" }}</span
>
<span id="button_likes_text">&nbsp;Like</span>
</button>
</span> </span>
{{- /* Trim EOF */ -}} {{- /* Trim EOF */ -}}

View File

@@ -8,13 +8,18 @@
{{ $translations := .AllTranslations }} {{ $translations := .AllTranslations }}
{{ with .File }} {{ with .File }}
{{ $path := .Path }} {{ $path := .Path }}
{{range $translations}} {{ range $translations }}
{{ $lang := print "." .Lang ".md" }} {{ $lang := print "." .Lang ".md" }}
{{ $path = replace $path $lang ".md" }} {{ $path = replace $path $lang ".md" }}
{{end}} {{ end }}
{{ $id = delimit (slice "views_" $path) "" }} {{ $id = delimit (slice "views_" $path) "" }}
{{ end }} {{ end }}
{{ end }} {{ end }}
<span id="{{ $id }}" class="animate-pulse inline-block text-transparent max-h-3 rounded-full mt-[-2px] align-middle bg-neutral-300 dark:bg-neutral-400" title="views">loading</span> <span
id="{{ $id }}"
class="animate-pulse inline-block text-transparent max-h-3 rounded-full mt-[-2px] align-middle bg-neutral-300 dark:bg-neutral-400"
title="views"
>loading</span
>
<span class="inline-block align-text-bottom">{{ partial "icon.html" "eye" }}</span> <span class="inline-block align-text-bottom">{{ partial "icon.html" "eye" }}</span>
</span> </span>

View File

@@ -1,14 +1,19 @@
{{ $jsZenMode := resources.Get "js/zen-mode.js" }} {{ $jsZenMode := resources.Get "js/zen-mode.js" }}
{{ $jsZenMode = $jsZenMode | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }} {{ $jsZenMode = $jsZenMode | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script type="text/javascript" src="{{ $jsZenMode.RelPermalink }}" integrity="{{ $jsZenMode.Data.Integrity }}"></script>
<script
type="text/javascript"
src="{{ $jsZenMode.RelPermalink }}"
integrity="{{ $jsZenMode.Data.Integrity }}"></script>
<span class="mb-[2px]"> <span class="mb-[2px]">
<span id="zen-mode-button" <span
class="text-lg hover:text-primary-500" id="zen-mode-button"
title="{{ i18n "article.zen_mode_title.enable" }}" class="text-lg hover:text-primary-500"
data-title-i18n-disable="{{ i18n "article.zen_mode_title.enable" }}" title="{{ i18n "article.zen_mode_title.enable" }}"
data-title-i18n-enable="{{ i18n "article.zen_mode_title.disable" }}"> data-title-i18n-disable="{{ i18n "article.zen_mode_title.enable" }}"
<span class="inline-block align-text-bottom">{{ partial "icon.html" "expand" }}</span> data-title-i18n-enable="{{ i18n "article.zen_mode_title.disable" }}">
</span> <span class="inline-block align-text-bottom">{{ partial "icon.html" "expand" }}</span>
</span> </span>
</span>

View File

@@ -2,13 +2,14 @@
<ul class="flex flex-row mt-8 justify-center"> <ul class="flex flex-row mt-8 justify-center">
{{- .Scratch.Set "paginator.ellipsed" false -}} {{- .Scratch.Set "paginator.ellipsed" false -}}
{{ if $.Paginator.HasPrev }} {{ if $.Paginator.HasPrev }}
<li> <li>
<a <a
href="{{ $.Paginator.Prev.URL }}" href="{{ $.Paginator.Prev.URL }}"
class="mx-1 block min-w-[1.8rem] rounded text-center hover:bg-primary-600 hover:text-neutral" class="mx-1 block min-w-[1.8rem] rounded text-center hover:bg-primary-600 hover:text-neutral"
rel="prev" rel="prev"
>&larr;</a> >&larr;</a
</li> >
</li>
{{ end }} {{ end }}
{{- range $.Paginator.Pagers -}} {{- range $.Paginator.Pagers -}}
{{- $right := sub .TotalPages .PageNumber -}} {{- $right := sub .TotalPages .PageNumber -}}
@@ -24,12 +25,13 @@
{{- if $showNumber -}} {{- if $showNumber -}}
<li> <li>
<a <a
href="{{ .URL }}" href="{{ .URL }}"
class="{{ if eq . $.Paginator }} class="{{ if eq . $.Paginator }}
bg-primary-200 dark:bg-primary-400 dark:text-neutral-800 bg-primary-200 dark:bg-primary-400 dark:text-neutral-800
{{ end }} mx-1 block min-w-[1.8rem] rounded text-center hover:bg-primary-600 hover:text-neutral" {{ end }} mx-1 block min-w-[1.8rem] rounded text-center hover:bg-primary-600 hover:text-neutral"
>{{ .PageNumber }}</a> >{{ .PageNumber }}</a
</li> >
</li>
{{- else if ($.Scratch.Get "paginator.shouldEllipse") -}} {{- else if ($.Scratch.Get "paginator.shouldEllipse") -}}
<li class="page-item "> <li class="page-item ">
<span class="page-link" aria-hidden="true">&hellip;</span> <span class="page-link" aria-hidden="true">&hellip;</span>
@@ -37,13 +39,14 @@
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{ if $.Paginator.HasNext }} {{ if $.Paginator.HasNext }}
<li> <li>
<a <a
href="{{ $.Paginator.Next.URL }}" href="{{ $.Paginator.Next.URL }}"
class="mx-1 block min-w-[1.8rem] rounded text-center hover:bg-primary-600 hover:text-neutral" class="mx-1 block min-w-[1.8rem] rounded text-center hover:bg-primary-600 hover:text-neutral"
rel="next" rel="next"
>&rarr;</a> >&rarr;</a
</li> >
</li>
{{ end }} {{ end }}
</ul> </ul>
{{- end -}} {{- end -}}

View File

@@ -1,12 +1,13 @@
{{ $recentArticles := 5 }} {{ $recentArticles := 5 }}
{{ $recentArticles = .Site.Params.homepage.showRecentItems }} {{ $recentArticles = .Site.Params.homepage.showRecentItems }}
<div class="relative w-screen max-w-[1600px] px-[30px] center-relative-left"> <div class="relative w-screen max-w-[1600px] px-[30px] center-relative-left">
<section <section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
{{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in" {{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in"
.Site.Params.mainSections)).Pages }} .Site.Params.mainSections)).Pages
{{ partial "article-link/card.html" . }} }}
{{ partial "article-link/card.html" . }}
{{ end }} {{ end }}
</section> </section>
</div> </div>

View File

@@ -1,9 +1,11 @@
{{ $recentArticles := 5 }} {{ $recentArticles := 5 }}
{{ $recentArticles = .Site.Params.homepage.showRecentItems }} {{ $recentArticles = .Site.Params.homepage.showRecentItems }}
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3"> <section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
{{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in" {{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in"
.Site.Params.mainSections)).Pages }} .Site.Params.mainSections)).Pages
{{ partial "article-link/card.html" . }} }}
{{ partial "article-link/card.html" . }}
{{ end }} {{ end }}
</section> </section>

Some files were not shown because too many files have changed in this diff Show More