Compare commits

..

No commits in common. "c8e20a219fd2ce2f1bb2cd73ed254a49b7023a7d" and "a19dc47b6adaeb7a968348860eef439c2d60a7b4" have entirely different histories.

44 changed files with 427 additions and 836 deletions

View File

@ -6,21 +6,6 @@ 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
@ -856,8 +841,7 @@ 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.1...HEAD [Unreleased]: https://github.com/jpanther/congo/compare/v2.8.0...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.1 | MIT License | https://github.com/jpanther/congo */ /*! Congo v2.8.0 | 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,18 +1254,13 @@ 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.1 | MIT License | https://github.com/jpanther/congo */ /*! Congo v2.8.0 | MIT License | https://github.com/jpanther/congo */
@tailwind base; @tailwind base;
@tailwind components; @tailwind components;
@ -109,13 +109,14 @@ 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 {
@apply block overflow-auto md:table; display: block;
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+ */
@apply break-words; overflow-wrap: break-word; /* Renamed property in CSS3 draft spec */
} }
/* -- 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", "x-twitter", "mastodon", "pinterest", "reddit", "linkedin", "email", "telegram", "line", "weibo"] # sharingLinks = ["facebook", "twitter", "mastodon", "pinterest", "reddit", "linkedin", "email", "telegram", "line", "weibo"]
[list] [list]
showBreadcrumbs = false showBreadcrumbs = false

View File

@ -34,11 +34,6 @@
"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 = "© 2023 Congo contributors"
mainSections = ["samples"] mainSections = ["samples"]
description = "一款基于Tailwindcss的强大且轻量的Hugo主题" description = "一款基于Tailwindcss的强大且轻量的Hugo主题"
[params.author] [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`, `x-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`, `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

@ -71,7 +71,5 @@ La lista a continuación es solo un puñado de sitios web creados con el tema Co
| [stupidjoey.net](https://stupidjoey.net) | Personal Site and Tech blog | | [stupidjoey.net](https://stupidjoey.net) | Personal Site and Tech blog |
| [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 |
| [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

@ -71,7 +71,5 @@ Congoを使用して構築された実際のウェブサイト。
| [stupidjoey.net](https://stupidjoey.net) | Personal Site and Tech blog | | [stupidjoey.net](https://stupidjoey.net) | Personal Site and Tech blog |
| [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 |
| [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

@ -71,7 +71,5 @@ The list below is just a handful of the websites that are built using the Congo
| [stupidjoey.net](https://stupidjoey.net) | Personal Site and Tech blog | | [stupidjoey.net](https://stupidjoey.net) | Personal Site and Tech blog |
| [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 |
| [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

@ -71,7 +71,5 @@ showEdit: false
| [stupidjoey.net](https://stupidjoey.net) | Personal Site and Tech blog | | [stupidjoey.net](https://stupidjoey.net) | Personal Site and Tech blog |
| [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 |
| [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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +54,6 @@ 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,7 +58,6 @@ 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,7 +54,6 @@ 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,7 +53,6 @@ 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,7 +58,6 @@ 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,7 +53,6 @@ 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,7 +54,6 @@ 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,4 +14,5 @@
{{ end -}} {{ end -}}
{{ end -}} {{ end -}}
{{ end -}} {{ end -}}
<!-- prettier-ignore --><a href="{{ $link | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if $isRemote }} target="_blank" rel="noreferrer"{{ end }}>{{- .Text | safeHTML -}}</a> <!-- prettier-ignore -->
<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="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" 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"
> >
{{ i18n "article.table_of_contents" }} {{ i18n "article.table_of_contents" }}
</summary> </summary>
<div class="border-s border-dotted border-neutral-300 py-2 ps-5 dark:border-neutral-600"> <div class="-ms-5 border-s border-dotted border-neutral-300 py-2 ps-5 dark:border-neutral-600">
{{ .TableOfContents | emojify }} {{ .TableOfContents | emojify }}
</div> </div>
</details> </details>

156
package-lock.json generated
View File

@ -1,27 +1,24 @@
{ {
"name": "hugo-congo-theme", "name": "hugo-congo-theme",
"version": "2.8.0", "version": "2.7.6",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hugo-congo-theme", "name": "hugo-congo-theme",
"version": "2.8.0", "version": "2.7.6",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"dependencies": {
"@fortawesome/fontawesome-free": "^6.5.1"
},
"devDependencies": { "devDependencies": {
"@tailwindcss/typography": "^0.5.10", "@tailwindcss/typography": "^0.5.10",
"chart.js": "^4.4.2", "chart.js": "^4.4.1",
"fuse.js": "^7.0.0", "fuse.js": "^7.0.0",
"jsdom": "^23.0.1", "jsdom": "^23.0.1",
"katex": "^0.16.9", "katex": "^0.16.9",
"mermaid": "^10.9.0", "mermaid": "^10.7.0",
"prettier": "^3.2.5", "prettier": "^3.2.4",
"prettier-plugin-go-template": "^0.0.15", "prettier-plugin-go-template": "^0.0.15",
"prettier-plugin-tailwindcss": "^0.5.12", "prettier-plugin-tailwindcss": "^0.5.11",
"quicklink": "^2.3.0", "quicklink": "^2.3.0",
"rimraf": "^5.0.5", "rimraf": "^5.0.5",
"tailwindcss": "^3.4.1", "tailwindcss": "^3.4.1",
@ -49,15 +46,6 @@
"integrity": "sha512-Tbsj02wXCbqGmzdnXNk0SOF19ChhRU70BsroIi4Pm6Ehp56in6vch94mfbdQ17DozxkL3BAVjbZ4Qc1a0HFRAg==", "integrity": "sha512-Tbsj02wXCbqGmzdnXNk0SOF19ChhRU70BsroIi4Pm6Ehp56in6vch94mfbdQ17DozxkL3BAVjbZ4Qc1a0HFRAg==",
"dev": true "dev": true
}, },
"node_modules/@fortawesome/fontawesome-free": {
"version": "6.5.1",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.5.1.tgz",
"integrity": "sha512-CNy5vSwN3fsUStPRLX7fUYojyuzoEMSXPl7zSLJ8TgtRfjv24LOnOWKT2zYwaHZCJGkdyRnTmstR0P+Ah503Gw==",
"hasInstallScript": true,
"engines": {
"node": ">=6"
}
},
"node_modules/@isaacs/cliui": { "node_modules/@isaacs/cliui": {
"version": "8.0.2", "version": "8.0.2",
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
@ -369,15 +357,15 @@
} }
}, },
"node_modules/chart.js": { "node_modules/chart.js": {
"version": "4.4.2", "version": "4.4.1",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.2.tgz", "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.1.tgz",
"integrity": "sha512-6GD7iKwFpP5kbSD4MeRRRlTnQvxfQREy36uEtm1hzHzcOqwWx0YEHuspuoNlslu+nciLIB7fjjsHkUv/FzFcOg==", "integrity": "sha512-C74QN1bxwV1v2PEujhmKjOZ7iUM4w6BWs23Md/6aOZZSlwMzeCIDGuZay++rBgChYru7/+QFeoQW0fQoP534Dg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@kurkle/color": "^0.3.0" "@kurkle/color": "^0.3.0"
}, },
"engines": { "engines": {
"pnpm": ">=8" "pnpm": ">=7"
} }
}, },
"node_modules/chokidar": { "node_modules/chokidar": {
@ -512,9 +500,9 @@
} }
}, },
"node_modules/cytoscape": { "node_modules/cytoscape": {
"version": "3.28.1", "version": "3.23.0",
"resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.28.1.tgz", "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.23.0.tgz",
"integrity": "sha512-xyItz4O/4zp9/239wCcH8ZcFuuZooEeF8KHRmzjDfGdXsj3OG9MFSMA0pJE0uX3uCN/ygof6hHf4L7lst+JaDg==", "integrity": "sha512-gRZqJj/1kiAVPkrVFvz/GccxsXhF3Qwpptl32gKKypO4IlqnKBjTOu+HbXtEggSGzC5KCaHp3/F7GgENrtsFkA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"heap": "^0.2.6", "heap": "^0.2.6",
@ -536,6 +524,33 @@
"cytoscape": "^3.2.0" "cytoscape": "^3.2.0"
} }
}, },
"node_modules/cytoscape-fcose": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/cytoscape-fcose/-/cytoscape-fcose-2.2.0.tgz",
"integrity": "sha512-ki1/VuRIHFCzxWNrsshHYPs6L7TvLu3DL+TyIGEsRcvVERmxokbf5Gdk7mFxZnTdiGtnA4cfSmjZJMviqSuZrQ==",
"dev": true,
"dependencies": {
"cose-base": "^2.2.0"
},
"peerDependencies": {
"cytoscape": "^3.2.0"
}
},
"node_modules/cytoscape-fcose/node_modules/cose-base": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/cose-base/-/cose-base-2.2.0.tgz",
"integrity": "sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g==",
"dev": true,
"dependencies": {
"layout-base": "^2.0.0"
}
},
"node_modules/cytoscape-fcose/node_modules/layout-base": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/layout-base/-/layout-base-2.0.1.tgz",
"integrity": "sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg==",
"dev": true
},
"node_modules/d3": { "node_modules/d3": {
"version": "7.8.4", "version": "7.8.4",
"resolved": "https://registry.npmjs.org/d3/-/d3-7.8.4.tgz", "resolved": "https://registry.npmjs.org/d3/-/d3-7.8.4.tgz",
@ -1676,23 +1691,23 @@
} }
}, },
"node_modules/mermaid": { "node_modules/mermaid": {
"version": "10.9.0", "version": "10.7.0",
"resolved": "https://registry.npmjs.org/mermaid/-/mermaid-10.9.0.tgz", "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-10.7.0.tgz",
"integrity": "sha512-swZju0hFox/B/qoLKK0rOxxgh8Cf7rJSfAUc1u8fezVihYMvrJAS45GzAxTVf4Q+xn9uMgitBcmWk7nWGXOs/g==", "integrity": "sha512-PsvGupPCkN1vemAAjScyw4pw34p4/0dZkSrqvAB26hUvJulOWGIwt35FZWmT9wPIi4r0QLa5X0PB4YLIGn0/YQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@braintree/sanitize-url": "^6.0.1", "@braintree/sanitize-url": "^6.0.1",
"@types/d3-scale": "^4.0.3", "@types/d3-scale": "^4.0.3",
"@types/d3-scale-chromatic": "^3.0.0", "@types/d3-scale-chromatic": "^3.0.0",
"cytoscape": "^3.28.1", "cytoscape": "^3.23.0",
"cytoscape-cose-bilkent": "^4.1.0", "cytoscape-cose-bilkent": "^4.1.0",
"cytoscape-fcose": "^2.1.0",
"d3": "^7.4.0", "d3": "^7.4.0",
"d3-sankey": "^0.12.3", "d3-sankey": "^0.12.3",
"dagre-d3-es": "7.0.10", "dagre-d3-es": "7.0.10",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"dompurify": "^3.0.5", "dompurify": "^3.0.5",
"elkjs": "^0.9.0", "elkjs": "^0.9.0",
"katex": "^0.16.9",
"khroma": "^2.0.0", "khroma": "^2.0.0",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"mdast-util-from-markdown": "^1.3.0", "mdast-util-from-markdown": "^1.3.0",
@ -2538,9 +2553,9 @@
"dev": true "dev": true
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "3.2.5", "version": "3.2.4",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz",
"integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==",
"dev": true, "dev": true,
"bin": { "bin": {
"prettier": "bin/prettier.cjs" "prettier": "bin/prettier.cjs"
@ -2568,9 +2583,9 @@
} }
}, },
"node_modules/prettier-plugin-tailwindcss": { "node_modules/prettier-plugin-tailwindcss": {
"version": "0.5.12", "version": "0.5.11",
"resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.12.tgz", "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.11.tgz",
"integrity": "sha512-o74kiDBVE73oHW+pdkFSluHBL3cYEvru5YgEqNkBMFF7Cjv+w1vI565lTlfoJT4VLWDe0FMtZ7FkE/7a4pMXSQ==", "integrity": "sha512-AvI/DNyMctyyxGOjyePgi/gqj5hJYClZ1avtQvLlqMT3uDZkRbi4HhGUpok3DRzv9z7Lti85Kdj3s3/1CeNI0w==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=14.21.3" "node": ">=14.21.3"
@ -2588,7 +2603,6 @@
"prettier-plugin-marko": "*", "prettier-plugin-marko": "*",
"prettier-plugin-organize-attributes": "*", "prettier-plugin-organize-attributes": "*",
"prettier-plugin-organize-imports": "*", "prettier-plugin-organize-imports": "*",
"prettier-plugin-sort-imports": "*",
"prettier-plugin-style-order": "*", "prettier-plugin-style-order": "*",
"prettier-plugin-svelte": "*" "prettier-plugin-svelte": "*"
}, },
@ -2626,9 +2640,6 @@
"prettier-plugin-organize-imports": { "prettier-plugin-organize-imports": {
"optional": true "optional": true
}, },
"prettier-plugin-sort-imports": {
"optional": true
},
"prettier-plugin-style-order": { "prettier-plugin-style-order": {
"optional": true "optional": true
}, },
@ -3610,11 +3621,6 @@
"integrity": "sha512-Tbsj02wXCbqGmzdnXNk0SOF19ChhRU70BsroIi4Pm6Ehp56in6vch94mfbdQ17DozxkL3BAVjbZ4Qc1a0HFRAg==", "integrity": "sha512-Tbsj02wXCbqGmzdnXNk0SOF19ChhRU70BsroIi4Pm6Ehp56in6vch94mfbdQ17DozxkL3BAVjbZ4Qc1a0HFRAg==",
"dev": true "dev": true
}, },
"@fortawesome/fontawesome-free": {
"version": "6.5.1",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.5.1.tgz",
"integrity": "sha512-CNy5vSwN3fsUStPRLX7fUYojyuzoEMSXPl7zSLJ8TgtRfjv24LOnOWKT2zYwaHZCJGkdyRnTmstR0P+Ah503Gw=="
},
"@isaacs/cliui": { "@isaacs/cliui": {
"version": "8.0.2", "version": "8.0.2",
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
@ -3870,9 +3876,9 @@
"dev": true "dev": true
}, },
"chart.js": { "chart.js": {
"version": "4.4.2", "version": "4.4.1",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.2.tgz", "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.1.tgz",
"integrity": "sha512-6GD7iKwFpP5kbSD4MeRRRlTnQvxfQREy36uEtm1hzHzcOqwWx0YEHuspuoNlslu+nciLIB7fjjsHkUv/FzFcOg==", "integrity": "sha512-C74QN1bxwV1v2PEujhmKjOZ7iUM4w6BWs23Md/6aOZZSlwMzeCIDGuZay++rBgChYru7/+QFeoQW0fQoP534Dg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@kurkle/color": "^0.3.0" "@kurkle/color": "^0.3.0"
@ -3977,9 +3983,9 @@
} }
}, },
"cytoscape": { "cytoscape": {
"version": "3.28.1", "version": "3.23.0",
"resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.28.1.tgz", "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.23.0.tgz",
"integrity": "sha512-xyItz4O/4zp9/239wCcH8ZcFuuZooEeF8KHRmzjDfGdXsj3OG9MFSMA0pJE0uX3uCN/ygof6hHf4L7lst+JaDg==", "integrity": "sha512-gRZqJj/1kiAVPkrVFvz/GccxsXhF3Qwpptl32gKKypO4IlqnKBjTOu+HbXtEggSGzC5KCaHp3/F7GgENrtsFkA==",
"dev": true, "dev": true,
"requires": { "requires": {
"heap": "^0.2.6", "heap": "^0.2.6",
@ -3995,6 +4001,32 @@
"cose-base": "^1.0.0" "cose-base": "^1.0.0"
} }
}, },
"cytoscape-fcose": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/cytoscape-fcose/-/cytoscape-fcose-2.2.0.tgz",
"integrity": "sha512-ki1/VuRIHFCzxWNrsshHYPs6L7TvLu3DL+TyIGEsRcvVERmxokbf5Gdk7mFxZnTdiGtnA4cfSmjZJMviqSuZrQ==",
"dev": true,
"requires": {
"cose-base": "^2.2.0"
},
"dependencies": {
"cose-base": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/cose-base/-/cose-base-2.2.0.tgz",
"integrity": "sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g==",
"dev": true,
"requires": {
"layout-base": "^2.0.0"
}
},
"layout-base": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/layout-base/-/layout-base-2.0.1.tgz",
"integrity": "sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg==",
"dev": true
}
}
},
"d3": { "d3": {
"version": "7.8.4", "version": "7.8.4",
"resolved": "https://registry.npmjs.org/d3/-/d3-7.8.4.tgz", "resolved": "https://registry.npmjs.org/d3/-/d3-7.8.4.tgz",
@ -4873,23 +4905,23 @@
"dev": true "dev": true
}, },
"mermaid": { "mermaid": {
"version": "10.9.0", "version": "10.7.0",
"resolved": "https://registry.npmjs.org/mermaid/-/mermaid-10.9.0.tgz", "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-10.7.0.tgz",
"integrity": "sha512-swZju0hFox/B/qoLKK0rOxxgh8Cf7rJSfAUc1u8fezVihYMvrJAS45GzAxTVf4Q+xn9uMgitBcmWk7nWGXOs/g==", "integrity": "sha512-PsvGupPCkN1vemAAjScyw4pw34p4/0dZkSrqvAB26hUvJulOWGIwt35FZWmT9wPIi4r0QLa5X0PB4YLIGn0/YQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@braintree/sanitize-url": "^6.0.1", "@braintree/sanitize-url": "^6.0.1",
"@types/d3-scale": "^4.0.3", "@types/d3-scale": "^4.0.3",
"@types/d3-scale-chromatic": "^3.0.0", "@types/d3-scale-chromatic": "^3.0.0",
"cytoscape": "^3.28.1", "cytoscape": "^3.23.0",
"cytoscape-cose-bilkent": "^4.1.0", "cytoscape-cose-bilkent": "^4.1.0",
"cytoscape-fcose": "^2.1.0",
"d3": "^7.4.0", "d3": "^7.4.0",
"d3-sankey": "^0.12.3", "d3-sankey": "^0.12.3",
"dagre-d3-es": "7.0.10", "dagre-d3-es": "7.0.10",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"dompurify": "^3.0.5", "dompurify": "^3.0.5",
"elkjs": "^0.9.0", "elkjs": "^0.9.0",
"katex": "^0.16.9",
"khroma": "^2.0.0", "khroma": "^2.0.0",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"mdast-util-from-markdown": "^1.3.0", "mdast-util-from-markdown": "^1.3.0",
@ -5387,9 +5419,9 @@
"dev": true "dev": true
}, },
"prettier": { "prettier": {
"version": "3.2.5", "version": "3.2.4",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz",
"integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==",
"dev": true "dev": true
}, },
"prettier-plugin-go-template": { "prettier-plugin-go-template": {
@ -5402,9 +5434,9 @@
} }
}, },
"prettier-plugin-tailwindcss": { "prettier-plugin-tailwindcss": {
"version": "0.5.12", "version": "0.5.11",
"resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.12.tgz", "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.11.tgz",
"integrity": "sha512-o74kiDBVE73oHW+pdkFSluHBL3cYEvru5YgEqNkBMFF7Cjv+w1vI565lTlfoJT4VLWDe0FMtZ7FkE/7a4pMXSQ==", "integrity": "sha512-AvI/DNyMctyyxGOjyePgi/gqj5hJYClZ1avtQvLlqMT3uDZkRbi4HhGUpok3DRzv9z7Lti85Kdj3s3/1CeNI0w==",
"dev": true, "dev": true,
"requires": {} "requires": {}
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "hugo-congo-theme", "name": "hugo-congo-theme",
"version": "2.8.1", "version": "2.8.0",
"description": "Congo theme for Hugo", "description": "Congo theme for Hugo",
"scripts": { "scripts": {
"preinstall": "rimraf assets/lib", "preinstall": "rimraf assets/lib",
@ -31,14 +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.2", "chart.js": "^4.4.1",
"fuse.js": "^7.0.0", "fuse.js": "^7.0.0",
"jsdom": "^23.0.1", "jsdom": "^23.0.1",
"katex": "^0.16.9", "katex": "^0.16.9",
"mermaid": "^10.9.0", "mermaid": "^10.7.0",
"prettier": "^3.2.5", "prettier": "^3.2.4",
"prettier-plugin-go-template": "^0.0.15", "prettier-plugin-go-template": "^0.0.15",
"prettier-plugin-tailwindcss": "^0.5.12", "prettier-plugin-tailwindcss": "^0.5.11",
"quicklink": "^2.3.0", "quicklink": "^2.3.0",
"rimraf": "^5.0.5", "rimraf": "^5.0.5",
"tailwindcss": "^3.4.1", "tailwindcss": "^3.4.1",
@ -78,8 +78,5 @@
"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"
}
} }

View File

@ -1,8 +1,8 @@
const jsdom = require("jsdom"); const jsdom = require("jsdom");
const fs = require("fs"); const fs = require("fs");
const SVG_FILE_DIR = 'node_modules/@fortawesome/fontawesome-free/svgs/brands';
const DOC_DIR = "./exampleSite/content/samples/icons"; const DOC_DIR = "./exampleSite/content/samples/icons";
const FONTAWESOME_VERSION = "v6.5.1";
const DEFAULT_TABLE_DELIMITER = "| -------------------- | --------------------------------- |"; const DEFAULT_TABLE_DELIMITER = "| -------------------- | --------------------------------- |";
/** /**
@ -12,7 +12,8 @@ const DEFAULT_TABLE_DELIMITER = "| -------------------- | ----------------------
*/ */
const add_icon_to_congo = async (icon_name) => { const add_icon_to_congo = async (icon_name) => {
try { try {
const file = await get_file(icon_name); const icon_url = create_icon_url(icon_name, FONTAWESOME_VERSION);
const file = await get_file(icon_url);
const final_svg = modify_svg_string(file); const final_svg = modify_svg_string(file);
const icon_download_path = create_icon_download_path(icon_name); const icon_download_path = create_icon_download_path(icon_name);
save_file(icon_download_path, final_svg); save_file(icon_download_path, final_svg);
@ -30,16 +31,26 @@ const modify_svg_string = (svg_string) => {
svg.querySelector("path").setAttribute("fill", "currentColor"); svg.querySelector("path").setAttribute("fill", "currentColor");
return svg.outerHTML; return svg.outerHTML;
} catch (e) { } catch (e) {
throw new Error("Invalid SVG file" + e); throw new Error("Invalid SVG file");
} }
}; };
const create_icon_url = (icon_name, fontawesome_version) => {
return `https://site-assets.fontawesome.com/releases/${fontawesome_version}/svgs/brands/${icon_name}.svg`;
};
const create_icon_download_path = (icon_name) => { const create_icon_download_path = (icon_name) => {
return `./assets/icons/${icon_name}.svg`; return `./assets/icons/${icon_name}.svg`;
}; };
const get_file = async (url) => { const get_file = async (url) => {
return fs.readFileSync(SVG_FILE_DIR + `/${url}.svg`, "utf8"); console.log("Getting file at " + url + "...");
const response = await fetch(url);
if (response.status >= 400) {
throw new Error("Could not download icon / icon not found");
}
console.log("File retrieved!");
return response.text();
}; };
const save_file = (file_path, file) => { const save_file = (file_path, file) => {
@ -73,16 +84,12 @@ const add_documentation = async (icon_name) => {
const process_file = (file_contents, icon_name) => { const process_file = (file_contents, icon_name) => {
const [headers, table] = file_contents.split(DEFAULT_TABLE_DELIMITER); const [headers, table] = file_contents.split(DEFAULT_TABLE_DELIMITER);
const table_rows = table.split("\n").map((x) => x.trim()).filter((row) => row !== ""); const table_rows = table.split("\n").map((x) => x.trim()).filter((row) => row !== "");
table_rows.push(create_table_row(icon_name)); table_rows.push(table_rows[0].replace("amazon", icon_name));
table_rows.sort(); table_rows.sort();
const new_table = table_rows.join("\n"); const new_table = table_rows.join("\n");
return `${headers.trimEnd()}\n${DEFAULT_TABLE_DELIMITER}\n${new_table}\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 = () => { const get_md_docs = () => {
return fs.readdirSync(DOC_DIR).filter((file) => file.endsWith(".md")); return fs.readdirSync(DOC_DIR).filter((file) => file.endsWith(".md"));
}; };