Compare commits

...

34 Commits

Author SHA1 Message Date
Wen Junhua 3dc6dc05a6
Merge c8e20a219f into 4acfb7b76a 2024-03-09 12:57:07 +08:00
Wen Junhua c8e20a219f
Merge branch 'dev' into feat/add-icon-script 2024-03-09 12:57:04 +08:00
James Panther 4acfb7b76a
🔨 Preparing release v2.8.1 2024-03-09 15:37:15 +11:00
James Panther 33d34eea0f
🐛 Fix table of contents border missing
Fixes: #794
2024-03-09 15:34:56 +11:00
Wen Junhua e38ad5bb0d Merge branch 'feat/add-icon-script' of https://github.com/Jh123x/congo into feat/add-icon-script 2024-03-09 12:32:13 +08:00
Wen Junhua 7475198f86 feat: make the script offline 2024-03-09 12:32:04 +08:00
James Panther 088c913f67
🐛 Fix HTML table not full width on desktop
Fixes: #826
2024-03-09 15:26:31 +11:00
Wen Junhua aaccefebce
Merge branch 'dev' into feat/add-icon-script 2024-03-09 12:10:45 +08:00
James Panther fd49282446
🚸 Add `x-twitter` sharing links
Fixes: #809
2024-03-09 14:52:22 +11:00
James Panther 0510d8f655
📝 Update changelog 2024-03-09 14:23:45 +11:00
James Panther e2fa33ad46
🔀 Merge pull request #813 from tomy0000000/dev
🛠 fix: Space in rendered link
2024-03-09 14:02:23 +11:00
James Panther 21b554c341
🔀 Merge pull request #807 from Jh123x/fix/fix-author-params-in-chinese-translation
fix: fix chinese config settings
2024-03-09 14:00:55 +11:00
James Panther eec81f340f
🔀 Merge pull request #817 from jpanther/dependabot/npm_and_yarn/chart.js-4.4.2
📌 Bump chart.js from 4.4.1 to 4.4.2
2024-03-09 13:59:15 +11:00
James Panther 6bbcd04910
🔀 Merge pull request #825 from jpanther/dependabot/npm_and_yarn/mermaid-10.9.0
📌 Bump mermaid from 10.7.0 to 10.9.0
2024-03-09 13:58:48 +11:00
dependabot[bot] 8fa0ef1381 📦 Update packaged Mermaid 2024-03-09 13:55:38 +11:00
dependabot[bot] c943158c17 📌 Bump mermaid from 10.7.0 to 10.9.0
Bumps [mermaid](https://github.com/mermaid-js/mermaid) from 10.7.0 to 10.9.0.
- [Release notes](https://github.com/mermaid-js/mermaid/releases)
- [Changelog](https://github.com/mermaid-js/mermaid/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/mermaid-js/mermaid/compare/v10.7.0...v10.9.0)

---
updated-dependencies:
- dependency-name: mermaid
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-09 13:55:38 +11:00
James Panther 67a61da329
🔀 Merge pull request #824 from jpanther/dependabot/npm_and_yarn/prettier-plugin-tailwindcss-0.5.12
📌 Bump prettier-plugin-tailwindcss from 0.5.11 to 0.5.12
2024-03-09 13:54:54 +11:00
James Panther 4eb6c7ff61
🔀 Merge pull request #821 from Techwolf12/dev
Add techwolf12.nl as user of the theme
2024-03-09 13:53:35 +11:00
dependabot[bot] c3c7eb6048
📌 Bump prettier-plugin-tailwindcss from 0.5.11 to 0.5.12
Bumps [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) from 0.5.11 to 0.5.12.
- [Release notes](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/compare/v0.5.11...v0.5.12)

---
updated-dependencies:
- dependency-name: prettier-plugin-tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-06 22:38:08 +00:00
Christiaan de Die le Clercq cc3872f270
Add techwolf12.nl as user of the theme 2024-03-03 15:25:17 +01:00
dependabot[bot] 03a4d345f0 📦 Update packaged ChartJS 2024-02-28 22:25:40 +00:00
dependabot[bot] a22b1ad664
📌 Bump chart.js from 4.4.1 to 4.4.2
Bumps [chart.js](https://github.com/chartjs/Chart.js) from 4.4.1 to 4.4.2.
- [Release notes](https://github.com/chartjs/Chart.js/releases)
- [Commits](https://github.com/chartjs/Chart.js/compare/v4.4.1...v4.4.2)

---
updated-dependencies:
- dependency-name: chart.js
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-28 22:25:16 +00:00
Tomy Hsieh 0a6267c171
🛠 fix: Space in rendered link 2024-02-22 21:36:43 -05:00
Wen Junhua 4c31074d5c fix: fix config for chinese translation 2024-02-06 23:20:48 +08:00
Wen Junhua a19dc47b6a
Merge branch 'dev' into feat/add-icon-script 2024-01-23 23:34:35 +08:00
Wen Junhua 2cf1371c3e fix: remove debug logs 2023-12-31 13:26:09 +08:00
Wen Junhua a1a2e10481
Merge branch 'dev' into feat/add-icon-script 2023-12-31 13:24:13 +08:00
Wen Junhua 97a3f0064c feat: port script to node 2023-12-31 13:24:02 +08:00
Wen Junhua a7fa3be37d
Merge branch 'dev' into feat/add-icon-script 2023-12-26 17:19:40 +09:00
Wen Junhua 679898570c docs: update script docs 2023-12-25 23:27:14 +09:00
Wen Junhua db07288d01 chore: clean up code 2023-12-25 23:24:47 +09:00
Wen Junhua 3c81e00bed chore: clean up code 2023-12-25 23:17:40 +09:00
Wen Junhua eb527de54b feat: add docs update 2023-12-25 23:13:32 +09:00
Wen Junhua 3a998b4598 feat: add script to auto update icons 2023-12-25 22:17:25 +09:00
45 changed files with 1646 additions and 416 deletions

View File

@ -6,6 +6,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased] ## [Unreleased]
## [2.8.1] - 2024-03-09
### Changed
- Upgrade to ChartJS v4.4.2 ([#817](https://github.com/jpanther/congo/pull/817))
- Upgrade to Mermaid v10.9.0 ([#825](https://github.com/jpanther/congo/pull/825))
### 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 ## [2.8.0] - 2024-01-22
### Added ### Added
@ -841,7 +856,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Advanced customisation using simple Tailwind colour definitions and styles - Advanced customisation using simple Tailwind colour definitions and styles
- Fully documented - Fully documented
[Unreleased]: https://github.com/jpanther/congo/compare/v2.8.0...HEAD [Unreleased]: https://github.com/jpanther/congo/compare/v2.8.1...HEAD
[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.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.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 [2.7.5]: https://github.com/jpanther/congo/compare/v2.7.4...v2.7.5

View File

@ -1,4 +1,4 @@
/*! Congo v2.8.0 | MIT License | https://github.com/jpanther/congo */ /*! Congo v2.8.1 | MIT License | https://github.com/jpanther/congo */
/*! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com */ /*! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com */
@ -1254,13 +1254,18 @@ table {
overflow: auto; overflow: auto;
} }
@media (min-width: 768px) {
table {
display: table;
}
}
/* 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; word-wrap: break-word;
/* All browsers since IE 5.5+ */ /* All browsers since IE 5.5+ */
overflow-wrap: break-word; overflow-wrap: break-word;
/* Renamed property in CSS3 draft spec */
} }
/* -- Chroma Highlight -- */ /* -- Chroma Highlight -- */

View File

@ -1,4 +1,4 @@
/*! Congo v2.8.0 | MIT License | https://github.com/jpanther/congo */ /*! Congo v2.8.1 | MIT License | https://github.com/jpanther/congo */
@tailwind base; @tailwind base;
@tailwind components; @tailwind components;
@ -109,14 +109,13 @@ body:has(#menu-controller:checked) {
/* Fix long tables breaking out of article on mobile */ /* Fix long tables breaking out of article on mobile */
table { table {
display: block; @apply block overflow-auto md:table;
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 */ @apply break-words;
} }
/* -- Chroma Highlight -- */ /* -- Chroma Highlight -- */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -51,7 +51,7 @@ fingerprintAlgorithm = "sha256"
showTaxonomies = false showTaxonomies = false
showWordCount = false showWordCount = false
showComments = false showComments = false
# sharingLinks = ["facebook", "twitter", "mastodon", "pinterest", "reddit", "linkedin", "email", "telegram", "line", "weibo"] # sharingLinks = ["facebook", "x-twitter", "mastodon", "pinterest", "reddit", "linkedin", "email", "telegram", "line", "weibo"]
[list] [list]
showBreadcrumbs = false showBreadcrumbs = false

View File

@ -34,6 +34,11 @@
"title": "sharing.twitter", "title": "sharing.twitter",
"url": "https://twitter.com/intent/tweet/?url=%s&text=%s" "url": "https://twitter.com/intent/tweet/?url=%s&text=%s"
}, },
"x-twitter": {
"icon": "x-twitter",
"title": "sharing.x-twitter",
"url": "https://x.com/intent/tweet/?url=%s&text=%s"
},
"telegram": { "telegram": {
"icon": "telegram", "icon": "telegram",
"title": "sharing.telegram", "title": "sharing.telegram",

View File

@ -12,7 +12,7 @@ copyright = "&copy; 2023 Congo contributors"
mainSections = ["samples"] mainSections = ["samples"]
description = "一款基于Tailwindcss的强大且轻量的Hugo主题" description = "一款基于Tailwindcss的强大且轻量的Hugo主题"
[author] [params.author]
name = "Congo" name = "Congo"
image = "img/author.jpg" image = "img/author.jpg"
headline = "非凡的主题!" headline = "非凡的主题!"

View File

@ -162,7 +162,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
|`article.showTaxonomies`|`false`|Whether or not the taxonomies related to this article are displayed.| |`article.showTaxonomies`|`false`|Whether or not the taxonomies related to this article are displayed.|
|`article.showWordCount`|`false`|Whether or not article word counts are displayed.| |`article.showWordCount`|`false`|Whether or not article word counts are displayed.|
|`article.showComments`|`false`|Whether or not the [comments partial]({{< ref "partials#comments" >}}) is included after the article footer.| |`article.showComments`|`false`|Whether or not the [comments partial]({{< ref "partials#comments" >}}) is included after the article footer.|
|`article.sharingLinks`|_Not set_|An array of sharing links to display at the end of each article. Valid options include `facebook`, `twitter`, `mastodon`, `pinterest`, `reddit`, `linkedin`, `email`, `telegram` and `line`. When not provided, or set to `false`, no links will be displayed.| |`article.sharingLinks`|_Not set_|An array of sharing links to display at the end of each article. Valid options include `facebook`, `x-twitter`, `mastodon`, `pinterest`, `reddit`, `linkedin`, `email`, `telegram` and `line`. When not provided, or set to `false`, no links will be displayed.|
|`list.showBreadcrumbs`|`false`|Whether or not breadcrumbs are displayed in the header on list pages.| |`list.showBreadcrumbs`|`false`|Whether or not breadcrumbs are displayed in the header on list pages.|
|`list.showTableOfContents`|`false`|Whether or not the table of contents is displayed on list pages.| |`list.showTableOfContents`|`false`|Whether or not the table of contents is displayed on list pages.|
|`list.showTaxonomies`|`false`|Whether or not the taxonomies related to this article are displayed on list pages.| |`list.showTaxonomies`|`false`|Whether or not the taxonomies related to this article are displayed on list pages.|

View File

@ -72,5 +72,6 @@ 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 | | [aminelch.github.io](https://aminelch.github.io) | Personal Site and Blog |
| [robertboscacci.com](https://robertboscacci.com) | Personal Site and Blog | | [robertboscacci.com](https://robertboscacci.com) | Personal Site and Blog |
| [gorbe.io](https://www.gorbe.io) | Business Site and Blog | | [gorbe.io](https://www.gorbe.io) | Business Site and Blog |
| [techwolf12.nl](https://techwolf12.nl) | 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). **¿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).

View File

@ -72,5 +72,6 @@ Congoを使用して構築された実際のウェブサイト。
| [aminelch.github.io](https://aminelch.github.io) | Personal Site and Blog | | [aminelch.github.io](https://aminelch.github.io) | Personal Site and Blog |
| [robertboscacci.com](https://robertboscacci.com) | Personal Site and Blog | | [robertboscacci.com](https://robertboscacci.com) | Personal Site and Blog |
| [gorbe.io](https://www.gorbe.io) | Business Site and Blog | | [gorbe.io](https://www.gorbe.io) | Business Site and Blog |
| [techwolf12.nl](https://techwolf12.nl) | Personal Site and Tech Blog |
**Congoを使っていますか** あなたのウェブサイトを加えるために[Pull Request](https://github.com/jpanther/congo/blob/dev/exampleSite/content/users/index.md)を投げてください。 **Congoを使っていますか** あなたのウェブサイトを加えるために[Pull Request](https://github.com/jpanther/congo/blob/dev/exampleSite/content/users/index.md)を投げてください。

View File

@ -72,5 +72,6 @@ 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 | | [aminelch.github.io](https://aminelch.github.io) | Personal Site and Blog |
| [robertboscacci.com](https://robertboscacci.com) | Personal Site and Blog | | [robertboscacci.com](https://robertboscacci.com) | Personal Site and Blog |
| [gorbe.io](https://www.gorbe.io) | Business Site and Blog | | [gorbe.io](https://www.gorbe.io) | Business Site and Blog |
| [techwolf12.nl](https://techwolf12.nl) | Personal Site and Tech Blog |
**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). **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).

View File

@ -72,5 +72,6 @@ showEdit: false
| [aminelch.github.io](https://aminelch.github.io) | Personal Site and Blog | | [aminelch.github.io](https://aminelch.github.io) | Personal Site and Blog |
| [robertboscacci.com](https://robertboscacci.com) | Personal Site and Blog | | [robertboscacci.com](https://robertboscacci.com) | Personal Site and Blog |
| [gorbe.io](https://www.gorbe.io) | Business Site and Blog | | [gorbe.io](https://www.gorbe.io) | Business Site and Blog |
| [techwolf12.nl](https://techwolf12.nl) | Personal Site and Tech Blog |
**想成为Congo的用户** 要将您的网站添加到此列表中,请提交[Pull Request](https://github.com/jpanther/congo/blob/dev/exampleSite/content/users/index.md)来添加。 **想成为Congo的用户** 要将您的网站添加到此列表中,请提交[Pull Request](https://github.com/jpanther/congo/blob/dev/exampleSite/content/users/index.md)来添加。

View File

@ -54,6 +54,7 @@ sharing:
telegram: "شارك على تيليجرام" telegram: "شارك على تيليجرام"
line: "شارك على لاين" line: "شارك على لاين"
# weibo: "Share on Weibo" # weibo: "Share on Weibo"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "حديثًا" recent_articles: "حديثًا"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Споделете в Telegram" telegram: "Споделете в Telegram"
line: "Споделете в LINE" line: "Споделете в LINE"
weibo: "Споделете в Weibo" weibo: "Споделете в Weibo"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Последни" recent_articles: "Последни"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "টেলিগ্রামে শেয়ার করুন" telegram: "টেলিগ্রামে শেয়ার করুন"
line: "লাইনে শেয়ার করুন" line: "লাইনে শেয়ার করুন"
# weibo: "Share on Weibo" # weibo: "Share on Weibo"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "সাম্প্রতিক" recent_articles: "সাম্প্রতিক"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Sdílejte na Telegram" telegram: "Sdílejte na Telegram"
line: "Sdílejte na LINE" line: "Sdílejte na LINE"
weibo: "Sdílejte na Weibo" weibo: "Sdílejte na Weibo"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Nedávné" recent_articles: "Nedávné"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Auf Telegram teilen" telegram: "Auf Telegram teilen"
line: "Auf LINE teilen" line: "Auf LINE teilen"
weibo: "Auf Weibo teilen" weibo: "Auf Weibo teilen"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Neue Beiträge" recent_articles: "Neue Beiträge"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Share on Telegram" telegram: "Share on Telegram"
line: "Share on LINE" line: "Share on LINE"
weibo: "Share on Weibo" weibo: "Share on Weibo"
x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Recent" recent_articles: "Recent"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Compartir en Telegram" telegram: "Compartir en Telegram"
line: "Compartir en LINE" line: "Compartir en LINE"
weibo: "Compartir en Weibo" weibo: "Compartir en Weibo"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Reciente" recent_articles: "Reciente"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Jaa Telegramissa" telegram: "Jaa Telegramissa"
line: "Jaa LINEssä" line: "Jaa LINEssä"
weibo: "Jaa Weibossä" weibo: "Jaa Weibossä"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Viimeaikaiset" recent_articles: "Viimeaikaiset"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Partager sur Telegram" telegram: "Partager sur Telegram"
line: "Partager sur LINE" line: "Partager sur LINE"
weibo: "Partager sur Weibo" weibo: "Partager sur Weibo"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Articles récents" recent_articles: "Articles récents"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "שיתוף בטלגרם" telegram: "שיתוף בטלגרם"
line: "שיתוף בליין" line: "שיתוף בליין"
# weibo: "Share on Weibo" # weibo: "Share on Weibo"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "חדשים" recent_articles: "חדשים"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Megosztás a Telegramon" telegram: "Megosztás a Telegramon"
line: "Megosztás a LINE-on" line: "Megosztás a LINE-on"
weibo: "Megosztás a Weibo-on" weibo: "Megosztás a Weibo-on"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Friss" recent_articles: "Friss"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Bagikan ke Telegram" telegram: "Bagikan ke Telegram"
line: "Bagikan ke LINE" line: "Bagikan ke LINE"
weibo: "Bagikan ke Weibo" weibo: "Bagikan ke Weibo"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Terbaru" recent_articles: "Terbaru"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Condividi su Telegram" telegram: "Condividi su Telegram"
line: "Condividi su LINE" line: "Condividi su LINE"
weibo: "Condividi su Weibo" weibo: "Condividi su Weibo"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Recenti" recent_articles: "Recenti"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Telegramでシェアする" telegram: "Telegramでシェアする"
line: "LINEでシェアする" line: "LINEでシェアする"
weibo: "Weiboでシェアする" weibo: "Weiboでシェアする"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "最近の記事" recent_articles: "最近の記事"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Telegram에 공유하기" telegram: "Telegram에 공유하기"
line: "LINE에 공유하기" line: "LINE에 공유하기"
weibo: "Weibo에 공유하기" weibo: "Weibo에 공유하기"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "최신 글" recent_articles: "최신 글"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Deel op Telegram" telegram: "Deel op Telegram"
line: "Deel op LINE" line: "Deel op LINE"
weibo: "Deel op Weibo" weibo: "Deel op Weibo"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Recent" recent_articles: "Recent"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Udostępnij na Telegram" telegram: "Udostępnij na Telegram"
line: "Udostępnij na LINE" line: "Udostępnij na LINE"
weibo: "Udostępnij na Weibo" weibo: "Udostępnij na Weibo"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Ostatnie" recent_articles: "Ostatnie"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Compartilhar pelo Telegram" telegram: "Compartilhar pelo Telegram"
line: "Compartilhar pelo LINE" line: "Compartilhar pelo LINE"
weibo: "Compartilhar pelo weibo" weibo: "Compartilhar pelo weibo"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Recente" recent_articles: "Recente"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Partilhar pelo Telegram" telegram: "Partilhar pelo Telegram"
line: "Partilhar pelo LINE" line: "Partilhar pelo LINE"
weibo: "Partilhar pelo Weibo" weibo: "Partilhar pelo Weibo"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Recente" recent_articles: "Recente"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Trimite pe Telegram" telegram: "Trimite pe Telegram"
line: "Trimite pe LINE" line: "Trimite pe LINE"
weibo: "Trimite pe Weibo" weibo: "Trimite pe Weibo"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Cele mai noi" recent_articles: "Cele mai noi"

View File

@ -58,6 +58,7 @@ sharing:
telegram: "Поделиться на Telegram" telegram: "Поделиться на Telegram"
line: "Поделиться на LINE" line: "Поделиться на LINE"
weibo: "Поделиться на Weibo" weibo: "Поделиться на Weibo"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Последние" recent_articles: "Последние"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "Zdieľaj na Telegram" telegram: "Zdieľaj na Telegram"
line: "Zdieľaj na LINE" line: "Zdieľaj na LINE"
weibo: "Zdieľaj na Weibo" weibo: "Zdieľaj na Weibo"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Nedávne" recent_articles: "Nedávne"

View File

@ -53,6 +53,7 @@ sharing:
telegram: "Telegram'da paylaş" telegram: "Telegram'da paylaş"
line: "LINE'da paylaş" line: "LINE'da paylaş"
weibo: "Weibo'da paylaş" weibo: "Weibo'da paylaş"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Güncel" recent_articles: "Güncel"

View File

@ -58,6 +58,7 @@ sharing:
telegram: "Поширити на Telegram" telegram: "Поширити на Telegram"
line: "Поширити на LINE" line: "Поширити на LINE"
weibo: "Поширити на Weibo" weibo: "Поширити на Weibo"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "Недавні дописи" recent_articles: "Недавні дописи"

View File

@ -53,6 +53,7 @@ sharing:
telegram: "分享到 Telegram" telegram: "分享到 Telegram"
line: "分享到 LINE" line: "分享到 LINE"
weibo: "分享到 微博" weibo: "分享到 微博"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "最近的文章" recent_articles: "最近的文章"

View File

@ -54,6 +54,7 @@ sharing:
telegram: "分享到 Telegram" telegram: "分享到 Telegram"
line: "分享到 LINE" line: "分享到 LINE"
weibo: "分享到 微博" weibo: "分享到 微博"
# x-twitter: "Post on X"
shortcode: shortcode:
recent_articles: "最近的文章" recent_articles: "最近的文章"

View File

@ -1,9 +1,9 @@
{{- $link := .Destination -}} {{- $link := .Destination -}}
{{- $isRemote := strings.HasPrefix $link "http" -}} {{- $isRemote := strings.HasPrefix $link "http" -}}
{{- if not $isRemote }} {{- if not $isRemote }}
{{ $url := urls.Parse .Destination }} {{- $url := urls.Parse .Destination -}}
{{- if $url.Path }} {{- if $url.Path }}
{{ $fragment := "" }} {{- $fragment := "" }}
{{- with $url.Fragment }}{{ $fragment = printf "#%s" . }}{{ end -}} {{- with $url.Fragment }}{{ $fragment = printf "#%s" . }}{{ end -}}
{{- with .Page.GetPage $url.Path }} {{- with .Page.GetPage $url.Path }}
{{ $link = printf "%s%s" .RelPermalink $fragment }} {{ $link = printf "%s%s" .RelPermalink $fragment }}
@ -14,5 +14,4 @@
{{ end -}} {{ end -}}
{{ end -}} {{ end -}}
{{ end -}} {{ end -}}
<!-- prettier-ignore --> <!-- prettier-ignore --><a href="{{ $link | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if $isRemote }} target="_blank" rel="noreferrer"{{ end }}>{{- .Text | safeHTML -}}</a>
<a href="{{ $link | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if $isRemote }} target="_blank" rel="noreferrer"{{ end }}>{{- .Text | safeHTML -}}</a>

View File

@ -1,10 +1,10 @@
<details open class="-ms-5 mt-0 overflow-hidden rounded-lg ps-5"> <details open class="-ms-5 mt-0 overflow-hidden rounded-lg ps-5">
<summary <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" }} {{ i18n "article.table_of_contents" }}
</summary> </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 }} {{ .TableOfContents | emojify }}
</div> </div>
</details> </details>

881
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "hugo-congo-theme", "name": "hugo-congo-theme",
"version": "2.8.0", "version": "2.8.1",
"description": "Congo theme for Hugo", "description": "Congo theme for Hugo",
"scripts": { "scripts": {
"preinstall": "rimraf assets/lib", "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", "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", "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/ ", "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": { "repository": {
"type": "git", "type": "git",
@ -30,13 +31,14 @@
"homepage": "https://github.com/jpanther/congo#readme", "homepage": "https://github.com/jpanther/congo#readme",
"devDependencies": { "devDependencies": {
"@tailwindcss/typography": "^0.5.10", "@tailwindcss/typography": "^0.5.10",
"chart.js": "^4.4.1", "chart.js": "^4.4.2",
"fuse.js": "^7.0.0", "fuse.js": "^7.0.0",
"jsdom": "^23.0.1",
"katex": "^0.16.9", "katex": "^0.16.9",
"mermaid": "^10.7.0", "mermaid": "^10.9.0",
"prettier": "^3.2.5", "prettier": "^3.2.5",
"prettier-plugin-go-template": "^0.0.15", "prettier-plugin-go-template": "^0.0.15",
"prettier-plugin-tailwindcss": "^0.5.11", "prettier-plugin-tailwindcss": "^0.5.12",
"quicklink": "^2.3.0", "quicklink": "^2.3.0",
"rimraf": "^5.0.5", "rimraf": "^5.0.5",
"tailwindcss": "^3.4.1", "tailwindcss": "^3.4.1",
@ -76,5 +78,8 @@
"from": "node_modules/quicklink/dist/quicklink.umd.js", "from": "node_modules/quicklink/dist/quicklink.umd.js",
"to": "assets/lib/quicklink/quicklink.umd.js" "to": "assets/lib/quicklink/quicklink.umd.js"
} }
] ],
"dependencies": {
"@fortawesome/fontawesome-free": "^6.5.1"
}
} }

11
scripts/index.js 100644
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);

View File

@ -0,0 +1,90 @@
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 };