Merge remote-tracking branch 'upstream/dev' into fix/772/set-to-top-elem-on-scrollable-height

This commit is contained in:
Wen Junhua
2024-04-30 22:35:04 +08:00
51 changed files with 1422 additions and 280 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ jobs:
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
uses: peaceiris/actions-hugo@v3
with:
hugo-version: "latest"
extended: true
@@ -29,7 +29,7 @@ jobs:
run: hugo --minify --themesDir ../.. --buildDrafts --baseURL https://jpanther.github.io/congo/
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.ref == 'refs/heads/stable' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
+2 -2
View File
@@ -15,9 +15,9 @@ jobs:
days-before-stale: 120
days-before-close: 30
stale-issue-label: "stale"
exempt-issue-labels: "wip"
exempt-issue-labels: "wip,help wanted,dependencies"
stale-pr-label: "stale"
exempt-pr-labels: "wip"
exempt-pr-labels: "wip,help wanted,dependencies"
stale-issue-message: >
This issue has been automatically marked as stale because it has not had any recent activity.
+1 -1
View File
@@ -16,7 +16,7 @@ jobs:
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
uses: peaceiris/actions-hugo@v3
with:
hugo-version: "latest"
extended: true
+40 -1
View File
@@ -6,6 +6,41 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased]
### Added
- Umami Analytics support ([#832](https://github.com/jpanther/congo/pull/832))
- Theme parameter to set a default HTML theme colour ([#849](https://github.com/jpanther/congo/pull/849))
- New icon for `bluesky` ([#851](https://github.com/jpanther/congo/pull/851))
### Changed
- Upgrade to Typography v0.5.13 ([#864](https://github.com/jpanther/congo/pull/864))
### Fixed
- Featured images overlap page title when article metadata hidden ([#827](https://github.com/jpanther/congo/issues/827))
- Inconsistent picture rendering between `figure` shortcode and Markdown render hook ([#828](https://github.com/jpanther/congo/issues/828))
## [2.8.2] - 2024-04-17
### Added
- Tamil translation ([#830](https://github.com/jpanther/congo/pull/830))
- Vietnamese translation ([#845](https://github.com/jpanther/congo/pull/845))
- Swedish translation ([#852](https://github.com/jpanther/congo/pull/852))
### Changed
- Upgrade to KaTeX v0.16.10 ([#839](https://github.com/jpanther/congo/pull/839))
- Upgrade to Typography v0.5.12 ([#841](https://github.com/jpanther/congo/pull/841), [#860](https://github.com/jpanther/congo/pull/860))
- Upgrade to Tailwind v3.4.3 ([#843](https://github.com/jpanther/congo/pull/843))
### Fixed
- Background color inconsistent on mobile when dark mode enabled ([#796](https://github.com/jpanther/congo/issues/796))
## [2.8.1] - 2024-03-09
### Changed
- Upgrade to ChartJS v4.4.2 ([#817](https://github.com/jpanther/congo/pull/817))
@@ -13,9 +48,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Fixed
- Table of Contents missing left border detail ([#794](https://github.com/jpanther/congo/issues/794))
- `x-twitter` option missing when using sharing links ([#809](https://github.com/jpanther/congo/issues/809))
- Chinese default config contains incorrect `author` block name ([#807](https://github.com/jpanther/congo/pull/807))
- Links in articles are prefixed with a blank space ([#813](https://github.com/jpanther/congo/pull/813))
- HTML tables would not fill the container width on desktop ([#826](https://github.com/jpanther/congo/issues/826))
## [2.8.0] - 2024-01-22
@@ -852,7 +889,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Advanced customisation using simple Tailwind colour definitions and styles
- Fully documented
[Unreleased]: https://github.com/jpanther/congo/compare/v2.8.0...HEAD
[Unreleased]: https://github.com/jpanther/congo/compare/v2.8.2...HEAD
[2.8.2]: https://github.com/jpanther/congo/compare/v2.8.1...v2.8.2
[2.8.1]: https://github.com/jpanther/congo/compare/v2.8.0...v2.8.1
[2.8.0]: https://github.com/jpanther/congo/compare/v2.7.6...v2.8.0
[2.7.6]: https://github.com/jpanther/congo/compare/v2.7.5...v2.7.6
[2.7.5]: https://github.com/jpanther/congo/compare/v2.7.4...v2.7.5
+1 -1
View File
@@ -28,7 +28,7 @@ Congo is designed to be a powerful, lightweight theme for [Hugo](https://gohugo.
- Heading anchors, Tables of Contents, Code copy, Buttons, Badges and more
- HTML and Emoji support in articles 🎉
- SEO friendly with links for sharing to social media
- Fathom Analytics and Google Analytics support
- Fathom Analytics, Plausible Analytics, Umami Analytics and Google Analytics support
- RSS feeds, Favicons and comments support
- Advanced customisation using simple Tailwind colour definitions and styles
- Optimised for performance and accessibility with perfect Lighthouse scores
+166 -147
View File
@@ -1,6 +1,6 @@
/*! Congo v2.8.0 | MIT License | https://github.com/jpanther/congo */
/*! Congo v2.8.2 | MIT License | https://github.com/jpanther/congo */
/*! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com */
/*! tailwindcss v3.4.3 | MIT License | https://tailwindcss.com */
/*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
@@ -211,6 +211,8 @@ textarea {
/* 1 */
line-height: inherit;
/* 1 */
letter-spacing: inherit;
/* 1 */
color: inherit;
/* 1 */
margin: 0;
@@ -234,9 +236,9 @@ select {
*/
button,
[type='button'],
[type='reset'],
[type='submit'] {
input:where([type='button']),
input:where([type='reset']),
input:where([type='submit']) {
-webkit-appearance: button;
/* 1 */
background-color: transparent;
@@ -492,6 +494,10 @@ video {
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style: ;
}
::backdrop {
@@ -542,6 +548,10 @@ video {
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style: ;
}
.prose {
@@ -597,7 +607,7 @@ video {
list-style-type: decimal;
margin-top: 1.25em;
margin-bottom: 1.25em;
padding-left: 1.625em;
padding-inline-start: 1.625em;
}
.prose :where(ol[type="A"]):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
@@ -640,7 +650,7 @@ video {
list-style-type: disc;
margin-top: 1.25em;
margin-bottom: 1.25em;
padding-left: 1.625em;
padding-inline-start: 1.625em;
}
.prose :where(ol > li):not(:where([class~="not-prose"],[class~="not-prose"] *))::marker {
@@ -669,12 +679,12 @@ video {
font-weight: 500;
font-style: italic;
color: var(--tw-prose-quotes);
border-left-width: 0.25rem;
border-left-color: var(--tw-prose-quote-borders);
border-inline-start-width: 0.25rem;
border-inline-start-color: var(--tw-prose-quote-borders);
quotes: "\201C""\201D""\2018""\2019";
margin-top: 1.6em;
margin-bottom: 1.6em;
padding-left: 1em;
padding-inline-start: 1em;
}
.prose :where(blockquote p:first-of-type):not(:where([class~="not-prose"],[class~="not-prose"] *))::before {
@@ -751,6 +761,11 @@ video {
margin-bottom: 2em;
}
.prose :where(video):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
margin-top: 2em;
margin-bottom: 2em;
}
.prose :where(kbd):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
font-weight: 600;
font-family: inherit;
@@ -759,9 +774,9 @@ video {
font-size: 0.9rem;
border-radius: 0.25rem;
padding-top: 0.1875em;
padding-right: 0.375em;
padding-inline-end: 0.375em;
padding-bottom: 0.1875em;
padding-left: 0.375em;
padding-inline-start: 0.375em;
background-color: rgba(var(--color-neutral-200), 1);
padding: 0.1rem 0.4rem;
}
@@ -821,9 +836,9 @@ video {
margin-bottom: 1.7142857em;
border-radius: 0.375rem;
padding-top: 0.8571429em;
padding-right: 1.1428571em;
padding-inline-end: 1.1428571em;
padding-bottom: 0.8571429em;
padding-left: 1.1428571em;
padding-inline-start: 1.1428571em;
}
.prose :where(pre code):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
@@ -849,7 +864,7 @@ video {
.prose :where(table):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
width: 100%;
table-layout: auto;
text-align: left;
text-align: start;
margin-top: 2em;
margin-bottom: 2em;
font-size: 0.875em;
@@ -865,9 +880,9 @@ video {
color: var(--tw-prose-headings);
font-weight: 600;
vertical-align: bottom;
padding-right: 0.5714286em;
padding-inline-end: 0.5714286em;
padding-bottom: 0.5714286em;
padding-left: 0.5714286em;
padding-inline-start: 0.5714286em;
}
.prose :where(tbody tr):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
@@ -950,22 +965,17 @@ video {
margin-bottom: 0;
}
.prose :where(video):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
margin-top: 2em;
margin-bottom: 2em;
}
.prose :where(li):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
.prose :where(ol > li):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
padding-left: 0.375em;
padding-inline-start: 0.375em;
}
.prose :where(ul > li):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
padding-left: 0.375em;
padding-inline-start: 0.375em;
}
.prose :where(.prose > ul > li p):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
@@ -973,19 +983,19 @@ video {
margin-bottom: 0.75em;
}
.prose :where(.prose > ul > li > *:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
.prose :where(.prose > ul > li > p:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
margin-top: 1.25em;
}
.prose :where(.prose > ul > li > *:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
.prose :where(.prose > ul > li > p:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
margin-bottom: 1.25em;
}
.prose :where(.prose > ol > li > *:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
.prose :where(.prose > ol > li > p:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
margin-top: 1.25em;
}
.prose :where(.prose > ol > li > *:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
.prose :where(.prose > ol > li > p:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
margin-bottom: 1.25em;
}
@@ -1001,7 +1011,7 @@ video {
.prose :where(dd):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
margin-top: 0.5em;
padding-left: 1.625em;
padding-inline-start: 1.625em;
}
.prose :where(hr + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
@@ -1021,26 +1031,26 @@ video {
}
.prose :where(thead th:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
padding-left: 0;
padding-inline-start: 0;
}
.prose :where(thead th:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
padding-right: 0;
padding-inline-end: 0;
}
.prose :where(tbody td, tfoot td):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
padding-top: 0.5714286em;
padding-right: 0.5714286em;
padding-inline-end: 0.5714286em;
padding-bottom: 0.5714286em;
padding-left: 0.5714286em;
padding-inline-start: 0.5714286em;
}
.prose :where(tbody td:first-child, tfoot td:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
padding-left: 0;
padding-inline-start: 0;
}
.prose :where(tbody td:last-child, tfoot td:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
padding-right: 0;
padding-inline-end: 0;
}
.prose :where(figure):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
@@ -1165,7 +1175,7 @@ body:has(#menu-controller:checked) {
color: rgba(var(--color-neutral-700), var(--tw-text-opacity));
}
:is(.dark .toc a) {
.toc a:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-neutral-400), var(--tw-text-opacity));
}
@@ -1212,7 +1222,7 @@ body:has(#menu-controller:checked) {
opacity: 0.9;
}
:is(.dark .copy-button) {
.copy-button:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-neutral-600), var(--tw-bg-opacity));
--tw-text-opacity: 1;
@@ -1227,10 +1237,10 @@ body:has(#menu-controller:checked) {
background-color: rgba(var(--color-primary-100), var(--tw-bg-opacity));
}
:is(.dark .copy-button:hover),:is(.dark
.copy-button:focus),:is(.dark
.copy-button:active),:is(.dark
.copy-button:active:hover) {
.copy-button:hover:is(.dark *),
.copy-button:focus:is(.dark *),
.copy-button:active:is(.dark *),
.copy-button:active:hover:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-primary-600), var(--tw-bg-opacity));
}
@@ -1254,13 +1264,18 @@ table {
overflow: auto;
}
@media (min-width: 768px) {
table {
display: table;
}
}
/* Fix long inline code sections breaking out of article on mobile */
code {
word-wrap: break-word;
/* All browsers since IE 5.5+ */
overflow-wrap: break-word;
/* Renamed property in CSS3 draft spec */
}
/* -- Chroma Highlight -- */
@@ -1277,7 +1292,7 @@ code {
color: rgba(var(--color-neutral-700), var(--tw-text-opacity));
}
:is(.dark .chroma) {
.chroma:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-neutral-700), var(--tw-bg-opacity));
--tw-text-opacity: 1;
@@ -1313,8 +1328,8 @@ code {
color: rgba(var(--color-neutral-600), var(--tw-text-opacity));
}
:is(.dark .chroma .lnt),:is(.dark
.chroma .ln) {
.chroma .lnt:is(.dark *),
.chroma .ln:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-neutral-300), var(--tw-text-opacity));
}
@@ -1337,7 +1352,7 @@ code {
background-color: rgba(var(--color-primary-100), var(--tw-bg-opacity));
}
:is(.dark .chroma .hl) {
.chroma .hl:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-primary-900), var(--tw-bg-opacity));
}
@@ -1376,16 +1391,16 @@ code {
color: rgba(var(--color-primary-600), var(--tw-text-opacity));
}
:is(.dark .chroma .k),:is(.dark
.chroma .kd),:is(.dark
.chroma .kn),:is(.dark
.chroma .kp),:is(.dark
.chroma .kr),:is(.dark
.chroma .nc),:is(.dark
.chroma .fm),:is(.dark
.chroma .nn),:is(.dark
.chroma .vc),:is(.dark
.chroma .o) {
.chroma .k:is(.dark *),
.chroma .kd:is(.dark *),
.chroma .kn:is(.dark *),
.chroma .kp:is(.dark *),
.chroma .kr:is(.dark *),
.chroma .nc:is(.dark *),
.chroma .fm:is(.dark *),
.chroma .nn:is(.dark *),
.chroma .vc:is(.dark *),
.chroma .o:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-primary-300), var(--tw-text-opacity));
}
@@ -1398,7 +1413,7 @@ code {
color: rgba(var(--color-secondary-400), var(--tw-text-opacity));
}
:is(.dark .chroma .kc) {
.chroma .kc:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-secondary-500), var(--tw-text-opacity));
}
@@ -1440,17 +1455,17 @@ code {
color: rgba(var(--color-secondary-400), var(--tw-text-opacity));
}
:is(.dark .chroma .kt),:is(.dark
.chroma .nv),:is(.dark
.chroma .vi),:is(.dark
.chroma .vm),:is(.dark
.chroma .m),:is(.dark
.chroma .mb),:is(.dark
.chroma .mf),:is(.dark
.chroma .mh),:is(.dark
.chroma .mi),:is(.dark
.chroma .il),:is(.dark
.chroma .mo) {
.chroma .kt:is(.dark *),
.chroma .nv:is(.dark *),
.chroma .vi:is(.dark *),
.chroma .vm:is(.dark *),
.chroma .m:is(.dark *),
.chroma .mb:is(.dark *),
.chroma .mf:is(.dark *),
.chroma .mh:is(.dark *),
.chroma .mi:is(.dark *),
.chroma .il:is(.dark *),
.chroma .mo:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-secondary-600), var(--tw-text-opacity));
}
@@ -1471,10 +1486,10 @@ code {
color: rgba(var(--color-secondary-900), var(--tw-text-opacity));
}
:is(.dark .chroma .n),:is(.dark
.chroma .nd),:is(.dark
.chroma .ni),:is(.dark
.chroma .nl) {
.chroma .n:is(.dark *),
.chroma .nd:is(.dark *),
.chroma .ni:is(.dark *),
.chroma .nl:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-secondary-200), var(--tw-text-opacity));
}
@@ -1501,12 +1516,12 @@ code {
color: rgba(var(--color-secondary-800), var(--tw-text-opacity));
}
:is(.dark .chroma .na),:is(.dark
.chroma .nb),:is(.dark
.chroma .bp),:is(.dark
.chroma .nx),:is(.dark
.chroma .py),:is(.dark
.chroma .nt) {
.chroma .na:is(.dark *),
.chroma .nb:is(.dark *),
.chroma .bp:is(.dark *),
.chroma .nx:is(.dark *),
.chroma .py:is(.dark *),
.chroma .nt:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-secondary-300), var(--tw-text-opacity));
}
@@ -1525,9 +1540,9 @@ code {
color: rgba(var(--color-secondary-400), var(--tw-text-opacity));
}
:is(.dark .chroma .no),:is(.dark
.chroma .ne),:is(.dark
.chroma .vg) {
.chroma .no:is(.dark *),
.chroma .ne:is(.dark *),
.chroma .vg:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-secondary-500), var(--tw-text-opacity));
}
@@ -1539,7 +1554,7 @@ code {
color: rgba(var(--color-secondary-600), var(--tw-text-opacity));
}
:is(.dark .chroma .nf) {
.chroma .nf:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-secondary-500), var(--tw-text-opacity));
}
@@ -1596,22 +1611,22 @@ code {
color: rgba(var(--color-primary-800), var(--tw-text-opacity));
}
:is(.dark .chroma .l),:is(.dark
.chroma .ld),:is(.dark
.chroma .s),:is(.dark
.chroma .sa),:is(.dark
.chroma .sb),:is(.dark
.chroma .sc),:is(.dark
.chroma .dl),:is(.dark
.chroma .sd),:is(.dark
.chroma .s2),:is(.dark
.chroma .sh),:is(.dark
.chroma .si),:is(.dark
.chroma .sx),:is(.dark
.chroma .s1),:is(.dark
.chroma .gi),:is(.dark
.chroma .go),:is(.dark
.chroma .gp) {
.chroma .l:is(.dark *),
.chroma .ld:is(.dark *),
.chroma .s:is(.dark *),
.chroma .sa:is(.dark *),
.chroma .sb:is(.dark *),
.chroma .sc:is(.dark *),
.chroma .dl:is(.dark *),
.chroma .sd:is(.dark *),
.chroma .s2:is(.dark *),
.chroma .sh:is(.dark *),
.chroma .si:is(.dark *),
.chroma .sx:is(.dark *),
.chroma .s1:is(.dark *),
.chroma .gi:is(.dark *),
.chroma .go:is(.dark *),
.chroma .gp:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-primary-400), var(--tw-text-opacity));
}
@@ -1624,7 +1639,7 @@ code {
color: rgba(var(--color-secondary-400), var(--tw-text-opacity));
}
:is(.dark .chroma .se) {
.chroma .se:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-secondary-500), var(--tw-text-opacity));
}
@@ -1640,8 +1655,8 @@ code {
color: rgba(var(--color-primary-800), var(--tw-text-opacity));
}
:is(.dark .chroma .sr),:is(.dark
.chroma .ss) {
.chroma .sr:is(.dark *),
.chroma .ss:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-primary-400), var(--tw-text-opacity));
}
@@ -1654,7 +1669,7 @@ code {
color: rgba(var(--color-primary-400), var(--tw-text-opacity));
}
:is(.dark .chroma .ow) {
.chroma .ow:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-primary-600), var(--tw-text-opacity));
}
@@ -1682,12 +1697,12 @@ code {
color: rgba(var(--color-neutral-500), var(--tw-text-opacity));
}
:is(.dark .chroma .c),:is(.dark
.chroma .cm),:is(.dark
.chroma .c1),:is(.dark
.chroma .cs),:is(.dark
.chroma .cp),:is(.dark
.chroma .cpf) {
.chroma .c:is(.dark *),
.chroma .cm:is(.dark *),
.chroma .c1:is(.dark *),
.chroma .cs:is(.dark *),
.chroma .cp:is(.dark *),
.chroma .cpf:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-neutral-400), var(--tw-text-opacity));
}
@@ -1701,7 +1716,7 @@ code {
color: rgba(var(--color-neutral-500), var(--tw-text-opacity));
}
:is(.dark .chroma .ch) {
.chroma .ch:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-neutral-400), var(--tw-text-opacity));
}
@@ -1888,14 +1903,14 @@ code {
margin-top: -0.75rem;
}
.-mt-4 {
margin-top: -1rem;
}
.mb-1 {
margin-bottom: 0.25rem;
}
.mb-10 {
margin-bottom: 2.5rem;
}
.mb-12 {
margin-bottom: 3rem;
}
@@ -1912,6 +1927,10 @@ code {
margin-bottom: 1.5rem;
}
.mb-8 {
margin-bottom: 2rem;
}
.mb-\[2px\] {
margin-bottom: 2px;
}
@@ -2636,7 +2655,7 @@ code {
transition-duration: 150ms;
}
:is(.dark .dark\:prose-invert) {
.dark\:prose-invert:is(.dark *) {
--tw-prose-body: var(--tw-prose-invert-body);
--tw-prose-headings: var(--tw-prose-invert-headings);
--tw-prose-lead: var(--tw-prose-invert-lead);
@@ -2657,16 +2676,16 @@ code {
--tw-prose-td-borders: var(--tw-prose-invert-td-borders);
}
:is(.dark .dark\:prose-invert) :where(a):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
.dark\:prose-invert:is(.dark *) :where(a):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
text-decoration-color: rgba(var(--color-neutral-600), 1);
}
:is(.dark .dark\:prose-invert) :where(kbd):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
.dark\:prose-invert:is(.dark *) :where(kbd):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
color: rgba(var(--color-neutral-200), 1);
background-color: rgba(var(--color-neutral-700), 1);
}
:is(.dark .dark\:prose-invert) :where(mark):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
.dark\:prose-invert:is(.dark *) :where(mark):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
background-color: rgba(var(--color-secondary-400), 1);
}
@@ -2802,147 +2821,147 @@ code {
opacity: 1;
}
:is(.dark .dark\:inline) {
.dark\:inline:is(.dark *) {
display: inline;
}
:is(.dark .dark\:flex) {
.dark\:flex:is(.dark *) {
display: flex;
}
:is(.dark .dark\:hidden) {
.dark\:hidden:is(.dark *) {
display: none;
}
:is(.dark .dark\:border-neutral-600) {
.dark\:border-neutral-600:is(.dark *) {
--tw-border-opacity: 1;
border-color: rgba(var(--color-neutral-600), var(--tw-border-opacity));
}
:is(.dark .dark\:border-neutral-700) {
.dark\:border-neutral-700:is(.dark *) {
--tw-border-opacity: 1;
border-color: rgba(var(--color-neutral-700), var(--tw-border-opacity));
}
:is(.dark .dark\:border-primary-600) {
.dark\:border-primary-600:is(.dark *) {
--tw-border-opacity: 1;
border-color: rgba(var(--color-primary-600), var(--tw-border-opacity));
}
:is(.dark .dark\:bg-neutral-600) {
.dark\:bg-neutral-600:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-neutral-600), var(--tw-bg-opacity));
}
:is(.dark .dark\:bg-neutral-700) {
.dark\:bg-neutral-700:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-neutral-700), var(--tw-bg-opacity));
}
:is(.dark .dark\:bg-neutral-800) {
.dark\:bg-neutral-800:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-neutral-800), var(--tw-bg-opacity));
}
:is(.dark .dark\:bg-neutral-800\/50) {
.dark\:bg-neutral-800\/50:is(.dark *) {
background-color: rgba(var(--color-neutral-800), 0.5);
}
:is(.dark .dark\:bg-neutral-900\/50) {
.dark\:bg-neutral-900\/50:is(.dark *) {
background-color: rgba(var(--color-neutral-900), 0.5);
}
:is(.dark .dark\:bg-primary-400) {
.dark\:bg-primary-400:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-primary-400), var(--tw-bg-opacity));
}
:is(.dark .dark\:bg-primary-800) {
.dark\:bg-primary-800:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-primary-800), var(--tw-bg-opacity));
}
:is(.dark .dark\:bg-primary-900) {
.dark\:bg-primary-900:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-primary-900), var(--tw-bg-opacity));
}
:is(.dark .dark\:text-neutral) {
.dark\:text-neutral:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-neutral), var(--tw-text-opacity));
}
:is(.dark .dark\:text-neutral-100) {
.dark\:text-neutral-100:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-neutral-100), var(--tw-text-opacity));
}
:is(.dark .dark\:text-neutral-300) {
.dark\:text-neutral-300:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-neutral-300), var(--tw-text-opacity));
}
:is(.dark .dark\:text-neutral-400) {
.dark\:text-neutral-400:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-neutral-400), var(--tw-text-opacity));
}
:is(.dark .dark\:text-neutral-500) {
.dark\:text-neutral-500:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-neutral-500), var(--tw-text-opacity));
}
:is(.dark .dark\:text-neutral-800) {
.dark\:text-neutral-800:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-neutral-800), var(--tw-text-opacity));
}
:is(.dark .dark\:text-primary-400) {
.dark\:text-primary-400:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-primary-400), var(--tw-text-opacity));
}
:is(.dark .dark\:hover\:border-primary-600:hover) {
.dark\:hover\:border-primary-600:hover:is(.dark *) {
--tw-border-opacity: 1;
border-color: rgba(var(--color-primary-600), var(--tw-border-opacity));
}
:is(.dark .dark\:hover\:\!bg-primary-700:hover) {
.dark\:hover\:\!bg-primary-700:hover:is(.dark *) {
--tw-bg-opacity: 1 !important;
background-color: rgba(var(--color-primary-700), var(--tw-bg-opacity)) !important;
}
:is(.dark .dark\:hover\:bg-primary-400:hover) {
.dark\:hover\:bg-primary-400:hover:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-primary-400), var(--tw-bg-opacity));
}
:is(.dark .dark\:hover\:bg-primary-900:hover) {
.dark\:hover\:bg-primary-900:hover:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-primary-900), var(--tw-bg-opacity));
}
:is(.dark .dark\:hover\:text-neutral-800:hover) {
.dark\:hover\:text-neutral-800:hover:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-neutral-800), var(--tw-text-opacity));
}
:is(.dark .dark\:hover\:text-primary-400:hover) {
.dark\:hover\:text-primary-400:hover:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-primary-400), var(--tw-text-opacity));
}
:is(.dark .dark\:focus\:bg-primary-900:focus) {
.dark\:focus\:bg-primary-900:focus:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-primary-900), var(--tw-bg-opacity));
}
:is(.dark .group:hover .dark\:group-hover\:text-neutral-700) {
.group:hover .dark\:group-hover\:text-neutral-700:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-neutral-700), var(--tw-text-opacity));
}
:is(.dark .group:hover .dark\:group-hover\:text-primary-400) {
.group:hover .dark\:group-hover\:text-primary-400:is(.dark *) {
--tw-text-opacity: 1;
color: rgba(var(--color-primary-400), var(--tw-text-opacity));
}
+3 -4
View File
@@ -1,4 +1,4 @@
/*! Congo v2.8.0 | MIT License | https://github.com/jpanther/congo */
/*! Congo v2.8.2 | MIT License | https://github.com/jpanther/congo */
@tailwind base;
@tailwind components;
@@ -109,14 +109,13 @@ body:has(#menu-controller:checked) {
/* Fix long tables breaking out of article on mobile */
table {
display: block;
overflow: auto;
@apply block overflow-auto md:table;
}
/* Fix long inline code sections breaking out of article on mobile */
code {
word-wrap: break-word; /* All browsers since IE 5.5+ */
overflow-wrap: break-word; /* Renamed property in CSS3 draft spec */
@apply break-words;
}
/* -- Chroma Highlight -- */
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M407.8 294.7c-3.3-.4-6.7-.8-10-1.3c3.4 .4 6.7 .9 10 1.3zM288 227.1C261.9 176.4 190.9 81.9 124.9 35.3C61.6-9.4 37.5-1.7 21.6 5.5C3.3 13.8 0 41.9 0 58.4S9.1 194 15 213.9c19.5 65.7 89.1 87.9 153.2 80.7c3.3-.5 6.6-.9 10-1.4c-3.3 .5-6.6 1-10 1.4C74.3 308.6-9.1 342.8 100.3 464.5C220.6 589.1 265.1 437.8 288 361.1c22.9 76.7 49.2 222.5 185.6 103.4c102.4-103.4 28.1-156-65.8-169.9c-3.3-.4-6.7-.8-10-1.3c3.4 .4 6.7 .9 10 1.3c64.1 7.1 133.6-15.1 153.2-80.7C566.9 194 576 75 576 58.4s-3.3-44.7-21.6-52.9c-15.8-7.1-40-14.9-103.2 29.8C385.1 81.9 314.1 176.4 288 227.1z"/></svg>

After

Width:  |  Height:  |  Size: 786 B

+1
View File
@@ -54,6 +54,7 @@ function add_to_top_elem() {
window.addEventListener("DOMContentLoaded", (event) => {
add_to_top_elem();
setThemeColor();
var switchers = document.querySelectorAll("[id^='appearance-switcher']");
switchers.forEach((switcher) => {
switcher.addEventListener("click", () => {
+1 -1
View File
@@ -1 +1 @@
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var i={};return function(){n.d(i,{default:function(){return s}});var e=n(771),t=n.n(e),r=function(e,t,r){for(var n=r,i=0,a=e.length;n<t.length;){var o=t[n];if(i<=0&&t.slice(n,n+a)===e)return n;"\\"===o?n++:"{"===o?i++:"}"===o&&i--,n++}return-1},a=/^\\begin{/,o=function(e,t){for(var n,i=[],o=new RegExp("("+t.map((function(e){return e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")})).join("|")+")");-1!==(n=e.search(o));){n>0&&(i.push({type:"text",data:e.slice(0,n)}),e=e.slice(n));var l=t.findIndex((function(t){return e.startsWith(t.left)}));if(-1===(n=r(t[l].right,e,t[l].left.length)))break;var d=e.slice(0,n+t[l].right.length),s=a.test(d)?d:e.slice(t[l].left.length,n);i.push({type:"math",data:s,rawData:d,display:t[l].display}),e=e.slice(n+t[l].right.length)}return""!==e&&i.push({type:"text",data:e}),i},l=function(e,r){var n=o(e,r.delimiters);if(1===n.length&&"text"===n[0].type)return null;for(var i=document.createDocumentFragment(),a=0;a<n.length;a++)if("text"===n[a].type)i.appendChild(document.createTextNode(n[a].data));else{var l=document.createElement("span"),d=n[a].data;r.displayMode=n[a].display;try{r.preProcess&&(d=r.preProcess(d)),t().render(d,l,r)}catch(e){if(!(e instanceof t().ParseError))throw e;r.errorCallback("KaTeX auto-render: Failed to parse `"+n[a].data+"` with ",e),i.appendChild(document.createTextNode(n[a].rawData));continue}i.appendChild(l)}return i},d=function e(t,r){for(var n=0;n<t.childNodes.length;n++){var i=t.childNodes[n];if(3===i.nodeType){for(var a=i.textContent,o=i.nextSibling,d=0;o&&o.nodeType===Node.TEXT_NODE;)a+=o.textContent,o=o.nextSibling,d++;var s=l(a,r);if(s){for(var f=0;f<d;f++)i.nextSibling.remove();n+=s.childNodes.length-1,t.replaceChild(s,i)}else n+=d}else 1===i.nodeType&&function(){var t=" "+i.className+" ";-1===r.ignoredTags.indexOf(i.nodeName.toLowerCase())&&r.ignoredClasses.every((function(e){return-1===t.indexOf(" "+e+" ")}))&&e(i,r)}()}},s=function(e,t){if(!e)throw new Error("No element provided to render");var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);r.delimiters=r.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],r.ignoredTags=r.ignoredTags||["script","noscript","style","textarea","pre","code","option"],r.ignoredClasses=r.ignoredClasses||[],r.errorCallback=r.errorCallback||console.error,r.macros=r.macros||{},d(e,r)}}(),i=i.default}()}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};return function(){r.d(o,{default:function(){return d}});var e=r(771),t=r.n(e);const n=function(e,t,n){let r=n,o=0;const i=e.length;for(;r<t.length;){const n=t[r];if(o<=0&&t.slice(r,r+i)===e)return r;"\\"===n?r++:"{"===n?o++:"}"===n&&o--,r++}return-1},i=/^\\begin{/;var a=function(e,t){let r;const o=[],a=new RegExp("("+t.map((e=>e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))).join("|")+")");for(;r=e.search(a),-1!==r;){r>0&&(o.push({type:"text",data:e.slice(0,r)}),e=e.slice(r));const a=t.findIndex((t=>e.startsWith(t.left)));if(r=n(t[a].right,e,t[a].left.length),-1===r)break;const l=e.slice(0,r+t[a].right.length),s=i.test(l)?l:e.slice(t[a].left.length,r);o.push({type:"math",data:s,rawData:l,display:t[a].display}),e=e.slice(r+t[a].right.length)}return""!==e&&o.push({type:"text",data:e}),o};const l=function(e,n){const r=a(e,n.delimiters);if(1===r.length&&"text"===r[0].type)return null;const o=document.createDocumentFragment();for(let e=0;e<r.length;e++)if("text"===r[e].type)o.appendChild(document.createTextNode(r[e].data));else{const i=document.createElement("span");let a=r[e].data;n.displayMode=r[e].display;try{n.preProcess&&(a=n.preProcess(a)),t().render(a,i,n)}catch(i){if(!(i instanceof t().ParseError))throw i;n.errorCallback("KaTeX auto-render: Failed to parse `"+r[e].data+"` with ",i),o.appendChild(document.createTextNode(r[e].rawData));continue}o.appendChild(i)}return o},s=function(e,t){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(3===r.nodeType){let o=r.textContent,i=r.nextSibling,a=0;for(;i&&i.nodeType===Node.TEXT_NODE;)o+=i.textContent,i=i.nextSibling,a++;const s=l(o,t);if(s){for(let e=0;e<a;e++)r.nextSibling.remove();n+=s.childNodes.length-1,e.replaceChild(s,r)}else n+=a}else if(1===r.nodeType){const e=" "+r.className+" ";-1===t.ignoredTags.indexOf(r.nodeName.toLowerCase())&&t.ignoredClasses.every((t=>-1===e.indexOf(" "+t+" ")))&&s(r,t)}}};var d=function(e,t){if(!e)throw new Error("No element provided to render");const n={};for(const e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);n.delimiters=n.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],n.ignoredTags=n.ignoredTags||["script","noscript","style","textarea","pre","code","option"],n.ignoredClasses=n.ignoredClasses||[],n.errorCallback=n.errorCallback||console.error,n.macros=n.macros||{},s(e,n)}}(),o=o.default}()}));
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+6
View File
@@ -9,6 +9,8 @@ colorScheme = "congo"
defaultAppearance = "light" # valid options: light or dark
autoSwitchAppearance = true
defaultThemeColor = "#FFFFFF"
enableSearch = false
enableCodeCopy = false
enableImageLazyLoading = true
@@ -75,6 +77,10 @@ fingerprintAlgorithm = "sha256"
# event = ""
# script = ""
#[umamiAnalytics]
# site = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
# region = "eu" # can be either "eu" or "us"
[verification]
# google = ""
# bing = ""
+4
View File
@@ -71,6 +71,10 @@ fingerprintAlgorithm = "sha256"
[fathomAnalytics]
# site = "ABC12345"
#[umamiAnalytics]
# site = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
# region = "eu" # Can be either "eu" or "us"
[verification]
# google = ""
# bing = ""
@@ -66,6 +66,7 @@ Congoは現在、以下の言語に対応しています:
| :indonesia: Indonesian | `id` |
| :it: Italian | `it` |
| :jp: Japanese | `ja` |
| :kr: Korean | `ko` |
| :poland: Polish | `pl` |
| :brazil: Portuguese (Brazil) | `pt-br` |
| :portugal: Portuguese (Portugal) | `pt-pt` |
@@ -73,8 +74,11 @@ Congoは現在、以下の言語に対応しています:
| :ru: Russian | `ru` |
| :slovakia: Slovak | `sk` |
| :es: Spanish (Spain) | `es` |
| :sweden: Swedish | `sv` |
| :flag-lk: Tamil | `ta` |
| :tr: Turkish | `tr` |
| :ukraine: Ukrainian | `uk` |
| :vietnam: Vietnamese | `vi` |
翻訳文字列を含むカスタムファイルを `i18n/[code].yaml` に作成することでデフォルトの翻訳をオーバーライドできます。このメソッドを使って新しい言語を追加することもできます。新しい翻訳をコミュニティと共有したい場合、[Pull Request](https://github.com/jpanther/congo/pulls)を作ってください。
@@ -125,6 +129,7 @@ Congoはテーマの機能を制御する多数の設定パラメーターを提
|Name|Default|Description|
|---|---|---|
|`colorScheme`|`"congo"`|使用する配色。有効な値は `congo` (デフォルト), `avocado`, `cherry`, `fire`, `ocean`, `sapphire`, `slate` です。詳しくは [カラースキーム]({{< ref "getting-started#カラースキーム" >}})セクションを参照してください。|
|`defaultThemeColor`|`"#FFFFFF"`|まだ翻訳されていません。|
|`defaultAppearance`|`"light"`|デフォルトのテーマ外観、 `light` または `dark` のいずれか。|
|`autoSwitchAppearance`|`true`|テーマの外観を訪問者のオペレーティングシステムの設定に基づいて自動的に切り替えるかどうか。常に `defaultAppearance` を使うようにするには `false` を設定します。|
|`enableSearch`|`false`|サイト内検索を有効にするかどうか。検索機能を有効にするには `true` を設定します。検索機能は、[サイト設定](#サイト設定)の `outputs.home` が正しく設定されているかどうかに依存することに注意してください。|
@@ -74,8 +74,11 @@ The theme currently supports the following languages out of the box:
| :ru: Russian | `ru` |
| :slovakia: Slovak | `sk` |
| :es: Spanish (Spain) | `es` |
| :sweden: Swedish | `sv` |
| :flag-lk: Tamil | `ta` |
| :tr: Turkish | `tr` |
| :ukraine: Ukrainian | `uk` |
| :vietnam: Vietnamese | `vi` |
The default translations can be overridden by creating a custom file in `i18n/[code].yaml` that contains the translation strings. You can also use this method to add new languages. If you'd like to share a new translation with the community, please [open a pull request](https://github.com/jpanther/congo/pulls).
@@ -126,6 +129,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
|Name|Default|Description|
|---|---|---|
|`colorScheme`|`"congo"`|The theme colour scheme to use. Valid values are `congo` (default), `avocado`, `cherry`, `fire`, `ocean`, `sapphire` and `slate`. Refer to the [Colour Schemes]({{< ref "getting-started#colour-schemes" >}}) section for more details.|
|`defaultThemeColor`|`"#FFFFFF"`|The original value (before any scripts modify it) to use for the `theme-color` meta tag. The meta tag will be changed based on the theme (`light` or `dark`) but it is useful for services that source the original value this tag to display an accent color (e.g. Discord)|
|`defaultAppearance`|`"light"`|The default theme appearance, either `light` or `dark`.|
|`autoSwitchAppearance`|`true`|Whether the theme appearance automatically switches based upon the visitor's operating system preference. Set to `false` to force the site to always use the `defaultAppearance`.|
|`enableSearch`|`false`|Whether site search is enabled. Set to `true` to enable search functionality. Note that the search feature depends on the `outputs.home` setting in the [site configuration](#site-configuration) being set correctly.|
@@ -175,6 +179,8 @@ Many of the article defaults here can be overridden on a per article basis by sp
|`plausibleAnalytics.domain`|_Not set_|Enter the domain of the website you want to track. Refer to the [Analytics docs]({{< ref "partials#analytics" >}}) for more details.|
|`plausibleAnalytics.event`|_Not set_|Plausible api event proxied URL. Refer to the [Analytics docs]({{< ref "partials#analytics" >}}) for more details.|
|`plausibleAnalytics.script`|_Not set_|Plausible analysis script proxied URL. Refer to the [Analytics docs]({{< ref "partials#analytics" >}}) for more details.|
|`umamiAnalytics.site`|_Not set_|The tracking code generated by Umami Analytics for the website. Refer to the [Analytics docs]({{< ref "partials#analytics" >}}) for more details.|
|`umamiAnalytics.region`|`eu`|Select the Umami Analytics server region to connect to. The value is a string that can be either `eu` or `us`.|
|`verification.google`|_Not set_|The site verification string provided by Google to be included in the site metadata.|
|`verification.bing`|_Not set_|The site verification string provided by Bing to be included in the site metadata.|
|`verification.pinterest`|_Not set_|The site verification string provided by Pinterest to be included in the site metadata.|
@@ -48,33 +48,33 @@ Congo 针对完整的多语言网站进行了优化,并且主题assets中已
该主题目前支持以下语言:
| 语言 | 代码 |
| --------------------------------------- | ------- |
| :gb: **英语(默认)** | `en` |
| :egypt: 阿拉伯语 | `ar` |
| :bangladesh: 孟加拉语 | `bn` |
| :bulgaria: 保加利亚语 | `bg` |
| :cn: 中文 - 简体(中国) | `zh-cn` |
| :taiwan: 中文 - 繁体(台湾) | `zh-tw` |
| :flag-cz: 捷克语 | `cs` |
| :netherlands: 荷兰语 | `nl` |
| :finland: 芬兰语 | `fi` |
| :fr: 法语 | `fr` |
| :de: 德语 | `de` |
| :israel: 希伯来语 | `he` |
| :hungary: 匈牙利语 | `hu` |
| :indonesia: 印尼语 | `id` |
| :it: 意大利语 | `it` |
| :jp: 日语 | `ja` |
| :poland: 波兰语 | `pl` |
| :brazil: 葡萄牙语(巴西) | `pt-br` |
| :portugal: 葡萄牙语(葡萄牙) | `pt-pt` |
| :romania: 罗马尼亚语 | `ro` |
| :ru: 俄语 | `ru` |
| :slovakia: 斯洛伐克语 | `sk` |
| :es: 西班牙语(西班牙) | `es` |
| :tr: 土耳其语 | `tr` |
| :ukraine: 乌克兰语 | `uk` |
| 语言 | 代码 |
| ----------------------------- | ------- |
| :gb: **英语(默认)** | `en` |
| :egypt: 阿拉伯语 | `ar` |
| :bangladesh: 孟加拉语 | `bn` |
| :bulgaria: 保加利亚语 | `bg` |
| :cn: 中文 - 简体(中国) | `zh-cn` |
| :taiwan: 中文 - 繁体(台湾) | `zh-tw` |
| :flag-cz: 捷克语 | `cs` |
| :netherlands: 荷兰语 | `nl` |
| :finland: 芬兰语 | `fi` |
| :fr: 法语 | `fr` |
| :de: 德语 | `de` |
| :israel: 希伯来语 | `he` |
| :hungary: 匈牙利语 | `hu` |
| :indonesia: 印尼语 | `id` |
| :it: 意大利语 | `it` |
| :jp: 日语 | `ja` |
| :poland: 波兰语 | `pl` |
| :brazil: 葡萄牙语(巴西) | `pt-br` |
| :portugal: 葡萄牙语(葡萄牙) | `pt-pt` |
| :romania: 罗马尼亚语 | `ro` |
| :ru: 俄语 | `ru` |
| :slovakia: 斯洛伐克语 | `sk` |
| :es: 西班牙语(西班牙) | `es` |
| :tr: 土耳其语 | `tr` |
| :ukraine: 乌克兰语 | `uk` |
默认翻译可以通过在 `i18n/[code].yaml` 中创建自定义文件来覆盖,其中包含翻译字符串。您还可以使用此方法添加新语言。如果您希望与社区分享新的翻译,请[Pull Request](https://github.com/jpanther/congo/pulls)。
@@ -125,6 +125,7 @@ Congo 提供了大量的配置参数,用于控制主题的功能。下表概
|名称|默认值|描述|
|---|---|---|
|`colorScheme`|`"congo"`|要使用的主题颜色方案。有效值为 `congo`(默认)、`avocado``cherry``fire``ocean``sapphire``slate`。有关详细信息,请参阅[颜色方案]({{< ref "getting-started#颜色方案" >}})部分。|
|`defaultThemeColor`|`"#FFFFFF`|`theme-color` meta 标签的原值(在脚本修改它之前)。meta 标签会根据所选主题而变化(`light``dark`),但是一些软件(例如 Discord)会使用该标签的原值来显示主题色。|
|`defaultAppearance`|`"light"`|默认的主题外观,可以是 `light``dark`。|
|`autoSwitchAppearance`|`true`|主题外观是否根据访问者的操作系统首选项自动切换。设置为 `false` 以始终使用 `defaultAppearance`。|
|`enableSearch`|`false`|是否启用站内搜索。设置为 `true` 以启用搜索功能。请注意,搜索功能取决于 [站点配置](#site-configuration) 中的 `outputs.home` 设置正确。|
@@ -177,6 +178,7 @@ Congo 提供了大量的配置参数,用于控制主题的功能。下表概
|`verification.bing`|_未设置_|由 Bing 提供的要包含在站点元数据中的站点验证字符串。|
|`verification.pinterest`|_未设置_|由 Pinterest 提供的要包含在站点元数据中的站点验证字符串。|
|`verification.yandex`|_未设置_|由 Yandex 提供的要包含在站点元数据中的站点验证字符串。|
<!-- prettier-ignore-end -->
## 其他配置文件
@@ -40,6 +40,18 @@ To enable Plausible analytics support, simply provide the domain of the website
script = "https://plausible.yoursite.com/js/script.js"
```
### Umami Analytics
To enable support for Umami Analytics, insert the _tracking code token_ provided by Umami into the `site` parameter to monitor the site. You can also insert a `region` parameter to indicate the region of Umami Analytics servers that you want to connect to. The values can be `eu` or `us`. Refer to [getting started section at umami.is](https://umami.is/docs/getting-started) for more details.
```toml
# config/_default/params.toml
[umamiAnalytics]
site = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
region = "eu" # can be either "eu" or "us"
```
### Google Analytics
Google Analytics support is provided through the internal Hugo partial. Simply provide the `googleAnalytics` key in the `config/_default/config.toml` file and the script will be added automatically.
@@ -21,6 +21,7 @@ Die vollständige Liste der integrierten Icons und ihre entsprechenden Namen fin
| apple | {{< icon apple >}} |
| bars | {{< icon bars >}} |
| blogger | {{< icon blogger >}} |
| bluesky | {{< icon bluesky >}} |
| bug | {{< icon bug >}} |
| check | {{< icon check >}} |
| chevron-down | {{< icon chevron-down >}} |
@@ -21,6 +21,7 @@ La lista completa de íconos incorporados y sus nombres correspondientes se pued
| apple | {{< icon apple >}} |
| bars | {{< icon bars >}} |
| blogger | {{< icon blogger >}} |
| bluesky | {{< icon bluesky >}} |
| bug | {{< icon bug >}} |
| check | {{< icon check >}} |
| chevron-down | {{< icon chevron-down >}} |
@@ -21,6 +21,7 @@ Congo は[FontAwesome 6](https://fontawesome.com/icons)のアイコンをサポ
| apple | {{< icon apple >}} |
| bars | {{< icon bars >}} |
| blogger | {{< icon blogger >}} |
| bluesky | {{< icon bluesky >}} |
| bug | {{< icon bug >}} |
| check | {{< icon check >}} |
| chevron-down | {{< icon chevron-down >}} |
@@ -21,6 +21,7 @@ The full list of built-in icons and their corresponding names can referenced bel
| apple | {{< icon apple >}} |
| bars | {{< icon bars >}} |
| blogger | {{< icon blogger >}} |
| bluesky | {{< icon bluesky >}} |
| bug | {{< icon bug >}} |
| check | {{< icon check >}} |
| chevron-down | {{< icon chevron-down >}} |
@@ -21,6 +21,7 @@ Congo内置了对多个[FontAwesome 6](https://fontawesome.com/icons)图标的
| apple | {{< icon apple >}} |
| bars | {{< icon bars >}} |
| blogger | {{< icon blogger >}} |
| bluesky | {{< icon bluesky >}} |
| bug | {{< icon bug >}} |
| check | {{< icon check >}} |
| chevron-down | {{< icon chevron-down >}} |
@@ -56,22 +56,22 @@ tags: ["markdown", "css", "html", "sample"]
表格不属于核心Markdown规范,但Hugo原生支持它们,无需额外配置。
| 名前 | 年齢 |
| ----- | --- |
| Bob | 27 |
| Alice | 23 |
| ----- | ---- |
| Bob | 27 |
| Alice | 23 |
### 表格内的行内Markdown
| 斜体 | 粗体 | 代码 |
| --------- | -------- | ------ |
| _斜体_ | **粗体** | `代码` |
| 斜体 | 粗体 | 代码 |
| ------ | -------- | ------ |
| _斜体_ | **粗体** | `代码` |
## 代码块
### 使用反引号的代码块
```html
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
+3 -1
View File
@@ -72,6 +72,8 @@ La lista a continuación es solo un puñado de sitios web creados con el tema Co
| [aminelch.github.io](https://aminelch.github.io) | Personal Site and Blog |
| [robertboscacci.com](https://robertboscacci.com) | Personal Site and Blog |
| [gorbe.io](https://www.gorbe.io) | Business Site and Blog |
| [techwolf12.nl](https://techwolf12.nl) | Personal Site and Tech Blog |
| [techwolf12.nl](https://techwolf12.nl) | Personal Site and Tech Blog |
| [kylecapehart.com](https://kylecapehart.com/) | Personal Site and Blog |
| [hosni.info](https://hosni.info/) | Personal site and Tech Blog |
**¿Usuaria de congo?** Para agregar tu sitio a esta lista, [haz un pull request](https://github.com/jpanther/congo/blob/dev/exampleSite/content/users/index.md).
+3 -1
View File
@@ -72,6 +72,8 @@ Congoを使用して構築された実際のウェブサイト。
| [aminelch.github.io](https://aminelch.github.io) | Personal Site and Blog |
| [robertboscacci.com](https://robertboscacci.com) | Personal Site and Blog |
| [gorbe.io](https://www.gorbe.io) | Business Site and Blog |
| [techwolf12.nl](https://techwolf12.nl) | Personal Site and Tech Blog |
| [techwolf12.nl](https://techwolf12.nl) | Personal Site and Tech Blog |
| [kylecapehart.com](https://kylecapehart.com/) | Personal Site and Blog |
| [hosni.info](https://hosni.info/) | Personal site and Tech Blog |
**Congoを使っていますか?** あなたのウェブサイトを加えるために[Pull Request](https://github.com/jpanther/congo/blob/dev/exampleSite/content/users/index.md)を投げてください。
+5 -1
View File
@@ -72,6 +72,10 @@ The list below is just a handful of the websites that are built using the Congo
| [aminelch.github.io](https://aminelch.github.io) | Personal Site and Blog |
| [robertboscacci.com](https://robertboscacci.com) | Personal Site and Blog |
| [gorbe.io](https://www.gorbe.io) | Business Site and Blog |
| [techwolf12.nl](https://techwolf12.nl) | Personal Site and Tech Blog |
| [techwolf12.nl](https://techwolf12.nl) | Personal Site and Tech Blog |
| [kylecapehart.com](https://kylecapehart.com/) | Personal Site and Blog |
| [hosni.info](https://hosni.info/) | Personal site and Tech Blog |
| [mattstrayer.com](https://www.mattstrayer.com/) | Personal Site and Blog |
| [noamlerner.com](https://www.noamlerner.com/) | Personal blog (English/Hebrew) |
**Congo user?** To add your site to this list, [submit a pull request](https://github.com/jpanther/congo/blob/dev/exampleSite/content/users/index.md).
+3 -1
View File
@@ -72,6 +72,8 @@ showEdit: false
| [aminelch.github.io](https://aminelch.github.io) | Personal Site and Blog |
| [robertboscacci.com](https://robertboscacci.com) | Personal Site and Blog |
| [gorbe.io](https://www.gorbe.io) | Business Site and Blog |
| [techwolf12.nl](https://techwolf12.nl) | Personal Site and Tech Blog |
| [techwolf12.nl](https://techwolf12.nl) | Personal Site and Tech Blog |
| [kylecapehart.com](https://kylecapehart.com/) | Personal Site and Blog |
| [hosni.info](https://hosni.info/) | Personal site and Tech Blog |
**想成为Congo的用户?** 要将您的网站添加到此列表中,请提交[Pull Request](https://github.com/jpanther/congo/blob/dev/exampleSite/content/users/index.md)来添加。
+60
View File
@@ -0,0 +1,60 @@
article:
anchor_label: "Ankare"
date: "{{ .Date }}"
date_updated: "Uppdaterad: {{ .Date }}"
draft: "Utkast"
edit_title: "Redigera innehåll"
reading_time:
one: "{{ .Count }} min"
other: "{{ .Count }} min"
reading_time_title: "Lästid"
table_of_contents: "Innehållsförteckning"
word_count:
one: "{{ .Count }} ord"
other: "{{ .Count }} ord"
author:
byline_title: "Författare"
code:
copy: "Kopiera"
copied: "Kopierat"
error:
404_title: "Sidan hittades inte :confused:"
404_error: "Error 404"
404_description: "Den sida du har begärt verkar inte finnas."
footer:
dark_appearance: "Byt till mörkt utseende"
light_appearance: "Byt till ljust utseende"
powered_by: "Drivs av {{ .Hugo }} &amp; {{ .Congo }}"
list:
externalurl_title: "Länk till extern webbplats"
no_articles: "Det finns inga artiklar att visa här ännu."
nav:
scroll_to_top_title: "Scrolla till början"
skip_to_main: "Hoppa till huvudinnehåll"
search:
open_button_title: "Sök (/)"
close_button_title: "Stäng (Esc)"
input_placeholder: "Sök"
sharing:
email: "Skicka via e-post"
facebook: "Dela på Facebook"
linkedin: "Dela på LinkedIn"
mastodon: "Dela på Mastodon"
pinterest: "Fäst på Pinterest"
reddit: "Publicera på Reddit"
twitter: "Twittra på Twitter"
telegram: "Dela på Telegram"
line: "Dela på LINE"
weibo: "Dela på Weibo"
x-twitter: "Publicera på X"
shortcode:
recent_articles: "Senaste"
+60
View File
@@ -0,0 +1,60 @@
article:
anchor_label: "நங்கூரம்"
date: "{{ .Date }}"
date_updated: "புதுப்பிக்கப்பட்டது: {{ .Date }}"
draft: "வரைவு"
edit_title: "உள்ளடக்கத்தைத் திருத்தவும்"
reading_time:
one: "{{ .Count }} நிமிடம்"
other: "{{ .Count }} நிமிடங்கள்"
reading_time_title: "படிப்பதற்கு எடுக்கும் நேரம்"
table_of_contents: "பொருளடக்கம்"
word_count:
one: "{{ .Count }} சொல்"
other: "{{ .Count }} சொற்கள்"
author:
byline_title: "நூலாசிரியர்"
code:
copy: "நகலெடுக்கவும்"
copied: "நகலெடுக்கப்பட்டது"
error:
404_title: "பக்கம் கிடைக்கவில்லை :confused:"
404_error: "பிழை 404"
404_description: "நீங்கள் கோரிய பக்கம் இல்லை என்று தெரிகிறது."
footer:
dark_appearance: "இருண்ட தோற்றத்திற்கு மாறவும்"
light_appearance: "ஒளி தோற்றத்திற்கு மாறவும்"
powered_by: "{{ .Hugo }} &amp; {{ .Congo }} மூலம் இயக்கப்படுகிறது"
list:
externalurl_title: "வெளிப்புற தளத்திற்கான இணைப்பு"
no_articles: "இங்கே பட்டியலிட இன்னும் கட்டுரைகள் எதுவும் இல்லை."
nav:
scroll_to_top_title: "மேலே உருட்டவும்"
skip_to_main: "முக்கிய உள்ளடக்கத்திற்கு செல்க"
search:
open_button_title: "தேடு (/)"
close_button_title: "மூடு (Esc)"
input_placeholder: "தேடு"
sharing:
email: "மின்னஞ்சல் மூலம் அனுப்பவும்"
facebook: "Facebook இல் பகிரவும்"
linkedin: "LinkedIn இல் பகிரவும்"
mastodon: "Mastodon இல் டூட் செய்யவும்"
pinterest: "Pinterest இல் பின் செய்யவும்"
reddit: "Reddit க்கு சமர்ப்பிக்கவும்"
twitter: "Twitter இல் ட்வீட் செய்யுங்கள்"
telegram: "Telegram இல் பகிரவும்"
line: "LINE இல் பகிரவும்"
weibo: "Weibo இல் பகிரவும்"
x-twitter: "X இல் இடுகையிடவும்"
shortcode:
recent_articles: "சமீபத்திய கட்டுரைகள்"
+60
View File
@@ -0,0 +1,60 @@
article:
anchor_label: "Neo"
date: "{{ .Date }}"
date_updated: "Đã cập nhật: {{ .Date }}"
draft: "Bản nháp"
edit_title: "Chỉnh sửa"
reading_time:
one: "{{ .Count }} phút"
other: "{{ .Count }} phút"
reading_time_title: "Thời gian đọc"
table_of_contents: "Mục lục"
word_count:
one: "{{ .Count }} từ"
other: "{{ .Count }} từ"
author:
byline_title: "Tác giả"
code:
copy: "Sao chép"
copied: "Đã sao chép"
error:
404_title: "Không tìm thấy trang :confused:"
404_error: "Lỗi 404"
404_description: "Có vẻ như trang bạn yêu cầu không tồn tại."
footer:
dark_appearance: "Chuyển sang giao diện tối"
light_appearance: "Chuyển sang giao diện sáng"
powered_by: "Cung cấp bởi {{ .Hugo }} &amp; {{ .Congo }}"
list:
externalurl_title: "Liên kết đến trang web bên ngoài"
no_articles: "Chưa có bài viết ở đây."
nav:
scroll_to_top_title: "Cuộn lên trên cùng"
skip_to_main: "Chuyển đến nội dung chính"
search:
open_button_title: "Tìm kiếm (/)"
close_button_title: "Đóng (Esc)"
input_placeholder: "Tìm kiếm"
sharing:
email: "Gửi qua email"
facebook: "Chia sẻ lên Facebook"
linkedin: "Chia sẻ lên LinkedIn"
mastodon: "Toot trên Mastodon"
pinterest: "Pin lên Pinterest"
reddit: "Gửi lên Reddit"
twitter: "Tweet lên Twitter"
telegram: "Chia sẻ lên Telegram"
line: "Chia sẻ lên LINE"
weibo: "Chia sẻ lên Weibo"
x-twitter: "Đăng lên X"
shortcode:
recent_articles: "Gần đây"
+1 -1
View File
@@ -10,7 +10,7 @@
>
{{- partial "head.html" . -}}
<body
class="m-auto flex h-screen max-w-7xl flex-col bg-neutral px-6 text-lg leading-7 text-neutral-900 sm:px-14 md:px-24 lg:px-32 dark:bg-neutral-800 dark:text-neutral"
class="m-auto flex h-screen max-w-7xl flex-col bg-neutral px-6 text-lg leading-7 text-neutral-900 dark:bg-neutral-800 dark:text-neutral sm:px-14 md:px-24 lg:px-32"
>
<div id="the-top" class="absolute flex self-center">
<a
+4 -4
View File
@@ -7,7 +7,7 @@
{{ if .Params.showBreadcrumbs | default (.Site.Params.article.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">
<h1 class="mb-8 mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">
{{ .Title | emojify }}
</h1>
{{ if or
@@ -17,14 +17,14 @@
(and (.Params.showReadingTime | default (.Site.Params.article.showReadingTime | default true)) (ne .ReadingTime 0))
(.Params.showEdit | default (.Site.Params.article.showEdit | default false))
}}
<div class="mb-12 mt-8 text-base text-neutral-500 print:hidden dark:text-neutral-400">
<div class="mb-10 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
{{ partial "article-meta.html" (dict "context" . "scope" "single") }}
</div>
{{ end }}
{{ with $feature }}
<div class="prose">
{{ $altText := $.Params.featureAlt | default $.Params.coverAlt | default "" }}
{{ $class := "mb-6 -mt-4 rounded-md" }}
{{ $class := "mb-6 rounded-md" }}
{{ $webp := $.Page.Site.Params.enableImageWebp | default true }}
{{ partial "picture.html" (dict "img" . "alt" $altText "class" $class "lazy" false "webp" $webp) }}
{{ with $.Params.coverCaption }}
@@ -36,7 +36,7 @@
<section class="prose mt-0 flex max-w-full flex-col dark:prose-invert lg:flex-row">
{{ if and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in .TableOfContents "<ul") }}
<div class="order-first px-0 lg:order-last lg:max-w-xs lg:ps-8">
<div class="toc pe-5 print:hidden lg:sticky lg:top-10">
<div class="toc pe-5 lg:sticky lg:top-10 print:hidden">
{{ partial "toc.html" . }}
</div>
</div>
+11
View File
@@ -10,5 +10,16 @@
src="{{ default "https://plausible.io/js/script.js" site.Params.plausibleAnalytics.script }}"
></script>
{{ end }}
{{ with site.Params.umamiAnalytics }}
{{- $region := "eu" }}
{{- if isset . "region" }}
{{- $region = .region }}
{{- end }}
<script
defer
src="https://{{ $region }}.umami.is/script.js"
data-website-id="{{ .site }}"
></script>
{{ end }}
{{ template "_internal/google_analytics.html" . }}
{{ end }}
+1 -1
View File
@@ -1,4 +1,4 @@
<ol class="text-sm text-neutral-500 print:hidden dark:text-neutral-400">
<ol class="text-sm text-neutral-500 dark:text-neutral-400 print:hidden">
{{ template "crumb" (dict "p1" . "p2" .) }}
</ol>
{{ define "crumb" }}
+1 -1
View File
@@ -1,7 +1,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="rgb(255,255,255)" />
<meta name="theme-color" content="{{ .Site.Params.defaultThemeColor | default "#ffffff" }}" />
{{/* Title */}}
{{ if .IsHome -}}
<title>{{ .Site.Title | emojify }}</title>
+1 -1
View File
@@ -1,4 +1,4 @@
<header class="py-6 font-semibold text-neutral-900 print:hidden sm:py-10 dark:text-neutral">
<header class="py-6 font-semibold text-neutral-900 dark:text-neutral sm:py-10 print:hidden">
<nav class="flex items-start justify-between sm:items-center">
{{/* Site logo/title */}}
<div class="flex flex-row items-center">
+1 -1
View File
@@ -1,4 +1,4 @@
<header class="py-6 font-semibold text-neutral-900 print:hidden sm:py-10 dark:text-neutral">
<header class="py-6 font-semibold text-neutral-900 dark:text-neutral sm:py-10 print:hidden">
<nav class="flex items-start justify-between sm:items-center">
{{/* Site logo/title */}}
<div class="z-40 flex flex-row items-center">
+1 -1
View File
@@ -1,4 +1,4 @@
<header class="py-6 font-semibold text-neutral-900 print:hidden sm:py-10 dark:text-neutral">
<header class="py-6 font-semibold text-neutral-900 dark:text-neutral sm:py-10 print:hidden">
<nav class="flex items-start justify-between sm:items-center">
{{/* Site logo/title */}}
<div class="z-40 flex flex-row items-center">
+1 -1
View File
@@ -1,6 +1,6 @@
<div
id="search-wrapper"
class="invisible fixed inset-0 z-50 flex h-screen w-screen cursor-default flex-col bg-neutral-500/50 p-4 backdrop-blur-sm sm:p-6 md:p-[10vh] lg:p-[12vh] dark:bg-neutral-900/50"
class="invisible fixed inset-0 z-50 flex h-screen w-screen cursor-default flex-col bg-neutral-500/50 p-4 backdrop-blur-sm dark:bg-neutral-900/50 sm:p-6 md:p-[10vh] lg:p-[12vh]"
data-url="{{ "" | absLangURL }}"
>
<div
+2 -2
View File
@@ -1,10 +1,10 @@
<details open class="-ms-5 mt-0 overflow-hidden rounded-lg ps-5">
<summary
class="-ms-5 block cursor-pointer bg-neutral-100 py-1 ps-5 text-lg font-semibold text-neutral-800 lg:hidden dark:bg-neutral-700 dark:text-neutral-100"
class="block cursor-pointer bg-neutral-100 py-1 ps-5 text-lg font-semibold text-neutral-800 dark:bg-neutral-700 dark:text-neutral-100 lg:hidden"
>
{{ i18n "article.table_of_contents" }}
</summary>
<div class="-ms-5 border-s border-dotted border-neutral-300 py-2 ps-5 dark:border-neutral-600">
<div class="border-s border-dotted border-neutral-300 py-2 ps-5 dark:border-neutral-600">
{{ .TableOfContents | emojify }}
</div>
</details>
+1 -1
View File
@@ -5,7 +5,7 @@
{{ $altText := .Get "alt" }}
{{ $caption := .Get "caption" }}
{{ $href := .Get "href" }}
{{ $class := .Get "class" }}
{{ $class := default "mx-auto my-0 rounded-md" (.Get "class") }}
{{ $file := $url.Path }}
{{ $img := .Page.Resources.GetMatch $file }}
+788 -55
View File
File diff suppressed because it is too large Load Diff
+12 -7
View File
@@ -1,6 +1,6 @@
{
"name": "hugo-congo-theme",
"version": "2.8.0",
"version": "2.8.2",
"description": "Congo theme for Hugo",
"scripts": {
"preinstall": "rimraf assets/lib",
@@ -9,7 +9,8 @@
"dev": "NODE_ENV=development ./node_modules/tailwindcss/lib/cli.js -i ./assets/css/main.css -o ./assets/css/compiled/main.css --jit -w",
"build": "NODE_ENV=production ./node_modules/tailwindcss/lib/cli.js -i ./assets/css/main.css -o ./assets/css/compiled/main.css --jit",
"example": "hugo server --bind 0.0.0.0 -p 8008 --source exampleSite --themesDir ../.. --buildDrafts -b http://localhost/congo/ ",
"lighthouse": "lhci autorun"
"lighthouse": "lhci autorun",
"add-icon": "node scripts/index.js add-icon"
},
"repository": {
"type": "git",
@@ -29,17 +30,18 @@
},
"homepage": "https://github.com/jpanther/congo#readme",
"devDependencies": {
"@tailwindcss/typography": "^0.5.10",
"@tailwindcss/typography": "^0.5.13",
"chart.js": "^4.4.2",
"fuse.js": "^7.0.0",
"katex": "^0.16.9",
"jsdom": "^23.0.1",
"katex": "^0.16.10",
"mermaid": "^10.9.0",
"prettier": "^3.2.5",
"prettier-plugin-go-template": "^0.0.15",
"prettier-plugin-tailwindcss": "^0.5.12",
"prettier-plugin-tailwindcss": "^0.5.14",
"quicklink": "^2.3.0",
"rimraf": "^5.0.5",
"tailwindcss": "^3.4.1",
"tailwindcss": "^3.4.3",
"vendor-copy": "^3.0.1"
},
"vendorCopy": [],
@@ -76,5 +78,8 @@
"from": "node_modules/quicklink/dist/quicklink.umd.js",
"to": "assets/lib/quicklink/quicklink.umd.js"
}
]
],
"dependencies": {
"@fortawesome/fontawesome-free": "^6.5.1"
}
}
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env node
const { program } = require("commander");
const { add_icon_to_congo } = require("./update_icon");
// Adds an icon to the project.
program
.command("add-icon <icon_name>")
.description("Add icon to the project")
.action(add_icon_to_congo);
program.parse(process.argv);
+93
View File
@@ -0,0 +1,93 @@
const jsdom = require("jsdom");
const fs = require("fs");
const SVG_FILE_DIR = "node_modules/@fortawesome/fontawesome-free/svgs/brands";
const DOC_DIR = "./exampleSite/content/samples/icons";
const DEFAULT_TABLE_DELIMITER = "| -------------------- | --------------------------------- |";
/**
* Saves an icon to the congo project and update documentation.
* @param {string} icon_name Icon name from Font Awesome to download
* @returns null
*/
const add_icon_to_congo = async (icon_name) => {
try {
const file = await get_file(icon_name);
const final_svg = modify_svg_string(file);
const icon_download_path = create_icon_download_path(icon_name);
save_file(icon_download_path, final_svg);
add_documentation(icon_name);
} catch (e) {
console.log(e);
return;
}
};
const modify_svg_string = (svg_string) => {
try {
dom = new jsdom.JSDOM(svg_string);
svg = dom.window.document.documentElement.querySelector("svg");
svg.querySelector("path").setAttribute("fill", "currentColor");
return svg.outerHTML;
} catch (e) {
throw new Error("Invalid SVG file" + e);
}
};
const create_icon_download_path = (icon_name) => {
return `./assets/icons/${icon_name}.svg`;
};
const get_file = async (url) => {
return fs.readFileSync(SVG_FILE_DIR + `/${url}.svg`, "utf8");
};
const save_file = (file_path, file) => {
console.log("Saving file at " + file_path + "...");
fs.writeFile(file_path, file, function (err) {
if (err) throw err;
console.log("File saved!");
});
};
const add_documentation = async (icon_name) => {
files = get_md_docs();
for (const file of files) {
const file_path = `${DOC_DIR}/${file}`;
const file_contents = fs.readFileSync(file_path, "utf8");
const file_result = process_file(file_contents, icon_name);
// Save file_result to file_path
fs.writeFile(file_path, file_result, function (err) {
if (err) throw err;
});
console.log(`Updated ${file_path}`);
}
};
/**
* Process the file contents to include the icon name.
* @param {string} file_contents contents of the documentation files.
* @returns {string} processed file contents.
*/
const process_file = (file_contents, icon_name) => {
const [headers, table] = file_contents.split(DEFAULT_TABLE_DELIMITER);
const table_rows = table
.split("\n")
.map((x) => x.trim())
.filter((row) => row !== "");
table_rows.push(create_table_row(icon_name));
table_rows.sort();
const new_table = table_rows.join("\n");
return `${headers.trimEnd()}\n${DEFAULT_TABLE_DELIMITER}\n${new_table}\n`;
};
const create_table_row = (name) => {
return `| ${name} | {{< icon ${name} >}} |`;
};
const get_md_docs = () => {
return fs.readdirSync(DOC_DIR).filter((file) => file.endsWith(".md"));
};
module.exports = { add_icon_to_congo };