Compare commits

...

164 Commits

Author SHA1 Message Date
Xin
2af73b3d7e feat: shortcode for Jupyter Notebook (#337)
Some checks are pending
Deploy Hugo site to Pages / build (push) Waiting to run
Deploy Hugo site to Pages / deploy (push) Blocked by required conditions
* feat: shortcode for Jupyter Notebook

* chore: update generated CSS files

* chore: add example Jupyter Notebook file

* chore: update doc

* chore: enhance jupyter notebook styling

- use raw markdown for contents like code block and markdown text

* feat: support load notebook from assets and remote

- update docs accordingly
- add example notebook file

* chore: rename example file
2024-09-14 14:29:55 +01:00
d1c3c40a95 optional Title in md Head (#442)
Co-authored-by: RT Filefabrik <rt@filefabriik.com>
2024-09-14 14:28:30 +01:00
086af4d173 chore(deps): bump micromatch from 4.0.7 to 4.0.8 (#453)
Some checks failed
Deploy Hugo site to Pages / build (push) Has been cancelled
Deploy Hugo site to Pages / deploy (push) Has been cancelled
2024-09-12 08:36:39 +01:00
c6de4b5b6b docs: update image examples with Lorem Picsum (#445)
Some checks failed
Deploy Hugo site to Pages / build (push) Has been cancelled
Deploy Hugo site to Pages / deploy (push) Has been cancelled
2024-08-22 10:05:30 +01:00
Xin
66d2bf57ba docs: additional shortcodes (#441)
Some checks failed
Deploy Hugo site to Pages / build (push) Has been cancelled
Deploy Hugo site to Pages / deploy (push) Has been cancelled
* Create pdf.md

* Update pdf.md

* Escape PDF shortcode examples

* Remove markdown syntax highlight

* chore: update Hugo and Go versions for deployment

* docs: add additional shortcodes

* chore: re-compile

---------

Co-authored-by: Shahar Naveh <50263213+ShaharNaveh@users.noreply.github.com>
2024-08-18 16:34:48 +01:00
Xin
526be88d7b fix: tabs styling in steps shortcode (#440)
* fix: tabs styling in steps shortcode

* docs: add notes for intended usage
2024-08-18 15:38:06 +01:00
Xin
2863a3a029 fix: remove deprecated site.GoogleAnalytics (#438)
Some checks are pending
Deploy Hugo site to Pages / build (push) Waiting to run
Deploy Hugo site to Pages / deploy (push) Blocked by required conditions
* fix: remove deprecated site.GoogleAnalytics

* ci: bump netlify Hugo version
2024-08-18 14:41:40 +01:00
852a07b15e fix: remove deprecated google analytics reference in head.html (#435)
ERROR deprecated: .Site.GoogleAnalytics was deprecated in Hugo v0.120.0 and will be removed in Hugo 0.133.0. Use .Site.Config.Services.GoogleAnalytics.ID instead.
2024-08-18 12:31:50 +01:00
Xin
e83c11f31a chore: improve tags styling on card (#431)
Some checks failed
Deploy Hugo site to Pages / build (push) Has been cancelled
Deploy Hugo site to Pages / deploy (push) Has been cancelled
* chore: improve tags styling on card

* chore: npm run build:css
2024-08-11 18:47:03 +01:00
f439e6bb87 feat: add tag support for card shortcode (#427)
* styles: accept tags on cards with default and custom colors

* styles: compile css
2024-08-11 17:30:19 +01:00
Xin
9c0ba06db4 chore: bump hugo versions 2024-08-11 16:28:59 +00:00
Xin
5c6ed19c34 chore: bump npm package versions 2024-08-11 16:28:19 +00:00
0986b9ee84 docs: add missing Markdown syntax examples (#415) 2024-08-11 17:03:51 +01:00
d2d2a62d5a docs: fix typo in chinese doc (#430) 2024-08-11 17:01:12 +01:00
Xin
e3b582676e fix: properly handle tabs overflow (#422)
Some checks failed
Deploy Hugo site to Pages / build (push) Has been cancelled
Deploy Hugo site to Pages / deploy (push) Has been cancelled
* fix: properly handle tabs overflow

* chore: rebuild css
2024-07-10 01:11:51 +01:00
56f6f19978 docs: list code block copy button config (#412)
Some checks failed
Deploy Hugo site to Pages / build (push) Has been cancelled
Deploy Hugo site to Pages / deploy (push) Has been cancelled
* fix: list code block copy button config

* Mention copy button config in the guide
2024-07-07 13:33:12 +01:00
1313415c8b feat: add customize flexsearch tokenize feature instruction to docs (#322)
* feat: add customize flexsearch tokenize feature instruction to docs

* Update configuration.md

* Update configuration.md

* Update configuration.zh-cn.md

---------

Co-authored-by: loenvom <loenvom@qq.com>
Co-authored-by: Xin <xin@imfing.com>
2024-06-02 13:53:38 +01:00
3cba6b9820 feat: add support for breadcrumbs param in front matter for showing/hiding breadcrumbs on specific pages (#367)
* feat: add support for `hideBreadcrumbs` front-matter param

* docs(en): add some docs about breadcrumb nav, including new hideBreadcrumbs param

* fix: fix typo in hideBreadcrumbs param check in breadcrumbs.html partial

* docs(en): tidy up the Breadcrumb Navigation documentation

* fix: rework hideBreadcrumbs param to breadcrumbs; update docs accordingly

* fix: use relpermalink in breadcrumb

---------

Co-authored-by: Xin <xin@imfing.com>
2024-06-02 11:01:06 +01:00
6ee6ddeacb i18n: add Hebrew translation (#405) 2024-05-29 22:27:34 +01:00
db92de0f1b i18n: add Ukrainian translation (#403) 2024-05-29 09:13:24 +01:00
b2bc4f7098 fix: use hugo.IsMultilingual to replace deprecated .Site.IsMultiLingual (#404) 2024-05-29 09:11:25 +01:00
857c4e4ca1 chore: update AXIVO docs image format (#402) 2024-05-26 18:38:55 +01:00
d3f251b621 chore(showcase): add AXIVO docs (#400) 2024-05-25 10:19:14 +01:00
d43ac66494 feat: add hextra hero-container shortcode (#389)
* Implement hextra hero-container

* Fix width

* Fix width

* Fix width

* Set number of columns

* Fix display for mobile devices

* Trim image prefix

* Implement image card

* Fix width

* Fix css
2024-05-23 23:36:46 +01:00
4eca719b0b docs(fix): correct a mistake in markdown guide (#394)
Fix code mistake by making sure backticks are inserted at start and end of example text
2024-05-21 10:09:03 +01:00
daaf281012 i18n: add Dutch translation (#383)
Added Dutch translation.
2024-05-06 01:46:22 +01:00
ba7707d4d9 docs: add showcase - HITSZ OpenAuto (#373)
* docs: add showcase - HITSZ OpenAuto

* alter showcase image

* Update index.md

* Update index.zh-cn.md

---------

Co-authored-by: Xin <xin@imfing.com>
2024-04-28 11:30:06 +01:00
25da2baf7f chore: add i18n links in README (#374)
* docs: add i18n README links

* Update README.md

* Update README.fa.md

* Update README.zh-cn.md

---------

Co-authored-by: Xin <xin@imfing.com>
2024-04-28 11:24:21 +01:00
234fd39254 docs: fix deploy-site zh-cn lang filename (#371) 2024-04-24 12:39:32 +02:00
Xin
4a7ab16695 docs: fix deploy site title 2024-04-23 22:20:01 +02:00
Xin
19852552c6 docs: update zh-cn sidebar titles 2024-04-23 22:16:55 +02:00
Xin
80a1692ade docs: fix deploy-site zh-cn lang filename 2024-04-23 22:08:06 +02:00
81720c7727 docs: update zh-cn translation (#365) 2024-04-21 11:46:21 +01:00
Xin
f98fa8c389 ci: use actions/configure-pages and bump hugo version 2024-04-17 22:48:30 +00:00
Xin
3503b4c4f1 chore(deps): add taskfile and bump assets lib versions (#362)
* chore: add Taskfile for automating common tasks

* chore(deps): bump versions of third-party libraries in assets

* katex 0.16.8 -> 0.16.10
* mermaid -> 10.9.0
2024-04-17 23:14:37 +01:00
Xin
bf38320797 chore: 2023 -> 2024 2024-04-17 21:36:25 +00:00
Xin
6a9117ae7c chore(deps): bump npm package versions (#361)
* chore(deps): bump npm package versions

* recompile css

* chore: recompile css
2024-04-17 22:30:01 +01:00
be7e0d3f40 fix: js scripts not in body element (#356) 2024-04-11 14:54:59 +02:00
e4cdabff12 docs(i18n): add zh-cn translation of RSS button (#353)
I notice that RSS button is missed when switching language to Chinese in the documentation of Hextra. It's added now in this PR, hope it helps.
2024-04-06 09:59:27 +02:00
Xin
2f127a2f2f chore: revert adding homebrew to devcontainer
* bloat up the image size and increase the cold start time

[skip ci]
2024-04-04 22:56:04 +02:00
Xin
781e7000c4 chore: add homebrew to devcontainer
[skip ci]
2024-04-04 22:39:15 +02:00
Xin
8e98791082 chore: bump hugo version to 0.124.1 in devcontainer 2024-04-04 22:37:43 +02:00
Xin
6d4bbac085 feat: support sort blog post list page (#348) 2024-04-02 08:52:26 +01:00
Xin
5103da4cd5 chore: improve search bar shortcut display (#346)
* chore: improve search bar shortcut display

* chore: remove focusout handler
2024-04-01 19:34:57 +01:00
Xin
9f2b67c08c feat: pdf shortcode (unstable) (#345) 2024-04-01 15:55:11 +01:00
Xin
0d6cbba9df feat: add styles for definition list (#344)
* feat: dd styles for definition list

* chore: re-generate css
2024-04-01 00:18:43 +01:00
Xin
1936b46af4 docs: add more projects to showcase 2024-03-31 23:31:27 +01:00
Xin
ab9e40effd chore: add quicklink script to head in doc site 2024-03-31 22:24:24 +01:00
Xin
5080877576 feat: configurable cols for feature-grid shortcode (#342)
* feat: configurable cols for feature-grid shortcode

* chore: update css files

* chore: add hextra prefix to cards css var

* chore: rebuild css
2024-03-31 22:06:26 +01:00
Xin
24fb13b221 refactor: extract card shortcode to partial (#339)
* refactor: extract card shortcode to partial

* chore: update hugo stats
2024-03-31 11:06:47 +01:00
Xin
a5b59b61f1 fix: indented callouts rendered incorrectly (#338) 2024-03-30 17:26:40 +01:00
Xin
ef536af9e8 fix: typo in code-copy.css
* regenerate css and update hugo stats json
2024-03-28 09:33:35 +00:00
Xin
d8351aa432 feat: allow enable/disable code block copy button (#331)
* refactor: move codeblock to a partial component

* feat: add flags for code block copy button

* allow disable code copy button completely
* allow make the copy button always visible

* chore: run build:css
2024-03-28 07:32:51 +00:00
Xin
741a640b1a fix: update dead link for Porter 2024-03-20 10:38:35 +00:00
Xin
935ff7f719 feat: add title utility to get page or section title (#325)
* feat: add title utility to get page or section title

* with graceful fallback to using the directory or filename

* chore: update link titles in breadcrumb, pager, and sidebar
2024-03-19 22:16:10 +00:00
Xin
29e70c8b21 fix: code copy button is invisible when hover (#323)
* fix: code copy button is invisible when hover

* chore: update hugo_stats.json file
2024-03-18 18:37:47 +00:00
c634cb83eb feat: support customize flexsearch tokenize option (#319)
Co-authored-by: loenvom <loenvom@qq.com>
2024-03-17 18:50:22 +00:00
22d4737b99 fix: RTL Steps FileTree, feat: Add Persian number for ol label counter and Steps (#314)
* fix: RTL Steps in steps.html file

* feat: Add bidirectional support

* fix: RTL problem

* fix: RTL problem, feat: Add Persian CSS counter

* feat: Add Persian for ol counter

* fix: styling text

* Add ol output example

* fix: RTL problem

* fix some issue

* fix some issue

* fix some issue
2024-03-05 07:47:29 +00:00
fba95d5336 chore(i18n): add Romanian translation (#313) 2024-03-05 07:41:21 +00:00
Xin
07b67ff112 fix: module imports should be array in hugo config 2024-03-01 23:40:55 +00:00
Xin
5c7303bee7 feat: add hx- prefix to Hextra Tailwind CSS classes (#300)
* feat: add prefix to tailwind css classes

* fix: remove unnecessary prefixes

* fix: add missing prefix in other places

* chore: regenerate hugo_stats.json

* chore: run `npm run build:css`

* chore: add `hx-` prefix to _index.fa.md

* fix: lang switcher display issue

* fix: add `hx-` prefix to showcase/index.fa.md

* fix: lang switch param mistake
2024-02-20 22:59:31 +00:00
Xin
0e312d3476 docs: update GitHub Action deploy template 2024-02-20 22:55:54 +00:00
Xin
98546e66b9 chore: add slack icon
from https://icon-sets.iconify.design/simple-icons/slack/
2024-02-20 22:38:56 +00:00
b1f49c091f fix: RTL chevron rotation (#302)
* Fix right-to-left chevron in breadcrumb.html file

* Fix right-to-left chevron in pager.html file

* Update file
2024-02-20 22:27:23 +00:00
8e6cc68e88 chore: add BitBucket icon (#303)
* chore: add BitBucket icon

* Update icons.yaml

---------

Co-authored-by: Xin <xin@imfing.com>
2024-02-20 22:20:36 +00:00
9995617c66 docs(i18n): add Persian translation and support rtl languageDirection (#301)
* feat: add persian translation

* Add Persian translation

* Add fa support, languageDirection method in hugo.yaml

* Add languageDirection method

* Update hugo.yaml

* Update baseof.html
2024-02-19 21:40:50 +00:00
Xin
10907cdc25 fix: resolve padding issue for code blocks with filenames but without lang highlight (#297)
* fix: resolve padding issue for code blocks with filenames but without lang highlighting

* chore: run `npm run build:css`

* chore: update `node_modules/caniuse-lite`
2024-02-17 23:06:46 +00:00
6bd2cfbd6b chore(i18n): add Persian translation (#294) 2024-02-17 18:51:40 +00:00
2d8f42f4c5 chore: add gitlab icon to icons.yaml (#285)
Gitlab svg icon with fill to curentColor has been added to the icon set.
2024-02-13 09:29:35 +00:00
Xin
716af59393 fix: clear top margin for nested list recursively (#280)
* fix: clear top margin for nested list children

* chore: run `npm run build:css`
2024-02-06 22:04:37 +00:00
Xin
7191e25958 fix: set top margin to zero for nested list (#276) 2024-02-03 09:09:16 -05:00
Xin
c630805511 fix: details toggle display issue (#273)
when more than two lines of summary are provided
2024-02-02 23:37:54 +00:00
cb274c8ac5 feat: add canonical to head.html (#269)
By adding `canonical` parameter to the front matter and specifying the URL, the canonical URL is added. 
If no canonical URL is needed to be specified, the layout will use the current page address for canonical tag. 

Example: 

```
---
title: "Page Title"
description: "Page description"
canonical: "https://canonicalurl.com"
---
2024-02-01 22:52:41 +00:00
fbe1aac123 i18n: add german translation (#271)
Signed-off-by: Achim Krämer <39946364+pxlfrk@users.noreply.github.com>
2024-02-01 22:48:22 +00:00
Xin
ff8f2537ca fix: accurate editURL resolution in translated sites (#264) 2024-01-21 10:33:49 +00:00
728fe21ef1 chore: add canonical URL to head template (#261) 2024-01-19 21:56:21 +00:00
fc964f11a6 showcase: clever cloud documentation (#262) 2024-01-19 21:34:32 +00:00
09e9f52019 chore(i18n): add Czech translation (#246)
Czech translation
2024-01-10 14:52:58 +00:00
f5e4283961 chore: add rel="me" attribute to Mastodon navbar icon (#243)
* Add rel="me" attribute to Mastodon navbar icon

The rel="me" attribute enables verified links on the linked Mastodon profile

* Set $rel based on icon name
2024-01-08 18:25:54 +00:00
10f1d85ab4 docs: update zh-cn translation (#236)
* Update customization.zh-cn.md

* Translate: Update translation of outdated docs

* Fix error
2024-01-08 18:24:38 +00:00
fd9a87a86a fix(docs): add editURL.enable = true (#245)
The MR documents the requirement to enable editURL setting.


[A  prior commit](04a5c7378a (diff-5311bf4e1519696010f8298385d9de30210dfcd9dee8785f6deba3a084b62eecL26)) the behavior changed from a default of "disable = false" to a default of "enabled = false".
2024-01-08 18:22:15 +00:00
1f9e7c8b39 chore: add Codeberg icon (#244) 2024-01-08 18:19:37 +00:00
7772313a53 docs: correct editURL config instruction (#215)
* docs: fix the documentation error about editURL

* docs: fix the documentation error about editURL

* Update configuration.md

* Update configuration.zh-cn.md

---------

Co-authored-by: Xin <xin@imfing.com>
2023-11-21 20:50:29 +00:00
7f0a35ab48 chore: add Osuny to showcase (#218) 2023-11-21 08:36:06 -05:00
35c733b7ee chore: increase time for "copied" animation duration (#214)
* align-logo-footer

add vertical align 2px for logo footer

* modify logo align in footer

* noobie things

* modify logo & vertical align

* build css

* revert change in icons.yaml

* increase duration for copied button effect

* Update hugo_stats.json

* Update main.css

* Update footer.html

* modify timeout to 1000 (1sec)
2023-11-21 00:07:14 +00:00
aad68d8afd chore(style): better footer logo alignment (#212) 2023-11-18 15:31:30 +00:00
Xin
d58a8b5469 feat: exclude page from sidebar (#209)
* feat: allow excluding page from sidebar

* chore: tidy up

* docs: add instruction for excluding a page from sidebar

* feat: allow hiding sidebar for pages

* chore: add comment
2023-11-17 23:00:05 +00:00
Xin
64ac97b2d6 feat: allow overriding poweredBy in footer (#207) 2023-11-17 02:03:40 +00:00
Xin
27c976bcc1 feat: display author avatar images in blog post (#204)
* feat: support displaying author images in blog post

* chore: fix typo

* chore: run build:css

* refactor: support both plain author list

* chore: run build:css

* chore: add support for local avatar images

* chore: update css classes
2023-11-17 01:49:18 +00:00
Xin
d675d3bc7b feat: support separator in sidebar (#199)
* feat: support adding pages as separator for sidebar

* Update sidebar.html
2023-11-12 14:03:30 +00:00
456c96921a typo: fix typos in sidebar.html (#203)
@OliverWu515 finds this issue, I help pr this. Hope it helps. The theme helps a lot for our org to build our documents. We found this issue when we use it.
2023-11-12 13:47:20 +00:00
Xin
c2d7ba8ce5 fix: code copy issue for code blocks in shortcode (#201)
* chore: add translation key for copy code button title

* chore: remove id from code block elements

* fix: copy the correct code target in code-copy.js

* chore: update details.md

* chore: remove console.log :)

* chore: remove `$` in shell commands

* chore: update docs
2023-11-12 01:14:39 +00:00
Xin
8801a04ebe feat: add include shortcode (#198) 2023-11-11 00:10:32 +00:00
Xin
21b0acdec5 chore: improve cards compatibility with steps (#197) 2023-11-10 23:45:42 +00:00
Xin
c0a1bc32dd fix: ensure relref in search index is properly rendered (#196)
* fix: ensure relref in search index is properly rendered

* chore: remove empty whitespace
2023-11-10 22:21:54 +00:00
Xin
4ea18168e3 fix: correctly set editURL in front-matter (#195) 2023-11-10 22:03:08 +00:00
Xin
23c84e124c fix: navbar url for multi-lang site (#193)
* fix: image URL in feature card

* fix: use relLangURL of pageRef for navbar entries
2023-11-10 17:45:44 +00:00
Xin
678f0b86ee fix: htmlUnescape toc title (#190) 2023-11-05 10:26:00 +00:00
defc9bc11b fix(docs): showcase starter template URL (#189)
* Update URl for Hextra Starter Template

* Update index.md

---------

Co-authored-by: Saurabh Mishra <saurabh.m@mailfence.com>
Co-authored-by: Xin <xin@imfing.com>
2023-11-05 10:09:58 +00:00
Xin
363c8c91ee fix: scroll bug due to incorrect toggle state (#186)
* fix: add mobile menu overlay to toggle body scroll

* chore: update styles
2023-11-03 20:39:36 +00:00
Xin
088e9f7821 fix(style): add backdrop to code copy button (#185)
* fix(style): add backdrop to code copy button

* chore: run build:css
2023-11-02 22:43:50 +00:00
7be079f504 i18n: update es.yaml (#180)
* Update es.yaml

Update spanish translations, using keys from `zh-cn.yaml`.

* Update es.yaml

---------

Co-authored-by: Xin <xin@imfing.com>
2023-11-01 20:28:29 +00:00
Xin
10ba5533e5 i18n: refactor translations for docs site (#181)
* i18n: move some translations under example site

* chore: update i18n/ja.yaml

* i18n: update zh-tw.yaml

* i18n: update fr.yaml

* i18n: update pt.yaml

* i18n: update ko.yaml

* i18n: update nb.yaml and nn.yaml

* i18n: update sw.yaml

* i18n: update vi.yaml

* i18n: update sw.yaml

* docs: clean up ja site as it's incomplete
2023-11-01 20:26:54 +00:00
Xin
433beed666 fix: plainify Toc headings (#178) 2023-10-31 23:14:42 +00:00
56a87e559d i18n: update pt.yaml (#174)
Update the Portuguese translation.
2023-10-31 09:15:51 +00:00
Xin
9d68f7c71a docs: minor update deploy site doc 2023-10-31 09:14:46 +00:00
Xin
e3f6069968 chore: support services.googleAnalytics.ID (#173)
* chore: support `services.googleAnalytics.ID`

and deprecate `site.googleAnalytics`

* chore: remove warning
2023-10-30 23:48:48 +00:00
de1286c7fc i18n: Add language strings for Norwegian bokmål and Norwegian nynorsk (#172)
The two main written languages in Norway.
2023-10-30 22:42:30 +00:00
c0a1d5cb67 chore(i18n): add French translation (#166)
* Create fr-fr.yaml

* Rename fr-fr.yaml to fr.yaml

* Modify Showcase

showcase ressemble a vitrine mais je pense que laissé showcase n'est pas problématique

* Remove comments

* Resolve duplicate

duplicate

Co-authored-by: Xin <fuxin1997@gmail.com>

* correction

résultats à la place de résulats (classique)

Co-authored-by: Xin <fuxin1997@gmail.com>

---------

Co-authored-by: Xin <fuxin1997@gmail.com>
2023-10-29 17:57:45 +00:00
Xin
50f1b084ae chore(icons): add linkedin
[skip ci]
2023-10-29 17:55:27 +00:00
Xin
0d629b67b9 docs: add instructions for configuring layouts (#167) 2023-10-29 17:52:34 +00:00
Xin
7c902b4eb9 chore(style): enhance not-prose elements styling (#163)
* chore(css): improve not-prose tags styling

* fix: typo

* chore(style): improve appearance in prose

* feat: support icon in callout shortcode

* chore: add RSS badge to blog list page

* chore: run build:css

* chore: run build:css

* chore: remove unused CSS

* chore: add footer.enable explicitly to config

* chore: use `where` pseudo class for more prose elements

* chore: run build:css

* chore: remove blank space

* chore: rebuild css

* chore: update figure css
2023-10-29 15:19:31 +00:00
Xin
9744b4d727 feat: option to show tags for blog list (#161)
* feat: option to show tags for blog list

* chore: update hugo_stats.json
2023-10-28 15:56:58 +01:00
Xin
34aecec9d4 docs: fix some spelling mistakes (#159)
* chore: fix README.md

* docs: minor fix the docs site
2023-10-27 23:15:06 +01:00
Xin
15ea31c389 docs: add Deploy Site page (#158)
* docs: add Deploy Site page

* docs: update deploy-site.md
2023-10-27 23:09:38 +01:00
Xin
141e0d8f8c fix(style): remove sidebar item extra padding and gap (#155)
* fix: remove sidebar item extra padding and gap

* chore: run build:css
2023-10-27 14:57:48 +01:00
Xin
2d2e8aec4c fix(style): remove padding for highlighted code (#157)
* fix(style): remove padding for highlighted lines

* chore: run build:css
2023-10-27 14:56:39 +01:00
c6f432566d docs: update editURL description (#154) 2023-10-27 05:39:31 -04:00
LLL
ae01ac08b6 feat: improve Cards link behaviour (#153)
* clickable feature-card when a link is provided

* unclickable card when no link is provided

---------

Co-authored-by: Xin <xin@imfing.com>
2023-10-26 23:13:24 +01:00
Xin
b5ab4ecdcb chore(i18n): support translation for theme toggle (#152) 2023-10-26 04:02:47 -04:00
Xin
cf7b669278 docs: add zh-cn translation for home page (#151)
* i8n: add noResultsFound and clean up zh-cn.yaml

* i8n: add translation for home page

* i18n: translate showcase for zh-cn
2023-10-25 23:32:33 +01:00
Xin
53b688f014 chore(devcontainer): bump hugo to version v0.119.0
[skip ci]
2023-10-25 21:55:40 +01:00
8ad5a0cf0e chore(deps-dev): bump postcss from 8.4.27 to 8.4.31 (#150)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.27 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.27...8.4.31)

[skip ci]
---
updated-dependencies:
- dependency-name: postcss
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-25 21:53:47 +01:00
Xin
e135f5a6b4 docs: improve icon shortcode documentation (#149) 2023-10-25 20:50:15 +01:00
Xin
97e6945c04 feat: add option to set default theme and hide toggle button (#146)
resolves #135 

Light / dark theme can be configured via:

```yaml
  theme:
    # light | dark | system
    default: system
    displayToggle: true
```
2023-10-21 22:18:04 +01:00
Xin
93cb788e52 feat(search): support different search index types (#145)
* add support for different search index types: `content | summary | heading | title`
* resolves #139
2023-10-21 21:00:39 +01:00
88b0f1b2ab fix: broken "edit this page" link in windows (#143) 2023-10-18 22:33:36 +01:00
a31b46f5e3 chore(i18n): add translations of Korean (#144)
* chore(i18n): add translations of Korean

* Update ko.yaml

---------

Co-authored-by: Xin <xin@imfing.com>
2023-10-18 22:32:28 +01:00
Sid
6641d36b98 docs: add using Hextra as Git submodule (#137)
* docs: update docs relating to getting started and Hugo modules

* docs: add docs to use Hextra as Git submodule, closes #107

* chore: use paragraph instead of callout, refactor docs

* Update getting-started.md

* Update getting-started.md

---------

Co-authored-by: Xin <xin@imfing.com>
2023-10-16 14:28:28 +01:00
e42d01898a fix: add missing translations (#142)
* fix: add missing translation in blog list

* fix: add translatable variables

* Update en.yaml

---------

Co-authored-by: Xin <xin@imfing.com>
2023-10-16 13:30:31 +01:00
Xin
6cd4c55613 fix: callout styling issue with markdown content (#141) 2023-10-13 00:09:57 +01:00
Xin
cb09b7ce1e fix: skip scroll event if no backToTop element (#138) 2023-10-12 23:25:34 +01:00
96c6ff073f chore(i18n): update zh-cn.yaml (#136) 2023-10-11 23:22:07 +01:00
Xin
28a20e1e7e chore: add code copy button icons in js (#133) 2023-10-07 20:01:19 +01:00
Xin
5f4c7423d0 chore: add feature request issue template
[skip ci]
2023-10-04 20:54:29 +01:00
Xin
2bc4ed19e3 chore: add issue bug report template
[skip ci]
2023-10-04 20:51:22 +01:00
Xin
8aa6439132 feat: support custom primary saturation (#131)
* feat: support custom primary saturation

* chore: run npm run build:css

* docs: update instruction for customizing primary color
2023-10-04 20:41:59 +01:00
b7558aca44 feat: support empty prev/next pagination (#130)
[skip ci]
2023-10-04 20:13:49 +01:00
Xin
55ff819dae fix: not-prose p tag inconsistent style (#126)
* fix: not-prose p tag should reset styles

* chore: compile CSS
2023-10-03 09:12:30 +01:00
Xin
924d8508d0 fix: footer enable flag logic issue (#125) 2023-10-03 08:51:41 +01:00
1b932f260a chore: add Vietnamese translation (#123)
[skip ci]
2023-10-03 08:36:35 +01:00
5768ed4695 chore: add Portuguese translation (#119) 2023-10-02 23:53:53 +01:00
f4cea168b1 chore: spanish translations es.yaml (#114)
[skip ci]
2023-10-02 11:57:12 +01:00
e2d00fdcd0 chore: add Swahili translation (#113)
[skip ci]
2023-10-01 23:13:18 +01:00
Xin
103faa24f3 chore: re-compile CSS 2023-10-01 09:25:02 +00:00
d1bed05843 feat: Back To Top (#105)
* Scroll to top

* Update scripts.html

---------

Co-authored-by: Xin <xin@imfing.com>
2023-10-01 10:06:28 +01:00
Xin
2df3c563bf fix: use div for copyright container in footer (#104) 2023-09-27 20:40:35 +01:00
Xin
ec02eb34fe fix: search shortcut based on user platform (#101)
* fix: search shortcut based on user platform

* chore: make it work with iPad and iPhone as well
2023-09-27 19:47:20 +01:00
Xin
46dea718e6 docs: add giscus comments system (#96)
* chore: rename comment to comments

* docs: add giscus comments

* docs: update
2023-09-26 23:33:27 +01:00
Xin
adf5a113fc fix: giscus theme and language display issues (#95)
* chore: minor update giscus template

* fix: theme toggle should select all

* chore: example configs for giscus

* fix: language code in giscus
2023-09-26 22:12:38 +01:00
6a19ac31c0 feat: add giscus support (#92)
* feat: add giscus support #89

* Update comment.html

* Update giscus.html

* Update giscus.html

---------

Co-authored-by: Xin <xin@imfing.com>
2023-09-26 20:47:22 +01:00
Xin
3c4ede96df feat: add shortcodes to build Hextra home page (#90)
* feat: add feature grid and card shortcodes

* feat: add markdown content to hextra home

* chore: add button for hextra home

* chore: add heading and subtitle

* chore: finish moving hextra home to shortcodes

* chore: regenerate css

* chore: improve hextra home layout shortcodes

* chore: update css

* chore: decrease button size
2023-09-26 08:15:31 +01:00
Xin
01f7e3a425 docs: add showcase page (#86)
* docs: add showcase page

* chore: update compiled CSS

* chore: add showcase to navbar

* chore: reorder show case on navbar

* chore: update card image style

* chore: update showcase images

* chore: update showcase card image
2023-09-24 15:30:17 +01:00
da5a087891 fix: reverse order in blog list page (#87)
* feat: support reverse order in blog list page

* chore: update blog list order

---------

Co-authored-by: Xin <xin@imfing.com>
2023-09-24 14:54:38 +01:00
Xin
79883dc7cc fix: process static image url correctly 2023-09-24 11:03:34 +01:00
Xin
b283227046 feat: enhance image resolving (#82)
* feat: enhance image resolving

* chore: don't process image path that begins with relative link

* docs: add instruction for adding images

* chore: update docs

* chore: add filenames to images docs
2023-09-23 23:54:17 +01:00
Xin
0e9cf1a519 fix: add integrity attribute to styles css preload tag (#83) 2023-09-23 22:42:05 +01:00
Xin
fdc30c6cd5 fix: card image not displaying correctly (#77)
* fix: use relative URL for card images

* chore: update card image processing

* chore: add width and height for process image

* docs: update cards docs
2023-09-23 19:25:51 +01:00
Xin
3632294706 chore: update list page RSS template (#75)
* chore: update RSS feed template

* chore: use html instead of safeHTML
2023-09-22 23:41:53 +01:00
929578192b fix: htmlUnescape page description (#71)
- add htmlUnescape
2023-09-21 22:46:08 +01:00
Sid
c18d5def26 ci: upgrade actions/checkout from v3 to v4 (#73)
https://github.com/actions/checkout#checkout-v4
2023-09-21 21:42:15 +01:00
Xin
4e63aa4f14 feat: add google analytics support (#70)
* feat: support google analytics

* docs: add instruction for setting up ga
2023-09-21 08:03:35 +01:00
Xin
b51bfa3177 feat: support wide and full page modes (#69)
* feat: add page width config and partial

* feat: use page-width partial in layouts

* chore: revert changes in navbar and footer

* feat: customize footer width from site config

* chore: update styles

* docs: add page width

* feat: allow overriding navbar width

* fix: navbar width variable

* docs: add instruction for navbar and footer
2023-09-20 23:36:00 +01:00
c799160e86 feat: add native image processing to cards (#63)
* Add native image processing to cards

* feat: Image processing options, markdown subtitles

* fixing a type

* Public Domain Images

* image height fix

* Smaller Image

* Removed fullwidth param

* Smaller image from unsplash

* Replaced static image as well

* Update single.html

* Update list.html

* Update list.html

* Update single.html

* Update list.html

* Update single.html

* Update cards.md

* Update cards.md

---------

Co-authored-by: Xin <xin@imfing.com>
2023-09-19 00:04:48 +01:00
203 changed files with 9661 additions and 2960 deletions

View File

@ -3,7 +3,7 @@
"features": {
"ghcr.io/devcontainers/features/hugo:1": {
"extended": true,
"version": "0.116.1"
"version": "0.131.0"
},
"ghcr.io/devcontainers/features/node:1": {}
},

View File

@ -57,7 +57,7 @@ We recommend that you search existing [issues][issues] or discussions before ope
### Local development setup
- [Hugo][hugo] >= v0.115.0 (extended version)
- [Hugo][hugo] >= v0.124.0 (extended version)
- [Node.js][nodejs]
- [Go][go]

40
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,40 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Description**
<!-- Provide a clear and concise description of the bug -->
**Steps To Reproduce**
1.
2.
3.
**Expected Behavior**
<!-- What should have happened? -->
**Actual Behavior**
<!-- What happened instead? -->
**Screenshots**
<!-- If applicable, add screenshots to help explain your problem -->
**Environment**
- Hugo Version: [e.g., 0.85.0]
- Browser/OS: [e.g., Chrome, MacOS]
- Theme Version: [e.g., v2.0]
**Additional Context**
<!-- Add any other context about the problem here -->

View File

@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Feature Description**
<!-- Provide a clear and concise description of the feature -->
**Problem/Solution**
<!-- What problem will this feature solve? Or what new capability will it add? -->
**Alternatives Considered**
<!-- Have you considered any alternative solutions or workarounds? -->
**Additional Context**
<!-- Add any other context or screenshots about the feature request here -->

View File

@ -31,21 +31,24 @@ jobs:
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.117.0
HUGO_VERSION: 0.131.0
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
fetch-depth: 0 # fetch all history for .GitInfo and .Lastmod
submodules: recursive
- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version: '1.22'
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: ${{ env.HUGO_VERSION }}
extended: true
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
@ -55,9 +58,9 @@ jobs:
hugo \
--minify \
--themesDir=../.. --source=exampleSite \
--baseURL "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/"
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: ./exampleSite/public
@ -71,4 +74,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4

48
README.fa.md Normal file
View File

@ -0,0 +1,48 @@
<div align="center">
<h1 align="center">هگزترا</h1>
<sup align="center"><a href="README.md">English</a> | <a href="README.zh-cn.md">简体中文</a> <a href="README.fa.md">فارسی</a></sup>
<p align="center">تم هیوگو مدرن، پاسخگو و دارای امکانات کامل برای ایجاد وب‌سایت‌های استاتیک زیبا.</p>
نسخه‌ی نمایشی → [imfing.github.io/hextra](https://imfing.github.io/hextra/fa)
</div>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/5097752/263550533-c18343ca-3848-4230-b5c0-ee989d7916da.png">
<img alt="Hextra" src="https://user-images.githubusercontent.com/5097752/263550528-663599f9-17a1-4686-b5c4-3da233b5034d.png">
</picture>
<div align="right">
<a href="https://github.com/imfing/hextra/actions/workflows/pages.yml"><img alt="GitHub Actions Status" src="https://github.com/imfing/hextra/actions/workflows/pages.yml/badge.svg"></a> <a href="https://app.netlify.com/sites/hugo-hextra/deploys"><img alt="Netlify Status" src="https://api.netlify.com/api/v1/badges/61d6e55a-2447-487e-b59f-c9537e5df175/deploy-status"></a>
</div>
## ویژگی‌ها
- **طراحی زیبا** - با الهام از Nextra، هگزترا از Tailwind CSS برای ارائه یک طراحی مدرن که سایت شما را برجسته می‌کند، استفاده می‌کند.
- **طراحی واکنش‌گرا و حالت تیره** - در تمام دستگاه‌ها، از تلفن همراه، تبلت تا دسکتاپ، عالی به نظر می‌رسد. حالت تیره نیز برای انطباق با شرایط مختلف روشنایی پشتیبانی می‌شود.
- **سریع و سبک** - طراحی شده توسط Hugo، یک ایجادکننده سایت استاتیک سریع مثل رعد و برق که در یک فایل باینری قرار گرفته است، هگزترا ردپای خود را به حداقل می‌رساند. برای استفاده از آن به جاوااسکریپت یا Node.js نیازی ندارید.
- **جستجوی متن کامل** - جستجوی متن کاملا آفلاین داخلی طراحی شده توسط FlexSearch، بدون نیاز به پیکربندی اضافی.
- **امکانات کامل** - برای بهتر کردن محتوای شما مارک‌داون، برجسته‌کردن سینتکس، فرمول‌های ریاضی LaTeX، نمودارها و عناصر Shortcodeها را شامل میشه. فهرست مطالب، بردکرامب، صفحه‌بندی، پیمایش نوار کناری و موارد دیگر همه به صورت خودکار تولید می‌شوند.
- **چند زبانه و سئو آماده** - سایت‌های چند زبانه با حالت چند زبانه Hugo راحت ساخته می‌شوند. پشتیبانی خارج از جعبه برای برچسب‌های سئو، Open Graph و کارت‌های توییتر گنجانده شده است.
## شروع کنید
### شروع سریع از طریق Template
استفاده از [Hextra Starter Template](https://github.com/imfing/hextra-starter-template) ساده‌ترین روش برای راه‌اندازی سریع یک وب‌سایت جدید با تم هگزترا است. با کلیک بر روی دکمه "Use this template" در بالای صفحه مخزن شروع کنید.
مخزن تم همچنین شامل یک [گردش کار گیت‌هاب Actions](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow) رای به‌کاراندازی وب‌سایت شما در گیت‌هاب Pages است.
<img alt="Hextra Starter Template" src="https://user-images.githubusercontent.com/5097752/263551418-c403b9a9-a76c-47a6-8466-513d772ef0b7.jpg" width=600/>
### استفاده
برای اطلاعات بیشتر به بخش [مستندات](https://imfing.github.io/hextra/fa/docs) مراجعه کنید.
## مشارکت کردن
از مشارکت افراد جدید استقبال می‌کنیم.
برای شروع، [راهنمای مشارکت](.github/CONTRIBUTING.md) را بررسی کنید.
## مجوز
[مجوز MIT](./LICENSE)

View File

@ -1,5 +1,6 @@
<div align="center">
<h1 align="center">Hextra</h1>
<sup align="center"><a href="README.md">English</a> | <a href="README.zh-cn.md">简体中文</a> <a href="README.fa.md">فارسی</a></sup>
<p align="center">Modern, responsive, batteries-included Hugo theme for creating beautiful static websites.</p>
Demo → [imfing.github.io/hextra](https://imfing.github.io/hextra/)
@ -17,10 +18,10 @@ Demo → [imfing.github.io/hextra](https://imfing.github.io/hextra/)
## Features
- **Beautiful Design** - Inspired by Nextra, Hextra utilizes Tailwind CSS to offer a modern design that makes your site look outstanding.
- **Responsive Layout and Dark Mode** - It looks great on all devices, from mobile, tablet to desktop. Dark mode is also supported to accomodate various lighting conditions.
- **Fast and Lightweight** - Powered by Hugo, a lightning-fast static-site generator housed in a single binary file, Hextra keeps its footprint minimal. No Javascript or Node.js are needed to use it.
- **Full-text Search** - Built-in offline full-text search powered by FlexSearch, no additional configuration required.
- **Battery-included** - Markdown, syntax highlighting, LaTeX math formulae, diagrams and Shortcodes elements to enhance your content. Table of contents, breadcumbs, pagination, sidebar navigation and more are all automatically generated.
- **Responsive Layout and Dark Mode** - It looks great on all devices, from mobile to desktop. Dark mode is also supported to accommodate various lighting conditions.
- **Fast and Lightweight** - Powered by Hugo, a lightning-fast static-site generator housed in a single binary file, Hextra keeps its footprint minimal. No JavaScript or Node.js are needed to use it.
- **Full-text Search** - Built-in offline full-text search powered by FlexSearch, no extra configuration required.
- **Battery-included** - Markdown, syntax highlighting, LaTeX math formulae, diagrams and Shortcodes elements to enhance your content. Table of contents, breadcrumbs, pagination, sidebar navigation and more are all automatically generated.
- **Multi-language and SEO Ready** - Multi-language sites made easy with Hugo's multilingual mode. Out-of-the-box support is included for SEO tags, Open Graph, and Twitter Cards.
## Quick Start
@ -39,7 +40,7 @@ Refer to the [documentation](https://imfing.github.io/hextra/docs) for more info
## Contributing
Contributions are welcome!
Contributions are welcome.
Check out the [contributing guide](.github/CONTRIBUTING.md) to get started.
## License

View File

@ -1,5 +1,6 @@
<div align="center">
<h1 align="center">Hextra</h1>
<sup align="center"><a href="README.md">English</a> | <a href="README.zh-cn.md">简体中文</a> <a href="README.fa.md">فارسی</a></sup>
<p align="center">用于创建美观的静态站点的现代化, 响应式, 功能强大的 Hugo 主题.</p>
演示 → [imfing.github.io/hextra](https://imfing.github.io/hextra/)

View File

@ -74,7 +74,7 @@
/* CommentPreprocFile */ .chroma .cpf { color: #8b949e; font-weight: bold; font-style: italic }
/* Generic */ .chroma .g { }
/* GenericDeleted */ .chroma .gd { color: #ffa198; background-color: #490202 }
/* GenericEmph */ .chroma .ge { font-style: italic }
/* GenericEmph */ .chroma .ge { color: inherit; font-style: italic }
/* GenericError */ .chroma .gr { color: #ffa198 }
/* GenericHeading */ .chroma .gh { color: #79c0ff; font-weight: bold }
/* GenericInserted */ .chroma .gi { color: #56d364; background-color: #0f5323 }

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,9 @@
.hextra-cards {
grid-template-columns: repeat(auto-fill, minmax(max(250px, calc((100% - 1rem * 2) / var(--rows))), 1fr));
grid-template-columns: repeat(auto-fill, minmax(max(250px, calc((100% - 1rem * 2) / var(--hextra-cards-grid-cols))), 1fr));
}
.hextra-card {
position: relative;
}
.hextra-card img {
@ -18,6 +22,7 @@
.hextra-card p {
margin-top: 0.5rem;
position: relative;
}
.dark .hextra-card svg {
@ -27,3 +32,11 @@
.dark .hextra-card:hover svg {
color: currentColor;
}
.hextra-card-tag {
position: absolute;
top: 5px;
right: 5px;
z-index: 10;
font-size: .65rem;
}

View File

@ -0,0 +1,7 @@
@supports (
(-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))
) {
.hextra-code-copy-btn {
@apply hx-backdrop-blur-md hx-bg-opacity-[.85] dark:hx-bg-opacity-80;
}
}

View File

@ -0,0 +1,5 @@
.hextra-feature-grid {
@media (min-width: 1024px) {
grid-template-columns: repeat(var(--hextra-feature-grid-cols), minmax(0, 1fr));
}
}

View File

@ -0,0 +1,29 @@
.hextra-jupyter-code-cell {
scrollbar-gutter: auto;
@apply hx-mt-6;
.hextra-jupyter-code-cell-source {
@apply hx-text-sm;
.chroma,
pre {
@apply hx-m-0;
}
}
.hextra-jupyter-code-cell-outputs-container {
@apply hx-text-xs hx-overflow-hidden hx-border hx-border-t-0 hx-rounded-b-xl dark:hx-border-neutral-800;
.hextra-jupyter-code-cell-outputs {
@apply hx-overflow-auto hx-max-h-[50vh];
pre {
@apply hx-p-4;
}
}
}
}
.hextra-jupyter-code-cell:has(.hextra-jupyter-code-cell-outputs) .hextra-jupyter-code-cell-source .chroma {
@apply hx-rounded-b-none;
}

View File

@ -1,6 +1,6 @@
nav {
.search-wrapper {
@apply hidden md:inline-block;
@apply hx-hidden md:hx-inline-block;
}
}
@ -8,13 +8,13 @@ nav {
(-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))
) {
.nav-container-blur {
@apply backdrop-blur-md bg-white/[.85] dark:!bg-dark/80;
@apply hx-backdrop-blur-md hx-bg-white/[.85] dark:!hx-bg-dark/80;
}
}
.hamburger-menu svg {
g {
@apply origin-center;
@apply hx-origin-center;
transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}
path {
@ -37,16 +37,16 @@ nav {
&.open > {
path {
@apply opacity-0;
@apply hx-opacity-0;
}
g:nth-of-type(1) {
@apply rotate-45;
@apply hx-rotate-45;
path {
transform: translate3d(0, 4px, 0);
}
}
g:nth-of-type(2) {
@apply -rotate-45;
@apply -hx-rotate-45;
path {
transform: translate3d(0, -4px, 0);
}

View File

@ -1,21 +1,21 @@
.hextra-scrollbar {
.hextra-scrollbar, .hextra-scrollbar * {
scrollbar-width: thin; /* Firefox */
scrollbar-color: oklch(55.55% 0 0 / 40%) transparent; /* Firefox */
scrollbar-gutter: stable;
&::-webkit-scrollbar {
@apply w-3 h-3;
@apply hx-w-3 hx-h-3;
}
&::-webkit-scrollbar-track {
@apply bg-transparent;
@apply hx-bg-transparent;
}
&::-webkit-scrollbar-thumb {
@apply rounded-[10px];
@apply hx-rounded-[10px];
}
&:hover::-webkit-scrollbar-thumb {
border: 3px solid transparent;
background-color: var(--tw-shadow-color);
background-clip: content-box;
@apply shadow-neutral-500/20 hover:shadow-neutral-500/40;
@apply hx-shadow-neutral-500/20 hover:hx-shadow-neutral-500/40;
}
}

View File

@ -1,31 +1,31 @@
.search-wrapper {
li {
@apply mx-2.5 break-words rounded-md contrast-more:border text-gray-800 contrast-more:border-transparent dark:text-gray-300;
@apply hx-mx-2.5 hx-break-words hx-rounded-md contrast-more:hx-border hx-text-gray-800 contrast-more:hx-border-transparent dark:hx-text-gray-300;
a {
@apply block scroll-m-12 px-2.5 py-2;
@apply hx-block hx-scroll-m-12 hx-px-2.5 hx-py-2;
}
.title {
@apply text-base font-semibold leading-5;
@apply hx-text-base hx-font-semibold hx-leading-5;
}
.active {
@apply rounded-md bg-primary-500/10 contrast-more:border-primary-500;
@apply hx-rounded-md hx-bg-primary-500/10 contrast-more:hx-border-primary-500;
}
}
.no-result {
@apply block select-none p-8 text-center text-sm text-gray-400;
@apply hx-block hx-select-none hx-p-8 hx-text-center hx-text-sm hx-text-gray-400;
}
.prefix {
@apply mx-2.5 mb-2 mt-6 select-none border-b border-black/10 px-2.5 pb-1.5 text-xs font-semibold
uppercase text-gray-500 first:mt-0 dark:border-white/20 dark:text-gray-300 contrast-more:border-gray-600
contrast-more:text-gray-900 contrast-more:dark:border-gray-50 contrast-more:dark:text-gray-50;
@apply hx-mx-2.5 hx-mb-2 hx-mt-6 hx-select-none hx-border-b hx-border-black/10 hx-px-2.5 hx-pb-1.5 hx-text-xs hx-font-semibold
hx-uppercase hx-text-gray-500 first:hx-mt-0 dark:hx-border-white/20 dark:hx-text-gray-300 contrast-more:hx-border-gray-600
contrast-more:hx-text-gray-900 contrast-more:dark:hx-border-gray-50 contrast-more:dark:hx-text-gray-50;
}
.excerpt {
@apply overflow-hidden text-ellipsis mt-1 text-sm leading-[1.35rem] text-gray-600 dark:text-gray-400 contrast-more:dark:text-gray-50;
@apply hx-overflow-hidden hx-text-ellipsis hx-mt-1 hx-text-sm hx-leading-[1.35rem] hx-text-gray-600 dark:hx-text-gray-400 contrast-more:dark:hx-text-gray-50;
display: -webkit-box;
line-clamp: 1;
-webkit-line-clamp: 1;
@ -33,6 +33,6 @@
}
.match {
@apply text-primary-600;
@apply hx-text-primary-600;
}
}

View File

@ -1,6 +1,6 @@
@media (max-width: 767px) {
.sidebar-container {
@apply fixed pt-[calc(var(--navbar-height))] top-0 w-full bottom-0 z-[15] overscroll-contain bg-white dark:bg-dark;
@apply hx-fixed hx-pt-[calc(var(--navbar-height))] hx-top-0 hx-w-full hx-bottom-0 hx-z-[15] hx-overscroll-contain hx-bg-white dark:hx-bg-dark;
transition: transform 0.8s cubic-bezier(0.52, 0.16, 0.04, 1);
will-change: transform, opacity;
contain: layout style;
@ -10,12 +10,12 @@
.sidebar-container {
li > div {
@apply h-0;
@apply hx-h-0;
}
li.open > div {
@apply h-auto;
@apply hx-h-auto hx-pt-1;
}
li.open > a > span > svg > path {
@apply rotate-90;
@apply hx-rotate-90;
}
}

View File

@ -2,10 +2,16 @@
counter-increment: step;
&:before {
@apply absolute w-[33px] h-[33px];
@apply border-4 border-white bg-gray-100 dark:border-dark dark:bg-neutral-800;
@apply rounded-full text-neutral-400 text-base font-normal text-center -indent-px;
@apply mt-[3px] ml-[-41px];
@apply hx-absolute hx-w-[33px] hx-h-[33px];
@apply hx-border-4 hx-border-white hx-bg-gray-100 dark:hx-border-dark dark:hx-bg-neutral-800;
@apply hx-rounded-full hx-text-neutral-400 hx-text-base hx-font-normal hx-text-center -hx-indent-px;
@apply hx-mt-[3px] ltr:hx-ml-[-41px] rtl:hx-mr-[-44px];
content: counter(step);
}
}
:lang(fa) .steps h3 {
&:before {
content: counter(step, persian);
}
}

View File

@ -2,47 +2,52 @@
@import "chroma/light.css";
@import "chroma/dark.css";
.code-block {
@apply text-[.9em] leading-5;
.hextra-code-block {
@apply hx-text-[.9em] hx-leading-5;
pre {
@apply text-[.9em] bg-primary-700/5 overflow-x-auto font-medium subpixel-antialiased dark:bg-primary-300/10 contrast-more:border contrast-more:border-primary-900/20 contrast-more:contrast-150 contrast-more:dark:border-primary-100/40;
@apply hx-text-[.9em] hx-bg-primary-700/5 hx-overflow-x-auto hx-font-medium hx-subpixel-antialiased dark:hx-bg-primary-300/10 contrast-more:hx-border contrast-more:hx-border-primary-900/20 contrast-more:hx-contrast-150 contrast-more:dark:hx-border-primary-100/40;
}
.filename {
@apply absolute top-0 z-[1] w-full truncate rounded-t-xl bg-primary-700/5 py-2 px-4 text-xs text-gray-700 dark:bg-primary-300/10 dark:text-gray-200;
@apply hx-absolute hx-top-0 hx-z-[1] hx-w-full hx-truncate hx-rounded-t-xl hx-bg-primary-700/5 hx-py-2 hx-px-4 hx-text-xs hx-text-gray-700 dark:hx-bg-primary-300/10 dark:hx-text-gray-200;
}
.filename + pre:not(.lntable pre) {
/* Override padding for code blocks with filename but no highlight */
@apply hx-pt-12;
}
}
.code-block pre:not(.lntable pre) {
@apply px-4 mb-4 py-4 rounded-xl;
.hextra-code-block pre:not(.lntable pre) {
@apply hx-px-4 hx-mb-4 hx-py-4 hx-rounded-xl;
}
.code-block div:nth-of-type(2) pre {
@apply pt-12 pb-4;
.hextra-code-block div:nth-of-type(2) pre {
@apply hx-pt-12 hx-pb-4;
}
.chroma {
.lntable {
@apply m-0 block w-auto overflow-auto rounded-xl;
@apply hx-m-0 hx-block hx-w-auto hx-overflow-auto hx-rounded-xl;
pre {
@apply pt-4 pb-4;
@apply hx-pt-4 hx-pb-4;
}
}
.ln,
.lnt:not(.hl > .lnt),
.hl {
@apply pl-4 pr-4 min-w-[2.6rem] text-neutral-600 dark:text-neutral-300;
.hl:not(.line) {
@apply hx-pl-4 hx-pr-4 hx-min-w-[2.6rem] hx-text-neutral-600 dark:hx-text-neutral-300;
}
.lntd {
@apply p-0 align-top;
@apply hx-p-0 hx-align-top;
}
.lntd:last-of-type {
@apply w-full;
@apply hx-w-full;
}
/* LineHighlight */
.hl {
@apply block w-full bg-primary-800/10;
@apply hx-block hx-w-full hx-bg-primary-800/10;
}
}

View File

@ -8,23 +8,27 @@
@import "components/sidebar.css";
@import "components/navbar.css";
@import "components/scrollbar.css";
@import "components/code-copy.css";
@import "components/hextra/feature-grid.css";
html {
@apply text-base antialiased;
@apply hx-text-base hx-antialiased;
font-feature-settings: "rlig" 1, "calt" 1, "ss01" 1;
-webkit-tap-highlight-color: transparent;
}
body {
@apply w-full bg-white dark:bg-dark dark:text-gray-100;
@apply hx-w-full hx-bg-white dark:hx-bg-dark dark:hx-text-gray-100;
}
:root {
--primary-hue: 212deg;
--primary-saturation: 100%;
--navbar-height: 4rem;
--menu-height: 3.75rem;
}
.dark {
--primary-hue: 204deg;
--primary-saturation: 100%;
}

View File

@ -1,154 +1,133 @@
.content {
h1 {
@apply mt-2 text-4xl font-bold tracking-tight text-slate-900 dark:text-slate-100;
:where(h1):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply hx-mt-2 hx-text-4xl hx-font-bold hx-tracking-tight hx-text-slate-900 dark:hx-text-slate-100;
}
h2 {
@apply font-semibold tracking-tight text-slate-900 dark:text-slate-100 mt-10 border-b pb-1 text-3xl border-neutral-200/70 contrast-more:border-neutral-400 dark:border-primary-100/10 contrast-more:dark:border-neutral-400;
:where(h2):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply hx-font-semibold hx-tracking-tight hx-text-slate-900 dark:hx-text-slate-100 hx-mt-10 hx-border-b hx-pb-1 hx-text-3xl hx-border-neutral-200/70 contrast-more:hx-border-neutral-400 dark:hx-border-primary-100/10 contrast-more:dark:hx-border-neutral-400;
}
h3 {
@apply font-semibold tracking-tight text-slate-900 dark:text-slate-100 mt-8 text-2xl;
:where(h3):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply hx-font-semibold hx-tracking-tight hx-text-slate-900 dark:hx-text-slate-100 hx-mt-8 hx-text-2xl;
}
h4 {
@apply font-semibold tracking-tight text-slate-900 dark:text-slate-100 mt-8 text-xl;
:where(h4):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply hx-font-semibold hx-tracking-tight hx-text-slate-900 dark:hx-text-slate-100 hx-mt-8 hx-text-xl;
}
h5 {
@apply font-semibold tracking-tight text-slate-900 dark:text-slate-100 mt-8 text-lg;
:where(h5):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply hx-font-semibold hx-tracking-tight hx-text-slate-900 dark:hx-text-slate-100 hx-mt-8 hx-text-lg;
}
h6 {
@apply font-semibold tracking-tight text-slate-900 dark:text-slate-100 mt-8 text-base;
:where(h6):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply hx-font-semibold hx-tracking-tight hx-text-slate-900 dark:hx-text-slate-100 hx-mt-8 hx-text-base;
}
p {
@apply mt-6 leading-7 first:mt-0;
:where(p):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply hx-mt-6 hx-leading-7 first:hx-mt-0;
}
a {
@apply text-primary-600 underline decoration-from-font [text-underline-position:from-font];
:where(a):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply hx-text-primary-600 hx-underline hx-decoration-from-font [text-underline-position:from-font];
}
.not-prose a {
@apply text-current no-underline;
:where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply hx-mt-6 hx-border-gray-300 hx-italic hx-text-gray-700 dark:hx-border-gray-700 dark:hx-text-gray-400 first:hx-mt-0 ltr:hx-border-l-2 ltr:hx-pl-6 rtl:hx-border-r-2 rtl:hx-pr-6;
}
blockquote {
@apply mt-6 border-gray-300 italic text-gray-700 dark:border-gray-700 dark:text-gray-400 first:mt-0 ltr:border-l-2 ltr:pl-6 rtl:border-r-2 rtl:pr-6;
:where(pre):not(:where(.hextra-code-block pre, [class~=not-prose],[class~=not-prose] *)) {
@apply hx-bg-primary-700/5 hx-mb-4 hx-overflow-x-auto hx-rounded-xl hx-font-medium hx-subpixel-antialiased dark:hx-bg-primary-300/10 hx-text-[.9em] contrast-more:hx-border contrast-more:hx-border-primary-900/20 contrast-more:hx-contrast-150 contrast-more:dark:hx-border-primary-100/40 hx-py-4;
}
pre:not(.code-block pre) {
@apply bg-primary-700/5 mb-4 overflow-x-auto rounded-xl font-medium subpixel-antialiased dark:bg-primary-300/10 text-[.9em] contrast-more:border contrast-more:border-primary-900/20 contrast-more:contrast-150 contrast-more:dark:border-primary-100/40 py-4;
:where(code):not(:where(.hextra-code-block code, [class~=not-prose],[class~=not-prose] *)) {
@apply hx-border-black hx-border-opacity-[0.04] hx-bg-opacity-[0.03] hx-bg-black hx-break-words hx-rounded-md hx-border hx-py-0.5 hx-px-[.25em] hx-text-[.9em] dark:hx-border-white/10 dark:hx-bg-white/10;
}
code:not(.code-block code) {
@apply border-black border-opacity-[0.04] bg-opacity-[0.03] bg-black break-words rounded-md border py-0.5 px-[.25em] text-[.9em] dark:border-white/10 dark:bg-white/10;
}
table:not(.code-block table) {
@apply block overflow-x-auto mt-6 p-0 first:mt-0;
:where(table):not(:where(.hextra-code-block table, [class~=not-prose],[class~=not-prose] *)) {
@apply hx-block hx-overflow-x-auto hx-mt-6 hx-p-0 first:hx-mt-0;
tr {
@apply m-0 border-t border-gray-300 p-0 dark:border-gray-600 even:bg-gray-100 even:dark:bg-gray-600/20;
@apply hx-m-0 hx-border-t hx-border-gray-300 hx-p-0 dark:hx-border-gray-600 even:hx-bg-gray-100 even:dark:hx-bg-gray-600/20;
}
th {
@apply m-0 border border-gray-300 px-4 py-2 font-semibold dark:border-gray-600;
@apply hx-m-0 hx-border hx-border-gray-300 hx-px-4 hx-py-2 hx-font-semibold dark:hx-border-gray-600;
}
td {
@apply m-0 border border-gray-300 px-4 py-2 dark:border-gray-600;
@apply hx-m-0 hx-border hx-border-gray-300 hx-px-4 hx-py-2 dark:hx-border-gray-600;
}
}
ol {
@apply mt-6 list-decimal first:mt-0 ltr:ml-6 rtl:mr-6;
:where(ol):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply hx-mt-6 hx-list-decimal first:hx-mt-0 ltr:hx-ml-6 rtl:hx-mr-6;
li {
@apply my-2;
@apply hx-my-2;
}
}
ul {
@apply mt-6 list-disc first:mt-0 ltr:ml-6 rtl:mr-6;
:where(ul):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply hx-mt-6 hx-list-disc first:hx-mt-0 ltr:hx-ml-6 rtl:hx-mr-6;
li {
@apply my-2;
@apply hx-my-2;
}
}
.not-prose ul, .not-prose ol {
@apply m-0 list-none;
li {
@apply m-0;
}
/* This CSS rule targets the first nested unordered (ul) or ordered (ol) list
inside the list item (li) of any parent ul or ol.
The rule sets the top margin of the selected list to zero. */
:where(ul, ol) > li > :where(ul, ol):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply hx-mt-0;
}
kbd {
@apply border-black border-opacity-[0.04] bg-opacity-[0.03] bg-black break-words rounded-md border py-0.5 px-[.25em] text-[.9em] dark:border-white/10 dark:bg-white/10;
:where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply hx-border-black hx-border-opacity-[0.04] hx-bg-opacity-[0.03] hx-bg-black hx-break-words hx-rounded-md hx-border hx-py-0.5 hx-px-[.25em] hx-text-[.9em] dark:hx-border-white/10 dark:hx-bg-white/10;
}
pre:not(.code-block pre).mermaid {
@apply bg-transparent rounded-none dark:bg-transparent;
:where(pre.mermaid):not(:where(.hextra-code-block pre, [class~=not-prose],[class~=not-prose] *)) {
@apply hx-bg-transparent hx-rounded-none dark:hx-bg-transparent;
}
img {
@apply mx-auto my-4 rounded-md;
:where(img):not(:where([class~=not-prose],[class~=not-prose] *)) {
@apply hx-mx-auto hx-my-4 hx-rounded-md;
}
.not-prose img {
@apply m-0 rounded-none;
}
figure {
:where(figure):not(:where([class~=not-prose],[class~=not-prose] *)) {
figcaption {
@apply text-sm text-gray-500 dark:text-gray-400 mt-2 block text-center;
@apply hx-text-sm hx-text-gray-500 dark:hx-text-gray-400 hx-mt-2 hx-block hx-text-center;
}
}
/* Definition list */
:where(dl):not(:where([class~=not-prose],[class~=not-prose] *)) {
dt {
@apply hx-mt-6 hx-font-semibold;
}
dd {
@apply hx-my-2 hx-ps-6;
}
}
.footnotes {
@apply mt-12 text-sm;
@apply hx-mt-12 hx-text-sm;
}
}
.subheading-anchor {
@apply opacity-0 transition-opacity ltr:ml-1 rtl:mr-1;
@apply hx-opacity-0 hx-transition-opacity ltr:hx-ml-1 rtl:hx-mr-1;
span:target + &,
:hover > &,
&:focus {
@apply opacity-100;
@apply hx-opacity-100;
}
span + &,
:hover > & {
@apply !no-underline;
@apply !hx-no-underline;
}
&:after {
@apply content-['#'] px-1;
@apply text-gray-300 dark:text-neutral-700;
@apply hx-content-['#'] hx-px-1;
@apply hx-text-gray-300 dark:hx-text-neutral-700;
span:target + & {
@apply text-gray-400;
@apply dark:text-neutral-500;
@apply hx-text-gray-400;
@apply dark:hx-text-neutral-500;
}
}
}
article.typesetting-article {
font-size: 17px;
font-feature-settings:
'rlig' 1,
'calt' 1;
h1 {
@apply mt-6 mb-4 text-center;
font-size: 2.5rem;
}
h2 {
@apply border-none;
}
a {
@apply no-underline hover:underline;
}
p {
@apply leading-8;
}
code {
@apply border-none dark:bg-neutral-700;
}
pre code {
@apply dark:bg-transparent;
}
.subheading-anchor + a {
@apply no-underline hover:no-underline after:hidden;
}
}
article details > summary {
&::-webkit-details-marker {
@apply hidden;
@apply hx-hidden;
}
&::before {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z' clip-rule='evenodd' /%3E%3C/svg%3E");
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='hx-h-5 hx-w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z' clip-rule='evenodd' /%3E%3C/svg%3E");
height: 1.2em;
width: 1.2em;
vertical-align: -4px;
padding: 0 0.6em;
}
}
:lang(fa) ol {
list-style-type: persian;
}

22
assets/js/back-to-top.js Normal file
View File

@ -0,0 +1,22 @@
// Back to top button
document.addEventListener("DOMContentLoaded", function () {
const backToTop = document.querySelector("#backToTop");
if (backToTop) {
document.addEventListener("scroll", (e) => {
if (window.scrollY > 300) {
backToTop.classList.remove("hx-opacity-0");
} else {
backToTop.classList.add("hx-opacity-0");
}
});
}
});
function scrollUp() {
window.scroll({
top: 0,
left: 0,
behavior: "smooth",
});
}

View File

@ -1,30 +1,66 @@
document.querySelectorAll('.code-copy-btn').forEach(function (button) {
button.addEventListener('click', function (e) {
e.preventDefault();
const targetId = button.getAttribute('data-clipboard-target');
const target = document.querySelector(targetId);
let codeElement;
if (target.tagName === 'CODE') {
codeElement = target;
} else {
// Select the last code element in case line numbers are present
const codeElements = target.querySelectorAll('code');
codeElement = codeElements[codeElements.length - 1];
}
if (codeElement) {
// Replace double newlines with single newlines in the innerText
// as each line inside <span> has trailing newline '\n'
const code = codeElement.innerText.replace(/\n\n/g, '\n');
navigator.clipboard.writeText(code).then(function () {
button.classList.add('copied');
setTimeout(function () {
button.classList.remove('copied');
}, 500);
}).catch(function (err) {
console.error('Failed to copy text: ', err);
});
} else {
console.error('Target element not found');
}
// Copy button for code blocks
document.addEventListener('DOMContentLoaded', function () {
const getCopyIcon = () => {
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
svg.innerHTML = `
<path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
`;
svg.setAttribute('fill', 'none');
svg.setAttribute('viewBox', '0 0 24 24');
svg.setAttribute('stroke', 'currentColor');
svg.setAttribute('stroke-width', '2');
return svg;
}
const getSuccessIcon = () => {
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
svg.innerHTML = `
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
`;
svg.setAttribute('fill', 'none');
svg.setAttribute('viewBox', '0 0 24 24');
svg.setAttribute('stroke', 'currentColor');
svg.setAttribute('stroke-width', '2');
return svg;
}
document.querySelectorAll('.hextra-code-copy-btn').forEach(function (button) {
// Add copy and success icons
button.querySelector('.copy-icon')?.appendChild(getCopyIcon());
button.querySelector('.success-icon')?.appendChild(getSuccessIcon());
// Add click event listener for copy button
button.addEventListener('click', function (e) {
e.preventDefault();
// Get the code target
const target = button.parentElement.previousElementSibling;
let codeElement;
if (target.tagName === 'CODE') {
codeElement = target;
} else {
// Select the last code element in case line numbers are present
const codeElements = target.querySelectorAll('code');
codeElement = codeElements[codeElements.length - 1];
}
if (codeElement) {
let code = codeElement.innerText;
// Replace double newlines with single newlines in the innerText
// as each line inside <span> has trailing newline '\n'
if ("lang" in codeElement.dataset) {
code = code.replace(/\n\n/g, '\n');
}
navigator.clipboard.writeText(code).then(function () {
button.classList.add('copied');
setTimeout(function () {
button.classList.remove('copied');
}, 1000);
}).catch(function (err) {
console.error('Failed to copy text: ', err);
});
} else {
console.error('Target element not found');
}
});
});
});

View File

@ -1,5 +1,16 @@
// Search functionality using FlexSearch.
// Change shortcut key to cmd+k on Mac, iPad or iPhone.
document.addEventListener("DOMContentLoaded", function () {
if (/iPad|iPhone|Macintosh/.test(navigator.userAgent)) {
// select the kbd element under the .search-wrapper class
const keys = document.querySelectorAll(".search-wrapper kbd");
keys.forEach(key => {
key.innerHTML = '<span class="hx-text-xs">⌘</span>K';
});
}
});
// Render the search data as JSON.
// {{ $searchDataFile := printf "%s.search-data.json" .Language.Lang }}
// {{ $searchData := resources.Get "json/search-data.json" | resources.ExecuteAsTemplate $searchDataFile . }}
@ -16,6 +27,20 @@
el.addEventListener('focus', init);
el.addEventListener('keyup', search);
el.addEventListener('keydown', handleKeyDown);
el.addEventListener('input', handleInputChange);
}
const shortcutElements = document.querySelectorAll('.search-wrapper kbd');
function setShortcutElementsOpacity(opacity) {
shortcutElements.forEach(el => {
el.style.opacity = opacity;
});
}
function handleInputChange(e) {
const opacity = e.target.value.length > 0 ? 0 : 100;
setShortcutElementsOpacity(opacity);
}
// Get the search wrapper, input, and results elements.
@ -68,6 +93,7 @@
e.target !== resultsElement &&
!resultsElement.contains(e.target)
) {
setShortcutElementsOpacity(100);
hideSearchResults();
}
});
@ -117,7 +143,7 @@
function hideSearchResults() {
const { resultsElement } = getActiveSearchElement();
if (!resultsElement) return;
resultsElement.classList.add('hidden');
resultsElement.classList.add('hx-hidden');
}
// Handle keyboard events.
@ -146,6 +172,10 @@
case 'Escape':
e.preventDefault();
hideSearchResults();
// Clear the input when pressing escape
inputElement.value = '';
inputElement.dispatchEvent(new Event('input'));
// Remove focus from the input
inputElement.blur();
break;
}
@ -159,10 +189,14 @@
}
}
// Preload the search index.
/**
* Preloads the search index by fetching data and adding it to the FlexSearch index.
* @returns {Promise<void>} A promise that resolves when the index is preloaded.
*/
async function preloadIndex() {
const tokenize = '{{- site.Params.search.flexsearch.tokenize | default "forward" -}}';
window.pageIndex = new FlexSearch.Document({
tokenize: 'forward',
tokenize,
cache: 100,
document: {
id: 'id',
@ -172,7 +206,7 @@
});
window.sectionIndex = new FlexSearch.Document({
tokenize: 'forward',
tokenize,
cache: 100,
document: {
id: 'id',
@ -228,6 +262,10 @@
}
}
/**
* Performs a search based on the provided query and displays the results.
* @param {Event} e - The event object.
*/
function search(e) {
const query = e.target.value;
if (!e.target.value) {
@ -239,7 +277,7 @@
while (resultsElement.firstChild) {
resultsElement.removeChild(resultsElement.firstChild);
}
resultsElement.classList.remove('hidden');
resultsElement.classList.remove('hx-hidden');
const pageResults = window.pageIndex.search(query, 5, { enrich: true, suggest: true })[0]?.result || [];
@ -296,6 +334,12 @@
displayResults(sortedResults, query);
}
/**
* Displays the search results on the page.
*
* @param {Array} results - The array of search results.
* @param {string} query - The search query.
*/
function displayResults(results, query) {
const { resultsElement } = getActiveSearchElement();
if (!resultsElement) return;

View File

@ -5,7 +5,7 @@
e.preventDefault();
switcher.dataset.state = switcher.dataset.state === 'open' ? 'closed' : 'open';
const optionsElement = switcher.nextElementSibling;
optionsElement.classList.toggle('hidden');
optionsElement.classList.toggle('hx-hidden');
// Calculate position of language options element
const switcherRect = switcher.getBoundingClientRect();
@ -21,7 +21,7 @@
languageSwitchers.forEach((switcher) => {
switcher.dataset.state = 'closed';
const optionsElement = switcher.nextElementSibling;
optionsElement.classList.add('hidden');
optionsElement.classList.add('hx-hidden');
});
}
});

View File

@ -1,19 +1,49 @@
// Hamburger menu for mobile navigation
const menu = document.querySelector('.hamburger-menu');
menu.addEventListener('click', (e) => {
e.preventDefault();
document.addEventListener('DOMContentLoaded', function () {
const menu = document.querySelector('.hamburger-menu');
const overlay = document.querySelector('.mobile-menu-overlay');
const sidebarContainer = document.querySelector('.sidebar-container');
// Toggle the hamburger menu
menu.querySelector('svg').classList.toggle('open');
// Initialize the overlay
const overlayClasses = ['hx-fixed', 'hx-inset-0', 'hx-z-10', 'hx-bg-black/80', 'dark:hx-bg-black/60'];
overlay.classList.add('hx-bg-transparent');
overlay.classList.remove("hx-hidden", ...overlayClasses);
// When the menu is open, we want to show the navigation sidebar
sidebarContainer.classList.toggle('max-md:[transform:translate3d(0,-100%,0)]');
sidebarContainer.classList.toggle('max-md:[transform:translate3d(0,0,0)]');
function toggleMenu() {
// Toggle the hamburger menu
menu.querySelector('svg').classList.toggle('open');
// When the menu is open, we want to prevent the body from scrolling
document.body.classList.toggle('overflow-hidden');
document.body.classList.toggle('md:overflow-auto');
// When the menu is open, we want to show the navigation sidebar
sidebarContainer.classList.toggle('max-md:[transform:translate3d(0,-100%,0)]');
sidebarContainer.classList.toggle('max-md:[transform:translate3d(0,0,0)]');
// When the menu is open, we want to prevent the body from scrolling
document.body.classList.toggle('hx-overflow-hidden');
document.body.classList.toggle('md:hx-overflow-auto');
}
menu.addEventListener('click', (e) => {
e.preventDefault();
toggleMenu();
if (overlay.classList.contains('hx-bg-transparent')) {
// Show the overlay
overlay.classList.add(...overlayClasses);
overlay.classList.remove('hx-bg-transparent');
} else {
// Hide the overlay
overlay.classList.remove(...overlayClasses);
overlay.classList.add('hx-bg-transparent');
}
});
overlay.addEventListener('click', (e) => {
e.preventDefault();
toggleMenu();
// Hide the overlay
overlay.classList.remove(...overlayClasses);
overlay.classList.add('hx-bg-transparent');
});
});

View File

@ -1,14 +1,14 @@
document.querySelectorAll('.tabs-toggle').forEach(function (button) {
document.querySelectorAll('.hextra-tabs-toggle').forEach(function (button) {
button.addEventListener('click', function (e) {
// set parent tabs to unselected
const tabs = Array.from(e.target.parentElement.querySelectorAll('.tabs-toggle'));
const tabs = Array.from(e.target.parentElement.querySelectorAll('.hextra-tabs-toggle'));
tabs.map(tab => tab.dataset.state = '');
// set current tab to selected
e.target.dataset.state = 'selected';
// set all panels to unselected
const panelsContainer = e.target.parentElement.nextElementSibling;
const panelsContainer = e.target.parentElement.parentElement.nextElementSibling;
Array.from(panelsContainer.children).forEach(function (panel) {
panel.dataset.state = '';
});

View File

@ -1,40 +1,51 @@
// Dark theme toggle
// Light / Dark theme toggle
(function () {
const defaultTheme = '{{ site.Params.theme.default | default `system`}}'
const themeToggleButtons = document.querySelectorAll(".theme-toggle");
const themeToggleButtons = document.querySelectorAll(".theme-toggle");
// Change the icons inside the button based on previous settings
if (
localStorage.getItem("color-theme") === "dark" ||
(!("color-theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches)
) {
themeToggleButtons.forEach((el) => el.dataset.theme = "dark");
} else {
themeToggleButtons.forEach((el) => el.dataset.theme = "light");
}
// Change the icons of the buttons based on previous settings or system theme
if (
localStorage.getItem("color-theme") === "dark" ||
(!("color-theme" in localStorage) &&
((window.matchMedia("(prefers-color-scheme: dark)").matches && defaultTheme === "system") || defaultTheme === "dark"))
) {
themeToggleButtons.forEach((el) => el.dataset.theme = "dark");
} else {
themeToggleButtons.forEach((el) => el.dataset.theme = "light");
}
themeToggleButtons.forEach((el) => {
el.addEventListener("click", function () {
if (localStorage.getItem("color-theme")) {
if (localStorage.getItem("color-theme") === "light") {
document.documentElement.classList.add("dark");
document.documentElement.style.colorScheme = "dark";
localStorage.setItem("color-theme", "dark");
// Add click event handler to the buttons
themeToggleButtons.forEach((el) => {
el.addEventListener("click", function () {
if (localStorage.getItem("color-theme")) {
if (localStorage.getItem("color-theme") === "light") {
setDarkTheme();
localStorage.setItem("color-theme", "dark");
} else {
setLightTheme();
localStorage.setItem("color-theme", "light");
}
} else {
document.documentElement.classList.remove("dark");
document.documentElement.style.colorScheme = "light";
localStorage.setItem("color-theme", "light");
if (document.documentElement.classList.contains("dark")) {
setLightTheme();
localStorage.setItem("color-theme", "light");
} else {
setDarkTheme();
localStorage.setItem("color-theme", "dark");
}
}
} else {
if (document.documentElement.classList.contains("dark")) {
document.documentElement.classList.remove("dark");
document.documentElement.style.colorScheme = "light";
localStorage.setItem("color-theme", "light");
} else {
document.documentElement.classList.add("dark");
document.documentElement.style.colorScheme = "dark";
localStorage.setItem("color-theme", "dark");
}
}
el.dataset.theme = document.documentElement.classList.contains("dark") ? "dark" : "light";
el.dataset.theme = document.documentElement.classList.contains("dark") ? "dark" : "light";
});
});
});
// Listen for system theme changes
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (e) => {
if (defaultTheme === "system" && !("color-theme" in localStorage)) {
e.matches ? setDarkTheme() : setLightTheme();
themeToggleButtons.forEach((el) =>
el.dataset.theme = document.documentElement.classList.contains("dark") ? "dark" : "light"
);
}
});
})();

View File

@ -1,3 +1,10 @@
{{/* FlexSearch Index Data */}}
{{- $indexType := site.Params.search.flexsearch.index | default "content" -}}
{{- if not (in (slice "content" "summary" "heading" "title" ) $indexType) -}}
{{- errorf "unknown flexsearch index type: %s" $indexType -}}
{{- end -}}
{{- $pages := where .Site.Pages "Kind" "in" (slice "page" "section") -}}
{{- $pages = where $pages "Params.excludeSearch" "!=" true -}}
{{- $pages = where $pages "Content" "!=" "" -}}
@ -7,7 +14,7 @@
{{- range $index, $page := $pages -}}
{{- $pageTitle := $page.LinkTitle | default $page.File.BaseFileName -}}
{{- $pageLink := $page.RelPermalink -}}
{{- $data := partial "utils/fragments" $page -}}
{{- $data := partial "utils/fragments" (dict "context" $page "type" $indexType) -}}
{{- $output = $output | merge (dict $pageLink (dict "title" $pageTitle "data" $data)) -}}
{{- end -}}

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}()}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -9,6 +9,21 @@ github: >
<path d="M12 3C7.0275 3 3 7.12937 3 12.2276C3 16.3109 5.57625 19.7597 9.15374 20.9824C9.60374 21.0631 9.77249 20.7863 9.77249 20.5441C9.77249 20.3249 9.76125 19.5982 9.76125 18.8254C7.5 19.2522 6.915 18.2602 6.735 17.7412C6.63375 17.4759 6.19499 16.6569 5.8125 16.4378C5.4975 16.2647 5.0475 15.838 5.80124 15.8264C6.51 15.8149 7.01625 16.4954 7.18499 16.7723C7.99499 18.1679 9.28875 17.7758 9.80625 17.5335C9.885 16.9337 10.1212 16.53 10.38 16.2993C8.3775 16.0687 6.285 15.2728 6.285 11.7432C6.285 10.7397 6.63375 9.9092 7.20749 9.26326C7.1175 9.03257 6.8025 8.08674 7.2975 6.81794C7.2975 6.81794 8.05125 6.57571 9.77249 7.76377C10.4925 7.55615 11.2575 7.45234 12.0225 7.45234C12.7875 7.45234 13.5525 7.55615 14.2725 7.76377C15.9937 6.56418 16.7475 6.81794 16.7475 6.81794C17.2424 8.08674 16.9275 9.03257 16.8375 9.26326C17.4113 9.9092 17.76 10.7281 17.76 11.7432C17.76 15.2843 15.6563 16.0687 13.6537 16.2993C13.98 16.5877 14.2613 17.1414 14.2613 18.0065C14.2613 19.2407 14.25 20.2326 14.25 20.5441C14.25 20.7863 14.4188 21.0746 14.8688 20.9824C16.6554 20.364 18.2079 19.1866 19.3078 17.6162C20.4077 16.0457 20.9995 14.1611 21 12.2276C21 7.12937 16.9725 3 12 3Z"></path>
</svg>
codeberg: >
<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M11.955.49A12 12 0 0 0 0 12.49a12 12 0 0 0 1.832 6.373L11.838 5.928a.187.14 0 0 1 .324 0l10.006 12.935A12 12 0 0 0 24 12.49a12 12 0 0 0-12-12 12 12 0 0 0-.045 0zm.375 6.467 4.416 16.553a12 12 0 0 0 5.137-4.213z"/>
</svg>
gitlab: >
<svg fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="m23.6 9.593l-.033-.086L20.3.98a.851.851 0 0 0-.336-.405a.875.875 0 0 0-1 .054a.875.875 0 0 0-.29.44L16.47 7.818H7.537L5.333 1.07a.857.857 0 0 0-.29-.441a.875.875 0 0 0-1-.054a.859.859 0 0 0-.336.405L.433 9.502l-.032.086a6.066 6.066 0 0 0 2.012 7.01l.01.009l.03.021l4.977 3.727l2.462 1.863l1.5 1.132a1.009 1.009 0 0 0 1.22 0l1.499-1.132l2.461-1.863l5.006-3.75l.013-.01a6.068 6.068 0 0 0 2.01-7.002"/>
</svg>
bitbucket: >
<svg fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M.778 1.213a.768.768 0 0 0-.768.892l3.263 19.81c.084.5.515.868 1.022.873H19.95a.772.772 0 0 0 .77-.646l3.27-20.03a.768.768 0 0 0-.768-.891zM14.52 15.53H9.522L8.17 8.466h7.561z" />
</svg>
hextra: <svg viewBox="0 0 180 180" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="m 105.50024,22.224647 c -9.59169,-5.537563 -21.40871,-5.537563 -31.000093,0 L 39.054693,42.689119 C 29.463353,48.226675 23.55484,58.460531 23.55484,69.535642 v 40.928918 c 0,11.07542 5.908513,21.3092 15.499853,26.84652 l 35.445453,20.46446 c 9.591313,5.53732 21.408404,5.53732 31.000094,0 l 35.44507,-20.46446 c 9.59131,-5.53732 15.49985,-15.7711 15.49985,-26.84652 V 69.535642 c 0,-11.075111 -5.90854,-21.308967 -15.49985,-26.846523 z M 34.112797,85.737639 c -1.384445,2.397827 -1.384445,5.352099 0,7.749927 l 24.781554,42.922974 c 1.38437,2.39783 3.942853,3.87496 6.711592,3.87496 h 49.563107 c 2.76905,0 5.3273,-1.47713 6.71144,-3.87496 l 24.78194,-42.922974 c 1.38414,-2.397828 1.38414,-5.3521 0,-7.749927 L 121.88049,42.814746 c -1.38414,-2.397828 -3.94239,-3.874964 -6.71144,-3.874964 H 65.605944 c -2.768739,0 -5.327223,1.477059 -6.711592,3.874964 z" style="stroke-width:0.774993" /></svg>
hugo: <svg viewBox="0 0 370 391" xmlns="http://www.w3.org/2000/svg"><g clip-rule="evenodd" fill-rule="evenodd"><path d="m207.5 22.4 114.4 66.6c13.5 7.9 21.9 22.4 21.9 38v136.4c0 17.3-9.3 33.3-24.5 41.8l-113.5 63.9a49.06 49.06 0 0 1 -48.5-.2l-104.5-60.1c-16.4-9.5-26.6-27-26.6-45.9v-129.5c0-19.1 9.9-36.8 26.1-46.8l102.8-63.5c16-9.9 36.2-10.1 52.4-.7z" fill="#ff4088" stroke="#c9177e" stroke-width="27" /><path d="m105.6 298.2v-207.2h43.4v75.5h71.9v-75.5h43.5v207.2h-43.5v-90.6h-71.9v90.6z" fill="#fff" /></g></svg>
@ -21,6 +36,8 @@ hugo-full: >
<path fill="#fff" d="M1320.72 89.15c58.79 0 106.52 47.73 106.52 106.51 0 58.8-47.73 106.52-106.52 106.52-58.78 0-106.52-47.73-106.52-106.52 0-58.78 47.74-106.51 106.52-106.51zm0 39.57c36.95 0 66.94 30 66.94 66.94a66.97 66.97 0 0 1-66.94 66.94c-36.95 0-66.94-29.99-66.94-66.94a66.97 66.97 0 0 1 66.93-66.94h.01zm-283.8 65.31c0 47.18-8.94 60.93-26.81 80.58-17.87 19.65-41.57 27.57-71.1 27.57-27 0-48.75-9.58-67.61-26.23-20.88-18.45-36.08-47.04-36.08-78.95 0-31.37 11.72-58.48 32.49-78.67 18.22-17.67 45.34-29.18 73.3-29.18 33.77 0 68.83 15.98 90.44 47.53l-31.73 26.82c-13.45-25.03-32.94-33.46-60.82-34.26-30.83-.88-64.77 28.53-62.25 67.75 1.4 21.94 11.65 59.65 60.96 66.57 25.9 3.63 55.36-24.02 55.36-39.04H944.4v-37.5h92.5V194l.02.03zm-562.6-94.65h42.29v112.17c0 17.8.49 29.33 1.47 34.61 1.69 8.48 4.81 14.37 11.17 19.5 6.37 5.13 13.8 6.59 24.84 6.59 11.2 0 14.96-1.74 20.66-6.6 5.69-4.85 9.12-9.46 10.28-16.53 1.15-7.07 3.07-18.8 3.07-35.18V99.38h42.28v108.78c0 24.86-1.07 42.43-3.21 52.69-2.14 10.27-6.08 18.93-11.82 26-5.74 7.06-13.42 12.69-23.03 16.88-9.62 4.19-22.16 6.28-37.65 6.28-18.7 0-32.87-2.28-42.52-6.85-9.66-4.57-17.3-10.5-22.9-17.8-5.61-7.3-9.3-14.95-11.08-22.96-2.58-11.86-3.88-29.38-3.88-52.55V99.38h.03zM93.91 299.92V92.7h43.35v75.48h71.92V92.7h43.48v207.22h-43.48v-90.61h-71.92v90.61z"/>
</svg>
jupyter: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M7.157 22.201A1.784 1.799 0 0 1 5.374 24a1.784 1.799 0 0 1-1.784-1.799a1.784 1.799 0 0 1 1.784-1.799a1.784 1.799 0 0 1 1.783 1.799M20.582 1.427a1.415 1.427 0 0 1-1.415 1.428a1.415 1.427 0 0 1-1.416-1.428A1.415 1.427 0 0 1 19.167 0a1.415 1.427 0 0 1 1.415 1.427M4.992 3.336A1.047 1.056 0 0 1 3.946 4.39a1.047 1.056 0 0 1-1.047-1.055A1.047 1.056 0 0 1 3.946 2.28a1.047 1.056 0 0 1 1.046 1.056m7.336 1.517c3.769 0 7.06 1.38 8.768 3.424a9.36 9.36 0 0 0-3.393-4.547a9.24 9.24 0 0 0-5.377-1.728A9.24 9.24 0 0 0 6.95 3.73a9.36 9.36 0 0 0-3.394 4.547c1.713-2.04 5.004-3.424 8.772-3.424m.001 13.295c-3.768 0-7.06-1.381-8.768-3.425a9.36 9.36 0 0 0 3.394 4.547A9.24 9.24 0 0 0 12.33 21a9.24 9.24 0 0 0 5.377-1.729a9.36 9.36 0 0 0 3.393-4.547c-1.712 2.044-5.003 3.425-8.772 3.425Z" /></svg>
warning: <svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"></path></svg>
one: <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="-1 0 19 19"><path d="M16.417 9.6A7.917 7.917 0 1 1 8.5 1.683 7.917 7.917 0 0 1 16.417 9.6zM9.666 6.508H8.248L6.09 8.09l.806 1.103 1.222-.945v4.816h1.547z"></path></svg>
cards: <svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M6 6.878V6a2.25 2.25 0 0 1 2.25-2.25h7.5A2.25 2.25 0 0 1 18 6v.878m-12 0c.235-.083.487-.128.75-.128h10.5c.263 0 .515.045.75.128m-12 0A2.25 2.25 0 0 0 4.5 9v.878m13.5-3A2.25 2.25 0 0 1 19.5 9v.878m0 0a2.246 2.246 0 0 0-.75-.128H5.25c-.263 0-.515.045-.75.128m15 0A2.25 2.25 0 0 1 21 12v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6c0-.98.626-1.813 1.5-2.122"></path></svg>
@ -270,3 +287,5 @@ twitter: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill=
mastodon: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M23.268 5.313c-.35-2.578-2.617-4.61-5.304-5.004C17.51.242 15.792 0 11.813 0h-.03c-3.98 0-4.835.242-5.288.309C3.882.692 1.496 2.518.917 5.127.64 6.412.61 7.837.661 9.143c.074 1.874.088 3.745.26 5.611.118 1.24.325 2.47.62 3.68.55 2.237 2.777 4.098 4.96 4.857 2.336.792 4.849.923 7.256.38.265-.061.527-.132.786-.213.585-.184 1.27-.39 1.774-.753a.057.057 0 0 0 .023-.043v-1.809a.052.052 0 0 0-.02-.041.053.053 0 0 0-.046-.01 20.282 20.282 0 0 1-4.709.545c-2.73 0-3.463-1.284-3.674-1.818a5.593 5.593 0 0 1-.319-1.433.053.053 0 0 1 .066-.054c1.517.363 3.072.546 4.632.546.376 0 .75 0 1.125-.01 1.57-.044 3.224-.124 4.768-.422.038-.008.077-.015.11-.024 2.435-.464 4.753-1.92 4.989-5.604.008-.145.03-1.52.03-1.67.002-.512.167-3.63-.024-5.545zm-3.748 9.195h-2.561V8.29c0-1.309-.55-1.976-1.67-1.976-1.23 0-1.846.79-1.846 2.35v3.403h-2.546V8.663c0-1.56-.617-2.35-1.848-2.35-1.112 0-1.668.668-1.67 1.977v6.218H4.822V8.102c0-1.31.337-2.35 1.011-3.12.696-.77 1.608-1.164 2.74-1.164 1.311 0 2.302.5 2.962 1.498l.638 1.06.638-1.06c.66-.999 1.65-1.498 2.96-1.498 1.13 0 2.043.395 2.74 1.164.675.77 1.012 1.81 1.012 3.12z"></path></svg>
youtube: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="currentColor" d="M8.051 1.999h.089c.822.003 4.987.033 6.11.335a2.01 2.01 0 0 1 1.415 1.42c.101.38.172.883.22 1.402l.01.104l.022.26l.008.104c.065.914.073 1.77.074 1.957v.075c-.001.194-.01 1.108-.082 2.06l-.008.105l-.009.104c-.05.572-.124 1.14-.235 1.558a2.007 2.007 0 0 1-1.415 1.42c-1.16.312-5.569.334-6.18.335h-.142c-.309 0-1.587-.006-2.927-.052l-.17-.006l-.087-.004l-.171-.007l-.171-.007c-1.11-.049-2.167-.128-2.654-.26a2.007 2.007 0 0 1-1.415-1.419c-.111-.417-.185-.986-.235-1.558L.09 9.82l-.008-.104A31.4 31.4 0 0 1 0 7.68v-.123c.002-.215.01-.958.064-1.778l.007-.103l.003-.052l.008-.104l.022-.26l.01-.104c.048-.519.119-1.023.22-1.402a2.007 2.007 0 0 1 1.415-1.42c.487-.13 1.544-.21 2.654-.26l.17-.007l.172-.006l.086-.003l.171-.007A99.788 99.788 0 0 1 7.858 2h.193zM6.4 5.209v4.818l4.157-2.408L6.4 5.209z"/></svg>
x-twitter: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"/></svg>
linkedin: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037c-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85c3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065a2.064 2.064 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>
slack: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52a2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52zm0 1.271a2.528 2.528 0 0 1 2.521 2.521a2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521zm10.122 2.521a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522zm-1.268 0a2.528 2.528 0 0 1-2.523 2.521a2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522zm-2.523 10.122a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522zm0-1.268a2.527 2.527 0 0 1-2.52-2.523a2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523z" /></svg>

View File

@ -18,6 +18,9 @@
target = '$1'
[module]
[[module.mounts]]
source = "assets"
target = "assets"
[[module.mounts]]
source = "hugo_stats.json"
target = "assets/watching/hugo_stats.json"

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

View File

@ -0,0 +1,76 @@
---
title: تم هگزترا
layout: hextra-home
---
{{< hextra/hero-badge >}}
<div class="hx-w-2 hx-h-2 hx-rounded-full hx-bg-primary-400"></div>
<span>آزاد، متن‌باز</span>
{{< icon name="arrow-circle-left" attributes="height=14" >}}
{{< /hextra/hero-badge >}}
<div class="hx-mt-6 hx-mb-6">
{{< hextra/hero-headline >}}
ساخت وب‌سایت‌های مدرن &nbsp;<br class="sm:hx-block hx-hidden" />با مارک‌داون و هیوگو
{{< /hextra/hero-headline >}}
</div>
<div class="hx-mb-12">
{{< hextra/hero-subtitle >}}
تم هیوگو سریع و دارای امکانات کامل&nbsp;<br class="sm:hx-block hx-hidden" />برای ایجاد وب‌سایت‌های استاتیک زیبا
{{< /hextra/hero-subtitle >}}
</div>
<div class="hx-mb-6">
{{< hextra/hero-button text="شروع کنید" link="docs" >}}
</div>
<div class="hx-mt-6"></div>
{{< hextra/feature-grid >}}
{{< hextra/feature-card
title="سریع و با امکانات کامل"
subtitle="ساده و آسان برای استفاده، در عین حال قدرتمند و غنی از ویژگی‌ها متنوع."
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
image="/images/hextra-doc.webp"
imageClass="hx-top-[40%] hx-left-[24px] hx-w-[180%] sm:hx-w-[110%] dark:hx-opacity-80"
style="background: radial-gradient(ellipse at 50% 80%,rgba(194,97,254,0.15),hsla(0,0%,100%,0));"
>}}
{{< hextra/feature-card
title="مارک‌داون تنها چیزی است که شما نیاز دارید"
subtitle="فقط با مارک‌داون بنویسید. تکمیل و کامل با کامپوننت‌های کد کوتاه."
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-lg:hx-min-h-[340px]"
image="/images/hextra-markdown.webp"
imageClass="hx-top-[40%] hx-left-[36px] hx-w-[180%] sm:hx-w-[110%] dark:hx-opacity-80"
style="background: radial-gradient(ellipse at 50% 80%,rgba(142,53,74,0.15),hsla(0,0%,100%,0));"
>}}
{{< hextra/feature-card
title="جستجوی کامل متن"
subtitle="جستجوی متن کامل داخلی با FlexSearch، بدون نیاز به نصب موارد اضافی."
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
image="/images/hextra-search.webp"
imageClass="hx-top-[40%] hx-left-[36px] hx-w-[110%] sm:hx-w-[110%] dark:hx-opacity-80"
style="background: radial-gradient(ellipse at 50% 80%,rgba(221,210,59,0.15),hsla(0,0%,100%,0));"
>}}
{{< hextra/feature-card
title="سبک مانند یک پر"
subtitle="برای استفاده از هگزترا به هیچ وابستگی یا Node.js نیاز نیست. با پشتیبانی از هیوگو، یکی از سریع‌ترین تولیدکنندگان سایت استاتیک، سایت شما را تنها در چند ثانیه با یک باینری می‌سازد."
>}}
{{< hextra/feature-card
title=" واکنش‌گرا با حالت تیره"
subtitle="در اندازه‌های مختلف صفحه نمایش عالی به نظر می‌رسد. پشتیبانی از حالت تیره داخلی، با تغییر خودکار براساس اولویت سیستم کاربر."
>}}
{{< hextra/feature-card
title="ساخت و میزبانی رایگان"
subtitle="با گیت‌هاب Actions بسازید و به صورت رایگان در گیت‌هاب Pages میزبانی کنید. یا می‌توانید آن را در هر سرویس میزبانی استاتیک میزبانی کنید."
>}}
{{< hextra/feature-card
title="چند زبانه آسان"
subtitle="فقط با افزودن پسوند محلی به پرونده مارک‌داون صفحات وب‌سایت چند زبانه ایجاد کنید. افزودن پشتیبانی i18n به سایت شما بصری است."
>}}
{{< hextra/feature-card
title="و خیلی بیشتر..."
icon="sparkles"
subtitle="برجسته‌کردن سینتکس / فهرست مطالب / سئو / RSS / LaTeX / Mermaid / سفارشی‌سازی / و موارد دیگر…"
>}}
{{< /hextra/feature-grid >}}

View File

@ -2,3 +2,75 @@
title: Hextra Theme
layout: hextra-home
---
{{< hextra/hero-badge >}}
<div class="hx-w-2 hx-h-2 hx-rounded-full hx-bg-primary-400"></div>
<span>Free, open source</span>
{{< icon name="arrow-circle-right" attributes="height=14" >}}
{{< /hextra/hero-badge >}}
<div class="hx-mt-6 hx-mb-6">
{{< hextra/hero-headline >}}
Build modern websites&nbsp;<br class="sm:hx-block hx-hidden" />with Markdown and Hugo
{{< /hextra/hero-headline >}}
</div>
<div class="hx-mb-12">
{{< hextra/hero-subtitle >}}
Fast, batteries-included Hugo theme&nbsp;<br class="sm:hx-block hx-hidden" />for creating beautiful static websites
{{< /hextra/hero-subtitle >}}
</div>
<div class="hx-mb-6">
{{< hextra/hero-button text="Get Started" link="docs" >}}
</div>
<div class="hx-mt-6"></div>
{{< hextra/feature-grid >}}
{{< hextra/feature-card
title="Fast and Full-featured"
subtitle="Simple and easy to use, yet powerful and feature-rich."
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
image="images/hextra-doc.webp"
imageClass="hx-top-[40%] hx-left-[24px] hx-w-[180%] sm:hx-w-[110%] dark:hx-opacity-80"
style="background: radial-gradient(ellipse at 50% 80%,rgba(194,97,254,0.15),hsla(0,0%,100%,0));"
>}}
{{< hextra/feature-card
title="Markdown is All You Need"
subtitle="Compose with just Markdown. Enrich with Shortcode components."
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-lg:hx-min-h-[340px]"
image="images/hextra-markdown.webp"
imageClass="hx-top-[40%] hx-left-[36px] hx-w-[180%] sm:hx-w-[110%] dark:hx-opacity-80"
style="background: radial-gradient(ellipse at 50% 80%,rgba(142,53,74,0.15),hsla(0,0%,100%,0));"
>}}
{{< hextra/feature-card
title="Full Text Search"
subtitle="Built-in full text search with FlexSearch, no extra setup required."
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
image="images/hextra-search.webp"
imageClass="hx-top-[40%] hx-left-[36px] hx-w-[110%] sm:hx-w-[110%] dark:hx-opacity-80"
style="background: radial-gradient(ellipse at 50% 80%,rgba(221,210,59,0.15),hsla(0,0%,100%,0));"
>}}
{{< hextra/feature-card
title="Lightweight as a Feather"
subtitle="No dependency or Node.js is needed to use Hextra. Powered by Hugo, one of *the fastest* static site generators, building your site in just seconds with a single binary."
>}}
{{< hextra/feature-card
title="Responsive with Dark Mode Included"
subtitle="Looks great on different screen sizes. Built-in dark mode support, with auto-switching based on user's system preference."
>}}
{{< hextra/feature-card
title="Build and Host for Free"
subtitle="Build with GitHub Actions, and host for free on GitHub Pages. Alternatively it can be hosted on any static hosting service."
>}}
{{< hextra/feature-card
title="Multi-Language Made Easy"
subtitle="Create multi-language pages by just adding locales suffix to the Markdown file. Adding i18n support to your site is intuitive."
>}}
{{< hextra/feature-card
title="And Much More..."
icon="sparkles"
subtitle="Syntax highlighting / Table of contents / SEO / RSS / LaTeX / Mermaid / Customizable / and more..."
>}}
{{< /hextra/feature-grid >}}

View File

@ -0,0 +1,76 @@
---
title: Hextra 主题
layout: hextra-home
---
{{< hextra/hero-badge >}}
<div class="hx-w-2 hx-h-2 hx-rounded-full hx-bg-primary-400"></div>
<span>免费 开源</span>
{{< icon name="arrow-circle-right" attributes="height=14" >}}
{{< /hextra/hero-badge >}}
<div class="hx-mt-6 hx-mb-6">
{{< hextra/hero-headline >}}
创建现代化网站&nbsp;<br class="sm:hx-block hx-hidden" />由 Markdown 和 Hugo 驱动
{{< /hextra/hero-headline >}}
</div>
<div class="hx-mb-12">
{{< hextra/hero-subtitle >}}
极速且全能的 Hugo 主题框架&nbsp;<br class="sm:hx-block hx-hidden" />为构建现代化的静态网站而生
{{< /hextra/hero-subtitle >}}
</div>
<div class="hx-mb-6">
{{< hextra/hero-button text="现在开始" link="docs" >}}
</div>
<div class="hx-mt-6"></div>
{{< hextra/feature-grid >}}
{{< hextra/feature-card
title="快速且功能全面"
subtitle="简单易用,功能强大丰富。"
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
image="/images/hextra-doc.webp"
imageClass="hx-top-[40%] hx-left-[24px] hx-w-[180%] sm:hx-w-[110%] dark:hx-opacity-80"
style="background: radial-gradient(ellipse at 50% 80%,rgba(194,97,254,0.15),hsla(0,0%,100%,0));"
>}}
{{< hextra/feature-card
title="Markdown 写作"
subtitle="只需使用 Markdown 进行编辑。多样的 Shortcode 组件开箱即用。"
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-lg:hx-min-h-[340px]"
image="/images/hextra-markdown.webp"
imageClass="hx-top-[40%] hx-left-[36px] hx-w-[180%] sm:hx-w-[110%] dark:hx-opacity-80"
style="background: radial-gradient(ellipse at 50% 80%,rgba(142,53,74,0.15),hsla(0,0%,100%,0));"
>}}
{{< hextra/feature-card
title="全文搜索"
subtitle="内置 FlexSearch 全文搜索,无需额外设置。"
class="hx-aspect-auto md:hx-aspect-[1.1/1] max-md:hx-min-h-[340px]"
image="/images/hextra-search.webp"
imageClass="hx-top-[40%] hx-left-[36px] hx-w-[110%] sm:hx-w-[110%] dark:hx-opacity-80"
style="background: radial-gradient(ellipse at 50% 80%,rgba(221,210,59,0.15),hsla(0,0%,100%,0));"
>}}
{{< hextra/feature-card
title="轻如羽毛"
subtitle="使用 Hextra 无需依赖 Node.js。由 Hugo 提供支持Hugo 是最快的静态网站生成器之一,只需一个二进制文件即可在数秒内创建网站。"
>}}
{{< hextra/feature-card
title="响应式布局,暗黑模式"
subtitle="适应不同的屏幕尺寸。内置暗黑模式支持,并根据用户的系统偏好自动切换。"
>}}
{{< hextra/feature-card
title="免费构建和托管"
subtitle="使用 GitHub Actions 进行构建,并在 GitHub Pages 上免费托管。也可以托管在任何静态托管服务上。"
>}}
{{< hextra/feature-card
title="多语言轻松实现"
subtitle="仅需通过在 Markdown 文件后添加语言代码即可创建多语言页面。向您的站点添加 i18n 支持直观易行。"
>}}
{{< hextra/feature-card
title="还有更多..."
icon="sparkles"
subtitle="代码高亮 / 目录 / SEO / RSS / LaTeX 公式 / Mermaid 图标 / 自定义 / 等等..."
>}}
{{< /hextra/feature-grid >}}

View File

@ -0,0 +1,22 @@
---
title: درباره ما
toc: false
---
هگزترا به گونه‌ای طراحی شده است که یک موضوع ساده، سریع و انعطاف پذیر برای ساخت وب‌سایت‌های استاتیک مدرن باشد. این به ویژه برای وب‌سایت‌های مستندسازی مناسب است اما می‌تواند برای انواع مختلف سایت‌ها مانند وبلاگ‌ها، نمونه‌کار و موارد دیگر نیز استفاده شود.
Hugo مانند Jekyll، یک ایجادکننده سایت استاتیک است. چیزی که Hugo را متمایز می‌کند این است که یک باینری واحد است و نصب و اجرای آن بر روی پلتفرم‌های مختلف را آسان می‌کند. همچنین بسیار سریع و قابل اعتماد است و می‌تواند یک سایت را با هزاران صفحه در میلی‌ثانیه ارائه دهد.
هگزترا با ذهنیتی ساخته شده است که بر داشتن حداقل ردپا متمرکز شده است. برای شروع، هیچ وابستگی اضافی مانند بسته‌های Node.js لازم نیست. تنها چیزی که نیاز دارید یک پرونده پیکربندی YAML به همراه محتوای مارک‌داون شما است. بنابراین، شما می‌توانید به جای تنظیم ابزار، روی نوشتن محتوای با کیفیت تمرکز کنید.
## اعتبار
ترجمه فارسی مستندات توسط [گودرز جعفری](https://goudarzjafari.com/) انجام شده است.
هگزترا بدون ابزار و الهامات زیر ساخته نمی‌شود:
- [هیوگو](https://gohugo.io/)
- [Tailwind CSS](https://tailwindcss.com/)
- [Heroicons](https://heroicons.com/)
- [Nextra](https://nextra.vercel.app/)
- [Next.js](https://nextjs.org/)

View File

@ -1,20 +0,0 @@
---
title: "このサイトについて"
toc: false
---
Hextraは、現代的な静的ウェブサイトを構築するためのシンプルで高速で柔軟なテーマとして設計されています。特にドキュメンテーションウェブサイトに適していますが、ブログ、ポートフォリオなどのさまざまなタイプのサイトにも使用できます。
Hugoは、Jekyllと同様に静的サイトジェネレーターです。Hugoの特徴は、単一のバイナリであることで、さまざまなプラットフォームで簡単にインストールして実行できることです。また、数千ページのサイトをミリ秒単位でレンダリングできるほど非常に高速で信頼性があります。
Hextraは、最小限のフットプリントに焦点を当てた考え方で構築されています。始めるためには、Node.jsのような追加の依存関係は必要ありません。必要なのは、単一のYAML設定ファイルと、Markdownのコンテンツだけです。そのため、ツールのセットアップではなく、質の高いコンテンツの作成に集中できます。
## クレジット
Hextraをビルドするには、次のツールとインスピレーションが必要です
- [Hugo](https://gohugo.io/)
- [Tailwind CSS](https://tailwindcss.com/)
- [Heroicons](https://heroicons.com/)
- [Nextra](https://nextra.vercel.app/)
- [Next.js](https://nextjs.org/)

View File

@ -0,0 +1,10 @@
---
title: "وبلاگ"
---
<div style="text-align: center; margin-top: 1em;">
{{< hextra/hero-badge link="index.xml" >}}
<span>خوراک RSS</span>
{{< icon name="rss" attributes="height=14" >}}
{{< /hextra/hero-badge >}}
</div>

View File

@ -1,3 +1,10 @@
---
title: "Blog"
---
<div style="text-align: center; margin-top: 1em;">
{{< hextra/hero-badge link="index.xml" >}}
<span>RSS Feed</span>
{{< icon name="rss" attributes="height=14" >}}
{{< /hextra/hero-badge >}}
</div>

View File

@ -1,3 +1,10 @@
---
title: "博客"
---
---
<div style="text-align: center; margin-top: 1em;">
{{< hextra/hero-badge link="index.xml" >}}
<span>RSS 订阅</span>
{{< icon name="rss" attributes="height=14" >}}
{{< /hextra/hero-badge >}}
</div>

View File

@ -0,0 +1,166 @@
---
title: راهنمای استفاده سینتکس مارک‌داون
date: 2024-03-03
authors:
- name: imfing
link: https://github.com/imfing
image: https://github.com/imfing.png
- name: Octocat
link: https://github.com/octocat
image: https://github.com/octocat.png
- name: Goudarz Jafari
link: https://github.com/Goudarz
image: https://github.com/Goudarz.png
tags:
- Markdown
- مثال
- راهنمای
excludeSearch: true
---
این مقاله نمونه‌ای از سینتکس ابتدایی مارک‌داون را آموزش می‌دهد، که می‌توانید در پرونده‌های محتوای Hugo استفاده کنید.
<!--more-->
## سینتکس ابتدایی
### سرتیترها
```
# سرتیتر ۱
## سرتیتر ۲
### سرتیتر ۳
#### سرتیتر ۴
##### سرتیتر ۵
###### سرتیتر ۶
```
## سرتیتر ۲
### سرتیتر ۳
#### سرتیتر ۴
##### سرتیتر ۵
###### سرتیتر ۶
### تاکید
```text
*این متن کج خواهد بود*
_این متن هم کج خواهد بود_
**این متن توپر خواهد بود**
__این متن هم توپر خواهد بود__
_شما **می‌توانید** آنها را ترکیب کنید_
```
*این متن کج خواهد بود*
_این متن هم کج خواهد بود_
**این متن توپر خواهد بود**
__این متن هم توپر خواهد بود__
_شما **می‌توانید** آنها را ترکیب کنید_
### فهرست‌ها
#### مرتب نشده
```
* مورد ۱
* مورد ۲
* مورد ۱الف
* مورد ۲ب
```
* مورد ۱
* مورد ۲
* مورد ۱الف
* مورد ۲ب
#### مرتب شده
```
1. مورد ۱
2. مورد ۲
3. مورد ۳
1. مورد ۳الف
2. مورد ۳ب
```
1. مورد ۱
2. مورد ۲
3. مورد ۳
1. مورد ۳الف
2. مورد ۳ب
### عکس‌ها
```markdown
![آرم گیت‌هاب](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)
```
![آرم گیت‌هاب](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)
### پیوندها
```markdown
[هیوگو](https://gohugo.io)
```
[هیوگو](https://gohugo.io)
### بلوک نقل‌قول
```markdown
همانطور که نیوتن گفت:
> اگر فاصله دورتری را دیده‌ام با ایستادن بر شانه‌های غول‌ها بوده است.
```
> اگر فاصله دورتری را دیده‌ام با ایستادن بر شانه‌های غول‌ها بوده است.
### کد درون‌خطی
```markdown
`کد` درون‌خطی دارای `بک‌-تیک در اطراف` خود است.
```
`کد` درون‌خطی دارای `بک‌-تیک در اطراف` خود است.
### بلوک‌های کد
#### برجسته‌کردن سینتکس(Syntax)
````markdown
```go
func main() {
fmt.Println("Hello World")
}
```
````
```go
func main() {
fmt.Println("Hello World")
}
```
### جدول‌ها
```markdown
| عنوان | توضیحات |
| --------- | ----------- |
| سرتیتر | عنوان |
| پاراگراف | متن |
```
| عنوان | توضیحات |
| --------- | ----------- |
| سرتیتر | عنوان |
| پاراگراف | متن |
## منابع
- [سینتکس مارک‌داون](https://www.markdownguide.org/basic-syntax/)
- [مارک‌داون هیوگو](https://gohugo.io/content-management/formats/#markdown)

View File

@ -2,8 +2,16 @@
title: Markdown Syntax Guide
date: 2020-01-01
authors:
- name: John Doe
link: https://example.com/johndoe
- name: imfing
link: https://github.com/imfing
image: https://github.com/imfing.png
- name: Octocat
link: https://github.com/octocat
image: https://github.com/octocat.png
tags:
- Markdown
- Example
- Guide
excludeSearch: true
---

View File

@ -0,0 +1,41 @@
---
linkTitle: "مستندات"
title: معرفی
---
👋 سلام! به مستندات هگزترا خوش آمدید!
<!--more-->
## هگزترا چیه؟
هگزترا یک تم [Hugo][hugo] مدرن و سریع است که با [Tailwind CSS][tailwind-css] ساخته شده است.
طراحی شده برای ساخت وب‌سایت‌های زیبا برای مستندات، وبلاگ‌ها و وب‌سایت‌ها، ویژگی‌های خارج از جعبه و انعطاف‌پذیری را برای پاسخگویی نیازهای مختلف فراهم می‌کند.
## ویژگی‌ها
- **طراحی زیبا** - با الهام از Nextra، هگزترا از Tailwind CSS برای ارائه یک طراحی مدرن که سایت شما را برجسته می‌کند، استفاده می‌کند.
- **طراحی واکنش‌گرا و حالت تیره** - در تمام دستگاه‌ها، از تلفن همراه، تبلت تا دسکتاپ، عالی به نظر می‌رسد. حالت تیره نیز برای انطباق با شرایط مختلف روشنایی پشتیبانی می‌شود.
- **سریع و سبک** - طراحی شده توسط Hugo، یک ایجادکننده سایت استاتیک سریع مثل رعد و برق که در یک فایل باینری قرار گرفته است، هگزترا ردپای خود را به حداقل می‌رساند. برای استفاده از آن به جاوااسکریپت یا Node.js نیازی ندارید.
- **جستجوی متن کامل** - جستجوی متن کاملا آفلاین داخلی طراحی شده توسط FlexSearch، بدون نیاز به پیکربندی اضافی.
- **امکانات کامل** - برای بهتر کردن محتوای شما مارک‌داون، برجسته‌کردن سینتکس، فرمول‌های ریاضی LaTeX، نمودارها و عناصر Shortcodeها را شامل میشه. فهرست مطالب، بردکرامب، صفحه‌بندی، پیمایش نوار کناری و موارد دیگر همه به صورت خودکار تولید می‌شوند.
- **چند زبانه و سئو آماده** - سایت‌های چند زبانه با حالت چند زبانه Hugo راحت ساخته می‌شوند. پشتیبانی خارج از جعبه برای برچسب‌های سئو، Open Graph و کارت‌های توییتر گنجانده شده است.
## سوال یا بازخورد؟
{{< callout emoji="❓" >}}
هگزترا هنوز در حال توسعه است.
سوال یا بازخوردی دارید؟ با خیال راحت [یک موضوع را باز کنید](https://github.com/imfing/hextra/issues)!
{{< /callout >}}
## بعدی
برای شروع کردن به بخش زیر مراجعه کنید:
{{< cards >}}
{{< card link="getting-started" title="شروع کنید" icon="document-text" subtitle="یادگیری نحوه ایجاد وب‌سایت با استفاده از هگزترا" >}}
{{< /cards >}}
[hugo]: https://gohugo.io/
[flex-search]: https://github.com/nextapps-de/flexsearch
[tailwind-css]: https://tailwindcss.com/

View File

@ -1,17 +0,0 @@
---
linkTitle: "ドキュメンテーション"
title: Hextraへようこそ
---
👋 こんにちはHextraドキュメンテーションへようこそ
<!--more-->
## Hextraとは
Hextraは、[Hugo][hugo]テーマの一つで、[Tailwind CSS][tailwind-css]を使用して作られた、現代的で高速なバッテリー内蔵のテーマです。
ドキュメンテーション、ブログ、ウェブサイトの美しいウェブサイトを構築するために設計され、様々な要件に対応するための機能と柔軟性を提供します。
[hugo]: https://gohugo.io/
[flex-search]: https://github.com/nextapps-de/flexsearch
[tailwind-css]: https://tailwindcss.com/

View File

@ -10,15 +10,15 @@ title: Introduction
## What is Hextra?
Hextra is a modern, fast and batteries-included [Hugo][hugo] theme built with [Tailwind CSS][tailwind-css].
Designed for building beautiful websites for documentation, blogs and websites, it provides out-of-the-box features and flexibility to meet various requirements.
Designed for building beautiful websites for documentation, blogs, and websites, it provides out-of-the-box features and flexibility to meet various requirements.
## Features
- **Beautiful Design** - Inspired by Nextra, Hextra utilizes Tailwind CSS to offer a modern design that makes your site look outstanding.
- **Responsive Layout and Dark Mode** - It looks great on all devices, from mobile, tablet to desktop. Dark mode is also supported to accomodate various lighting conditions.
- **Fast and Lightweight** - Powered by Hugo, a lightning-fast static-site generator housed in a single binary file, Hextra keeps its footprint minimal. No Javascript or Node.js are needed to use it.
- **Responsive Layout and Dark Mode** - It looks great on all devices, from mobile, tablet to desktop. Dark mode is also supported to accommodate various lighting conditions.
- **Fast and Lightweight** - Powered by Hugo, a lightning-fast static-site generator housed in a single binary file, Hextra keeps its footprint minimal. No JavaScript or Node.js are needed to use it.
- **Full-text Search** - Built-in offline full-text search powered by FlexSearch, no additional configuration required.
- **Battery-included** - Markdown, syntax highlighting, LaTeX math formulae, diagrams and Shortcodes elements to enhance your content. Table of contents, breadcumbs, pagination, sidebar navigation and more are all automatically generated.
- **Battery-included** - Markdown, syntax highlighting, LaTeX math formulae, diagrams and Shortcodes elements to enhance your content. Table of contents, breadcrumbs, pagination, sidebar navigation and more are all automatically generated.
- **Multi-language and SEO Ready** - Multi-language sites made easy with Hugo's multilingual mode. Out-of-the-box support is included for SEO tags, Open Graph, and Twitter Cards.
## Questions or Feedback?

View File

@ -0,0 +1,16 @@
---
linkTitle: پیشرفته
title: موضوعات پیشرفته
prev: /docs/guide/shortcodes/steps
next: /docs/advanced/multi-language
---
این بخش برخی از موضوعات پیشرفته تم را پوشش می‌دهد.
<!--more-->
{{< cards >}}
{{< card link="multi-language" title="چند زبانه" icon="translate" >}}
{{< card link="customization" title="سفارشی‌سازی" icon="pencil" >}}
{{< card link="comments" title="سیستم نظردهی" icon="chat-alt" >}}
{{< /cards >}}

View File

@ -12,4 +12,5 @@ This section covers some advanced topics of the theme.
{{< cards >}}
{{< card link="multi-language" title="Multi-language" icon="translate" >}}
{{< card link="customization" title="Customization" icon="pencil" >}}
{{< card link="comments" title="Comments System" icon="chat-alt" >}}
{{< /cards >}}

View File

@ -0,0 +1,39 @@
---
title: سیستم نظردهی
linkTitle: نظردهی
---
هگزترا از افزودن سیستم نظردهی به سایت شما پشتیبانی می‌کند.
در حال حاضر [giscus](https://giscus.app/) پشتیبانی می‌شود.
<!--more-->
## giscus
[giscus](https://giscus.app/) یک سیستم نظردهی است که توسط [GitHub Discussions](https://docs.github.com/en/discussions) طراحی شده است. رایگان و متن باز است.
برای فعال کردن giscus، باید موارد زیر را به پرونده پیکربندی سایت اضافه کنید:
```yaml {filename="hugo.yaml"}
params:
comments:
enable: false
type: giscus
giscus:
repo: <repository>
repoId: <repository ID>
category: <category>
categoryId: <category ID>
```
تنظیمات giscus را می توانید از وب‌سایت [giscus.app](https://giscus.app/) ساخت. جزئیات بیشتر را نیز می‌توانید در آنجا ببینید.
دیدگاه‌ها را می‌توانید برای یک صفحه خاص در بالای همان صفحه فعال یا غیرفعال کرد:
```yaml {filename="content/docs/about.md"}
---
title: درباره ما
comments: true
---
```

View File

@ -0,0 +1,39 @@
---
title: Comments System
linkTitle: Comments
---
Hextra supports adding comments system to your site.
Currently [giscus](https://giscus.app/) is supported.
<!--more-->
## giscus
[giscus](https://giscus.app/) is a comments system powered by [GitHub Discussions](https://docs.github.com/en/discussions). It is free and open source.
To enable giscus, you need to add the following to the site configuration file:
```yaml {filename="hugo.yaml"}
params:
comments:
enable: false
type: giscus
giscus:
repo: <repository>
repoId: <repository ID>
category: <category>
categoryId: <category ID>
```
The giscus configurations can be constructed from the [giscus.app](https://giscus.app/) website. More details can also be found there.
Comments can be enabled or disabled for a specific page in the page front matter:
```yaml {filename="content/docs/about.md"}
---
title: About
comments: true
---
```

View File

@ -0,0 +1,39 @@
---
title: 评论系统
linkTitle: Comments
---
Hextra 支持在你的网站中添加评论系统。
目前已经支持 [giscus](https://giscus.app/).
<!--more-->
## giscus
[giscus](https://giscus.app/) 是由 [GitHub Discussions](https://docs.github.com/en/discussions)驱动的评论系统。Giscus 免费并且开源。
如需启用 Giscus, 你需要在配置文件中添加以下内容:
```yaml {filename="hugo.yaml"}
params:
comments:
enable: false
type: giscus
giscus:
repo: <repository>
repoId: <repository ID>
category: <category>
categoryId: <category ID>
```
Giscus 配置可以参考 [giscus.app](https://giscus.app/),还可以在那里找到更多详细信息。
可以在 front matter 中启用或禁用特定页面的评论:
```yaml {filename="content/docs/about.md"}
---
title: About
comments: true
---
```

View File

@ -0,0 +1,73 @@
---
title: سفارشی‌سازی هگزترا
linkTitle: سفارشی‌سازی
---
هگزترا برخی از گزینه‌های سفارشی‌سازی پیش‌فرض را در پرونده `hugo.yaml` برای پیکربندی تم ارائه می‌کند.
این صفحه گزینه‌های موجود و نحوه سفارشی‌سازی بیشتر تم را توضیح می‌دهد.
<!--more-->
## CSS سفارشی
برای افزودن CSS سفارشی، باید یک پرونده `assets/css/custom.css` در سایت خود ایجاد کنیم. هگزترا به طور خودکار این پرونده را بارگیری خواهد کرد.
### خانواده فونت
خانواده فونت برای محتوا را می‌توانید با استفاده از این سفارشی کنید:
```css {filename="assets/css/custom.css"}
.content {
font-family: "Times New Roman", Times, serif;
}
```
### عنصر کد درون‌خطی
رنگ متن ترکیب شده با `متن دیگر` را می‌توانید با موارد زیر سفارشی کرد:
```css {filename="assets/css/custom.css"}
.content code:not(.code-block code) {
color: #c97c2e;
}
```
### رنگ اصلی
رنگ اصلی تم را می‌توانید با تنظیم متغیرهای `--primary-hue` و `--primary-saturation` سفارشی کرد:
```css {filename="assets/css/custom.css"}
:root {
--primary-hue: 100deg;
--primary-saturation: 90%;
}
```
### برجسته‌کردن سینتکس
فهرست تم‌های برجسته‌کردن سینتکس در دسترس [گالری Chroma Styles](https://xyproto.github.io/splash/docs/all.html) موجود است. شیوه‌نامه را می‌توانید با استفاده از دستور زیر تولید کرد:
```shell
hugo gen chromastyles --style=github
```
برای نادیده گرفتن طرح زمینه برجسته‌کردن سینتکس پیش‌فرض، می‌توانید استایل‌های تولید شده را به پرونده CSS سفارشی اضافه کنیم.
## اسکریپت‌های سفارشی
با افزودن پرونده زیر می‌توانید اسکریپت‌های سفارشی را برای هر صفحه به انتهای اون اضافه کنید:
```
layouts/partials/custom/head-end.html
```
## طرح‌بندی‌های سفارشی
با ایجاد پرونده‌ای با همین نام در دایرکتوری `layouts` سایت خود، می‌توانید طرح‌های تم را نادیده بگیرید.
به عنوان مثال، برای لغو طرح‌بندی `single.html` برای مستندات، یک پرونده`layouts/docs/single.html` در سایت خود ایجاد کنید.
برای اطلاعات بیشتر، به [Templateهای هیوگو](https://gohugo.io/templates/) مراجعه کنید.
## سفارشی‌سازی بیشتر
چیزی را که دنبالش بودید پیدا نکردید؟ با خیال راحت [بحثی را باز کنید](https://github.com/imfing/hextra/discussions) یا به موضوع کمک کنید!

View File

@ -34,11 +34,12 @@ The color of text mixed with `other text` can customized with:
### Primary Color
The primary color of the theme can be customized by setting the `--primary-hue` variable:
The primary color of the theme can be customized by setting the `--primary-hue` and `--primary-saturation` variables:
```css {filename="assets/css/custom.css"}
:root {
--primary-hue: 100deg;
--primary-saturation: 90%;
}
```
@ -46,8 +47,8 @@ The primary color of the theme can be customized by setting the `--primary-hue`
List of available syntax highlighting themes are available at [Chroma Styles Gallery](https://xyproto.github.io/splash/docs/all.html). The stylesheet can be generated using the command:
```bash
$ hugo gen chromastyles --style=github
```shell
hugo gen chromastyles --style=github
```
To override the default syntax highlighting theme, we can add the generated styles to the custom CSS file.
@ -69,4 +70,4 @@ For further information, refer to the [Hugo Templates](https://gohugo.io/templat
## Further Customization
Didn't find what you were looking for? Feel free to [open an issue](https://github.com/imfing/hextra/issues) or make a contribution to the theme!
Didn't find what you were looking for? Feel free to [open a discussion](https://github.com/imfing/hextra/discussions) or make a contribution to the theme!

View File

@ -30,10 +30,10 @@ Hextra 在 `hugo.yaml` 中提供了一些自定义选项来配置主题。
### 代码高亮
代码高亮风格的详细信息可在 [Chroma Styles Gallery](https://xyproto.github.io/splash/docs/all.html) 中找到。 可以使用以下命令生成样式表:
代码高亮风格的详细信息可在 [Chroma Styles Gallery](https://xyproto.github.io/splash/docs/all.html) 中找到。可以使用以下命令生成样式表:
```bash
$ hugo gen chromastyles --style=github
```shell
hugo gen chromastyles --style=github
```
可将生成的样式添加到自定义 CSS 文件中以覆盖默认代码高亮样式。
@ -55,4 +55,4 @@ layouts/partials/custom/head-end.html
## 进一步定制 Hextra
没有找到你想修改的东西?在 GitHub 上[创建 Issues](https://github.com/imfing/hextra/issues) 或为 Hextra 贡献你的智慧!
没有找到你想修改的内容?在 GitHub 上[创建 Discussion](https://github.com/imfing/hextra/discussions) 或为 Hextra 贡献你的智慧!

View File

@ -0,0 +1,83 @@
---
title: "چند زبانه"
weight: 1
prev: /docs/advanced
---
هگزترا از ایجاد سایت با چندین زبان با استفاده از [حالت چند زبانه](https://gohugo.io/content-management/multilingual/) Hugo پشتیبانی می‌کند.
<!--more-->
## فعال‌سازی چند زبانه
برای اینکه سایت ما چند زبانه شود، باید زبان‌های پشتیبانی شده را به Hugo بگوییم. باید به پرونده پیکربندی سایت اضافه کنیم:
```yaml {filename="hugo.yaml"}
defaultContentLanguage: en
languages:
en:
languageName: English
weight: 1
fa:
languageName: فارسی
weight: 2
ja:
languageName: 日本語
weight: 3
```
## مدیریت ترجمه‌ها بر اساس نام پرونده
Hugo از مدیریت ترجمه با نام پرونده پشتیبانی می‌کند. به عنوان مثال، اگر یک پرونده `content/docs/_index.md` به زبان انگلیسی داشته باشیم، می توانیم یک پرونده `content/docs/_index.fa.md` برای ترجمه فارسی ایجاد کنیم.
{{< filetree/container >}}
{{< filetree/folder name="content" >}}
{{< filetree/folder name="docs" state="open" >}}
{{< filetree/file name="_index.md" >}}
{{< filetree/file name="_index.fa.md" >}}
{{< filetree/file name="_index.ja.md" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
توجه: Hugo همچنین از ت[ترجمه توسط دایرکتوری محتوا](https://gohugo.io/content-management/multilingual/#translation-by-content-directory) پشتیبانی می‌کند.
## ترجمه آیتم‌های منو
برای ترجمه آیتم‌های منو در نوار پیمایش، باید فیلد `identifier` را تنظیم کنیم:
```yaml {filename="hugo.yaml"}
menu:
main:
- identifier: documentation
name: Documentation
pageRef: /docs
weight: 1
- identifier: blog
name: Blog
pageRef: /blog
weight: 2
```
و آنها را در پرونده i18n مربوطه ترجمه کنید:
```yaml {filename="i18n/fa.yaml"}
documentation: مستندات
blog: وبلاگ
```
## ترجمه رشته‌ها
برای ترجمه رشته‌ها در مکان‌های دیگر، باید ترجمه را به پرونده i18n مربوطه اضافه کنیم:
```yaml {filename="i18n/fa.yaml"}
readMore: ادامه مطلب
```
فهرستی از رشته‌های استفاده شده در تم را می‌توان در پرونده `i18n/en.yaml` پیدا کرد.
## بیشتر بخوانید
- [حالت چند زبانه هیوگو](https://gohugo.io/content-management/multilingual/)
- [هیوگو چند زبانه قسمت ۱: ترجمه محتوا](https://www.regisphilibert.com/blog/2018/08/hugo-multilingual-part-1-managing-content-translation/)
- [هیوگو چند زبانه قسمت ۲: بومی‌سازی رشته‌ها](https://www.regisphilibert.com/blog/2018/08/hugo-multilingual-part-2-i18n-string-localization/)

View File

@ -0,0 +1,190 @@
---
title: شروع کنید
weight: 1
next: /docs/guide
prev: /docs
---
## شروع سریع از طریق Template
{{< icon "github" >}}&nbsp;[imfing/hextra-starter-template](https://github.com/imfing/hextra-starter-template)
با استفاده از template در بالای صفحه‌ای مخزن می‌توانید به سرعت شروع به کار کنید.
<img src="https://docs.github.com/assets/cb-77734/mw-1440/images/help/repository/use-this-template-button.webp" width="500">
ما یک [گردش کاری GitHub Actions](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow) ارائه کرده‌ایم که می‌تواند به ساخت و به‌کاراندازی خودکار سایت شما در گیت‌هاب Pages، برای میزبانی رایگان کمک کند. برای گزینه‌های بیشتر، [به‌کاراندازی سایت](../guide/deploy-site) را بررسی کنید.
[🌐 نسخه‌ي نمایشی ↖](https://imfing.github.io/hextra-starter-template/)
## شروع به عنوان پروژه جدید
دو راه اصلی برای اضافه کردن تم هگزترا به پروژه Hugo وجود دارد:
1. **ماژول‌های Hugo (توصیه می‌شود)**: ساده‌ترین و توصیه شده‌ترین. [ماژول‌های Hugo](https://gohugo.io/hugo-modules/) به شما امکان می‌دهند تم را مستقیما از منبع آنلاین آن وارد کنید. تم به صورت خودکار دانلود و توسط Hugo مدیریت می‌شود.
2. **ساب‌ماژول گیت**: در عوض، هگزترا را به عنوان یک [ساب‌ماژول گیت](https://git-scm.com/book/en/v2/Git-Tools-Submodules) اضافه کنید. تم توسط گیت دانلود شده و در پوشه `themes` پروژه شما ذخیره می‌شود.
### هگزترا را به عنوان ماژول Hugo راه‌اندازی کنید
#### پیش‌نیازها
قبل از شروع، باید این نرم‌افزارها را نصب کنید:
- [Hugo (extended version)](https://gohugo.io/installation/)
- [Git](https://git-scm.com/)
- [Go](https://go.dev/)
#### مراحل
{{% steps %}}
### راه‌انداختن یک سایت جدید Hugo
```shell
hugo new site my-site --format=yaml
```
### پیکربندی تم هگزترا از طریق ‌ماژول
```shell
# مقداردهی اولیه ماژول هیوگو
cd my-site
hugo mod init github.com/username/my-site
# افزودن تم هگزترا
hugo mod get github.com/imfing/hextra
```
با افزودن موارد زیر، `hugo.yaml` را برای استفاده از تم هگزترا پیکربندی کنید:
```yaml
module:
imports:
- path: github.com/imfing/hextra
```
### اولین صفحه‌های محتوای خود را ایجاد کنید
ایجاد صفحه محتوای جدید برای صفحه اصلی و صفحه مستندات:
```shell
hugo new content/_index.md
hugo new content/docs/_index.md
```
### پیش‌نمایش سایت به صورت محلی
```shell
hugo server --buildDrafts --disableFastRender
```
پیش‌نمایش سایت جدید شما در `http://localhost:1313/` در دسترس است.
{{% /steps %}}
{{% details title="چگونه تم را به‌روز کنیم؟" %}}
برای به‌روزرسانی همه ماژول‌های Hugo در پروژه خود به آخرین نسخه‌هایشان، دستور زیر را اجرا کنید:
```shell
hugo mod get -u
```
برای به‌روزرسانی هگزترا به [آخرین نسخه منتشر شده](https://github.com/imfing/hextra/releases)، دستور زیر را اجرا کنید:
```shell
hugo mod get -u github.com/imfing/hextra
```
برای جزئیات بیشتر به [ماژول‌های هیوگو](https://gohugo.io/hugo-modules/use-modules/#update-all-modules) مراجعه کنید.
{{% /details %}}
### هگزترا را به عنوان ساب‌ماژول Git راه‌اندازی کنید
#### پیش‌نیازها
قبل از شروع، باید این نرم‌افزارها را نصب کنید:
- [Hugo (extended version)](https://gohugo.io/installation/)
- [Git](https://git-scm.com/)
#### مراحل
{{% steps %}}
### راه‌انداختن یک سایت جدید Hugo
```shell
hugo new site my-site --format=yaml
```
### افزودن تم هگزترا به عنوان یک ساب‌ماژول Git
```shell
git submodule add https://github.com/imfing/hextra.git themes/hextra
```
با افزودن موارد زیر، `hugo.yaml` را برای استفاده از تم هگزترا پیکربندی کنید:
```yaml
theme: hextra
```
### اولین صفحه‌های محتوای خود را ایجاد کنید
ایجاد صفحه محتوای جدید برای صفحه اصلی و صفحه مستندات:
```shell
hugo new content/_index.md
hugo new content/docs/_index.md
```
### پیش‌نمایش سایت به صورت محلی
```shell
hugo server --buildDrafts --disableFastRender
```
پیش‌نمایش سایت جدید شما در `http://localhost:1313/` در دسترس است.
{{% /steps %}}
هنگام استفاده از [CI/CD](https://en.wikipedia.org/wiki/CI/CD) برای به‌کاراندازی وب‌سایت Hugo، از اجرای دستور زیر قبل از اجرای دستور `hugo` مطمئن شوید و ضروری است.
```shell
git submodule update --init
```
اجرا نشدن این دستور باعث می‌شود که پوشه تم با پرونده‌های تم هگزترا پر نشود و منجر به خرابی ساخت شود.
{{% details title="چگونه تم را به‌روز کنیم؟" %}}
برای به‌روزرسانی تمام ساب‌ماژول‌های در مخزن خود به آخرین commitها که موجود هست، دستور زیر را اجرا کنید:
```shell
git submodule update --remote
```
برای به‌روزرسانی هگزترا به آخرین commit، دستور زیر را اجرا کنید:
```shell
git submodule update --remote themes/hextra
```
برای جزئیات بیشتر به [ساب‌ماژول‌های Git](https://git-scm.com/book/en/v2/Git-Tools-Submodules) مراجعه کنید.
{{% /details %}}
## بعدی
برای شروع اضافه کردن مطالب بیشتر، بخش‌های زیر را کاوش کنید:
{{< cards >}}
{{< card link="../guide/organize-files" title="سازماندهی پرونده‌ها" icon="document-duplicate" >}}
{{< card link="../guide/configuration" title="پیکربندی" icon="adjustments" >}}
{{< card link="../guide/markdown" title="مارک‌داون" icon="markdown" >}}
{{< /cards >}}

View File

@ -1,6 +0,0 @@
---
title: はじめに
weight: 1
---
プロジェクトの紹介。

View File

@ -9,43 +9,55 @@ prev: /docs
{{< icon "github" >}}&nbsp;[imfing/hextra-starter-template](https://github.com/imfing/hextra-starter-template)
You will be able to quickly get started by using the above template repository.
You could quickly get started by using the above template repository.
<img src="https://docs.github.com/assets/cb-77734/mw-1440/images/help/repository/use-this-template-button.webp" width="500">
We have provided a [GitHub Actions workflow](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow) which can help automatically build and deploy your site to GitHub Pages, and host it for free.
For more options, check out [Deploy Site](../guide/deploy-site).
[🌐 Demo ↗](https://imfing.github.io/hextra-starter-template/)
## Start as New Project
### Prerequisites
There are two main ways to add the Hextra theme to your Hugo project:
Before we start, make sure we have [Hugo](https://gohugo.io/) installed.
Please refer to Hugo's [official installation guide](https://gohugo.io/installation/) for more details.
1. **Hugo Modules (Recommended)**: The simplest and recommended method. [Hugo modules](https://gohugo.io/hugo-modules/) let you pull in the theme directly from its online source. Theme is downloaded automatically and managed by Hugo.
[Hugo modules](https://gohugo.io/hugo-modules/) are the recommended way to manage Hugo themes. To use Hugo modules, we need to install [Git](https://git-scm.com/) and [Go](https://go.dev/).
2. **Git Submodule**: Alternatively, add Hextra as a [Git Submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules). The theme is downloaded by Git and stored in your project's `themes` folder.
### Setup Hextra as Hugo module
#### Prerequisites
Before starting, you need to have the following software installed:
- [Hugo (extended version)](https://gohugo.io/installation/)
- [Git](https://git-scm.com/)
- [Go](https://go.dev/)
#### Steps
{{% steps %}}
### Initialize a new Hugo site
```bash
$ hugo new site my-site --format=yaml
```shell
hugo new site my-site --format=yaml
```
### Configure Hextra theme via module
```shell
# initialize hugo module
$ cd my-site
$ hugo mod init github.com/username/my-site
cd my-site
hugo mod init github.com/username/my-site
# add Hextra theme
$ hugo mod get github.com/imfing/hextra
hugo mod get github.com/imfing/hextra
```
Edit `hugo.yaml` to enable Hextra theme:
Configure `hugo.yaml` to use Hextra theme by adding the following:
```yaml
module:
@ -55,38 +67,119 @@ module:
### Create your first content pages
Let's create a new content page for the home page and the documentation page:
Create new content page for the home page and the documentation page:
```shell
$ hugo new content/_index.md
$ hugo new content/docs/_index.md
hugo new content/_index.md
hugo new content/docs/_index.md
```
### Preview the site locally
```shell
$ hugo server --buildDrafts --disableFastRender
hugo server --buildDrafts --disableFastRender
```
Voila! You can see your new site at `http://localhost:1313/`.
Voila, your new site preview is available at `http://localhost:1313/`.
{{% /steps %}}
## Update Theme
{{% details title="How to update theme?" %}}
To update the theme to the [latest released version](https://github.com/imfing/hextra/releases), run the following command:
To update all Hugo modules in your project to their latest versions, run the following command:
```shell
$ hugo mod get -u
hugo mod get -u
```
To update Hextra to the [latest released version](https://github.com/imfing/hextra/releases), run the following command:
```shell
hugo mod get -u github.com/imfing/hextra
```
See [Hugo Modules](https://gohugo.io/hugo-modules/use-modules/#update-all-modules) for more details.
{{% /details %}}
### Setup Hextra as Git submodule
#### Prerequisites
Before starting, you need to have the following software installed:
- [Hugo (extended version)](https://gohugo.io/installation/)
- [Git](https://git-scm.com/)
#### Steps
{{% steps %}}
### Initialize a new Hugo site
```shell
hugo new site my-site --format=yaml
```
### Add Hextra theme as a Git submodule
```shell
git submodule add https://github.com/imfing/hextra.git themes/hextra
```
Configure `hugo.yaml` to use Hextra theme by adding the following:
```yaml
theme: hextra
```
### Create your first content pages
Create new content page for the home page and the documentation page:
```shell
hugo new content/_index.md
hugo new content/docs/_index.md
```
### Preview the site locally
```shell
hugo server --buildDrafts --disableFastRender
```
Your new site preview is available at `http://localhost:1313/`.
{{% /steps %}}
When using [CI/CD](https://en.wikipedia.org/wiki/CI/CD) for Hugo website deployment, it's essential to ensure that the following command is executed before running the `hugo` command.
```shell
git submodule update --init
```
Failure to run this command results in the theme folder not being populated with Hextra theme files, leading to a build failure.
{{% details title="How to update theme?" %}}
To update all submodules in your repository to their latest commits, run the following command:
```shell
git submodule update --remote
```
To update Hextra to the latest commit, run the following command:
```shell
git submodule update --remote themes/hextra
```
See [Git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) for more details.
{{% /details %}}
## Next

View File

@ -26,23 +26,21 @@ prev: /docs
[Hugo 模块](https://gohugo.io/hugo-modules/)是管理 Hugo 主题的推荐方式。要使用 Hugo 模块,我们需要安装 [Git](https://git-scm.com/) 和 [Go](https://go.dev/)。
{{% steps %}}
### 初始化 Hugo 站点
```bash
$ hugo new site my-site --format=yaml
```shell
hugo new site my-site --format=yaml
```
### 通过模块配置 Hextra 主题
### 通过 Hugo Module 安装
```shell
# 初始化 Hugo 模块
$ cd my-site
$ hugo mod init github.com/username/my-site
cd my-site
hugo mod init github.com/username/my-site
# 添加 Hextra
$ hugo mod get github.com/imfing/hextra
hugo mod get github.com/imfing/hextra
```
编辑 `hugo.yaml` 以启用 Hextra
@ -53,31 +51,92 @@ module:
- path: github.com/imfing/hextra
```
### 通过 Git Submodule 安装
#### 先决条件
在我们开始之前,你必须先确保以下软件已经安装:
- [Hugo (extended version)](https://gohugo.io/installation/)
- [Git](https://git-scm.com/)
#### 步骤
{{% steps %}}
### 初始化 Hugo 站点
```shell
hugo new site my-site --format=yaml
```
### 将 Hextra 添加为 Git Submodule
```shell
git submodule add https://github.com/imfing/hextra.git themes/hextra
```
添加以下内容来配置 `hugo.yaml` 以使用 Hextra
```yaml
theme: hextra
```
### 创建你的第一个内容页
让我们为主页和文档页面创建一个新的内容页面:
```shell
$ hugo new content/_index.md
$ hugo new content/docs/_index.md
hugo new content/_index.md
hugo new content/docs/_index.md
```
### 在本地预览站点
```shell
$ hugo server --buildDrafts --disableFastRender
hugo server --buildDrafts --disableFastRender
```
瞧!你现在可以在 `http://localhost:1313/` 看到你的新站点。
{{% /steps %}}
使用 [CI/CD](https://en.wikipedia.org/wiki/CI/CD) 进行部署时,必须确保在运行 `hugo` 命令之前执行以下命令。
```shell
git submodule update --init
```
如果不运行此命令theme 中将不会存在 Hextra 文件,进而导致构建失败。
{{% details title="如何更新主题?" %}}
如需把项目中所有的 Hugo Modules 都升级到最新,在终端中运行此命令:
```shell
hugo mod get -u
```
如需把 Hextra 升级到[最新的发行版本](https://github.com/imfing/hextra/releases), 在终端中运行此命令:
```shell
hugo mod get -u github.com/imfing/hextra
```
如果你需要获得更多信息,参见 [Hugo Modules](https://gohugo.io/hugo-modules/use-modules/#update-all-modules).
{{% /details %}}
## 接下来
你可以探索以下部分来添加更多内容:
探索这些文档以便添加更多内容:
{{< cards >}}
{{< card link="../guide/organize-files" title="目录结构" icon="document-duplicate" >}}
{{< card link="../guide/configuration" title="配置文件指南" icon="adjustments" >}}
{{< card link="../guide/organize-files" title="Organize Files" icon="document-duplicate" >}}
{{< card link="../guide/configuration" title="Configuration" icon="adjustments" >}}
{{< card link="../guide/markdown" title="Markdown" icon="markdown" >}}
{{< /cards >}}

View File

@ -0,0 +1,23 @@
---
title: راهنما
weight: 2
prev: /docs/getting-started
next: /docs/guide/organize-files
sidebar:
open: true
---
برای یادگیری نحوه استفاده از هگزترا، بخش‌های زیر را کاوش کنید:
<!--more-->
{{< cards >}}
{{< card link="organize-files" title="سازماندهی پرونده‌ها" icon="document-duplicate" >}}
{{< card link="configuration" title="پیکربندی" icon="adjustments" >}}
{{< card link="markdown" title="مارک‌داون" icon="markdown" >}}
{{< card link="syntax-highlighting" title="برجسته‌کردن سینتکس" icon="sparkles" >}}
{{< card link="latex" title="LaTeX" icon="variable" >}}
{{< card link="diagrams" title="نمودارها" icon="chart-square-bar" >}}
{{< card link="shortcodes" title="کدهای کوتاه" icon="template" >}}
{{< card link="deploy-site" title="به‌کاراندازی سایت" icon="server" >}}
{{< /cards >}}

View File

@ -7,7 +7,7 @@ sidebar:
open: true
---
Explore the following sections to learn to compose content using Hextra:
Explore the following sections to learn how to use Hextra:
<!--more-->
@ -19,4 +19,5 @@ Explore the following sections to learn to compose content using Hextra:
{{< card link="latex" title="LaTeX" icon="variable" >}}
{{< card link="diagrams" title="Diagrams" icon="chart-square-bar" >}}
{{< card link="shortcodes" title="Shortcodes" icon="template" >}}
{{< card link="deploy-site" title="Deploy Site" icon="server" >}}
{{< /cards >}}

View File

@ -0,0 +1,271 @@
---
title: پیکربندی
weight: 2
---
Hugo پیکربندی خود را از `hugo.yaml` در ریشه سایت Hugo شما می‌خواند.
پرونده پیکربندی جایی است که می‌توانید تمام جنبه‌های سایت خود را پیکربندی کنید.
پرونده پیکربندی این سایت [`exampleSite/hugo.yaml`](https://github.com/imfing/hextra/blob/main/exampleSite/hugo.yaml) را در گیت‌هاب بررسی کنید تا ایده‌ای جامع از تنظیمات موجود و بهترین شیوه‌ها بدست آورید.
<!--more-->
## ناوبری
### منو
منوی سمت چپ بالا در قسمت `menu.main` در پرونده پیکربندی تعریف شده است:
```yaml {filename="hugo.yaml"}
menu:
main:
- name: مستندات
pageRef: /docs
weight: 1
- name: وبلاگ
pageRef: /blog
weight: 2
- name: درباره ما
pageRef: /about
weight: 3
- name: جستجو
weight: 4
params:
type: search
- name: گیت‌هاب
weight: 5
url: "https://github.com/imfing/hextra"
params:
icon: github
```
انواع مختلفی از آیتم‌های منو وجود دارد:
1. پیوند به صفحه‌ای در سایت با `pageRef`
```yaml
- name: مستندات
pageRef: /docs
```
2. پیوند به یک نشانی اینترنتی با `url`
```yaml
- name: گیت‌هاب
url: "https://github.com"
```
3. نوار جستجو با `type: search`
```yaml
- name: جستجو
params:
type: search
```
4. آیکون
```yaml
- name: گیت‌هاب
params:
icon: github
```
این آیتم‌های منو را می‌توانید با تنظیم پارامتر `weight` مرتب کنید.
### آرم و عنوان
برای تغییر آرم پیش‌فرض، `hugo.yaml` را ویرایش کنید و مسیر را به پرونده آرم خود در دایرکتوری `static` اضافه کنید.
به صورت اختیاری، می‌توانید پیوندی را که کاربران هنگام کلیک کردن روی آرم شما به آن هدایت می‌شوند، تغییر دهید، همچنین عرض و ارتفاع آرم را به پیکسل تنظیم کنید.
```yaml {filename="hugo.yaml"}
params:
navbar:
displayTitle: true
displayLogo: true
logo:
path: images/logo.svg
dark: images/logo-dark.svg
link: /
width: 40
height: 20
```
## نوار کناری
### نوار کناری اصلی
برای نوار کناری اصلی، به طور خودکار از ساختار دایرکتوری محتوا تولید می‌شود.
برای جزئیات بیشتر به صفحه [سازماندهی پرونده‌ها](/fa/docs/guide/organize-files) مراجعه کنید.
برای حذف یک صفحه از نوار کناری سمت راست، پارامتر`sidebar.exclude` را در قسمت بالایی صفحه تنظیم کنید:
```yaml {filename="content/docs/guide/configuration.md"}
---
title: پیکربندی
sidebar:
exclude: true
---
```
### پیوندهای اضافی
پیوندهای اضافی نوار کناری در زیر بخش `menu.sidebar` در پرونده پیکربندی تعریف شده است:
```yaml {filename="hugo.yaml"}
menu:
sidebar:
- name: بیشتر
params:
type: separator
weight: 1
- name: "درباره ما"
pageRef: "/about"
weight: 2
- name: "مستندات هیوگو ↖"
url: "https://gohugo.io/documentation/"
weight: 3
```
## نوار کناری سمت چپ
### فهرست مطالب
فهرست مطالب به طور خودکار از سرتیرهای موجود در پرونده محتوا تولید می‌شود. می‌توان آن را با تنظیم `toc: false` در قسمت بالایی صفحه غیرفعال کرد.
```yaml {filename="content/docs/guide/configuration.md"}
---
title: پیکربندی
toc: false
---
```
### پیوند ویرایش صفحه
برای پیکربندی پیوند ویرایش صفحه، می‌توانیم پارامتر `params.editURL.base` را در پرونده پیکربندی تنظیم کنیم:
```yaml {filename="hugo.yaml"}
params:
editURL:
enable: true
base: "https://github.com/your-username/your-repo/edit/main"
```
پیوندهای ویرایش به طور خودکار برای هر صفحه براساس نشانی اینترنتی ارائه شده به عنوان دایرکتوری ریشه ایجاد می‌شود.
اگر می‌خواهید پیوند ویرایش را برای یک صفحه خاص تنظیم کنید، می‌توانید پارامتر `editURL` را در قسمت بالای صفحه تنظیم کنید:
```yaml {filename="content/docs/guide/configuration.md"}
---
title: پیکربندی
editURL: "https://example.com/edit/this/page"
---
```
## پاورقی
### کپی‌رایت
برای تغییر متن کپی‌رایت نمایش داده شده در پاورقی وب‌سایت خود، باید پرونده‌ای به نام `i18n/fa.yaml` ایجاد کنید.
در این پرونده متن کپی‌رایت جدید خود را مطابق شکل زیر مشخص کنید:
```yaml {filename="i18n/fa.yaml"}
copyright: "© ۲۰۲۴ متن شما در اینجا"
```
برای مرجع شما، یک مثال [`i18n/en.yaml`](https://github.com/imfing/hextra/blob/main/i18n/en.yaml) را می‌توانید در مخزن گیت‌هاب پیدا کنید. علاوه بر این، می‌توانید از فرمت مارک‌داون در متن کپی‌رایت استفاده کنید.
## سایر موارد
### Favicon
برای سفارشی کردن [favicon](https://en.wikipedia.org/wiki/Favicon) برای سایت خود، پرونده‌های آیکون را درون پوشه `static` قرار دهید تا [faviconهای پیش‌فرض در تم](https://github.com/imfing/hextra/tree/main/static) جایگزین شود:
{{< filetree/container >}}
{{< filetree/folder name="static" >}}
{{< filetree/file name="android-chrome-192x192.png" >}}
{{< filetree/file name="android-chrome-512x512.png" >}}
{{< filetree/file name="apple-touch-icon.png" >}}
{{< filetree/file name="favicon-16x16.png" >}}
{{< filetree/file name="favicon-32x32.png" >}}
{{< filetree/file name="favicon-dark.svg" >}}
{{< filetree/file name="favicon.ico" >}}
{{< filetree/file name="favicon.svg" >}}
{{< filetree/file name="site.webmanifest" >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
هر دو پرونده `favicon.ico` و `favicon.svg` را در پروژه خود قرار دهید، تا از نمایش صحیح faviconهای سایت خود مطمئن شوید.
در حالی که `favicon.ico` به طور کلی برای مرورگرهای قدیمی‌تر است، `favicon.svg` توسط مرورگرهای مدرن پشتیبانی می‌شود. favicon`favicon-dark.svg` اختیاری را می‌توانید برای یک تجربه سفارشی در حالت تیره اضافه کرد.
با خیال راحت از ابزارهایی مانند [favicon.io](https://favicon.io/) یا [favycon](https://github.com/ruisaraiva19/favycon) برای تولید این آیکون‌ها استفاده کنید.
### پیکربندی تم
از تنظیمات `theme` برای پیکربندی حالت پیش‌فرض تم و دکمه جابه‌جایی استفاده کنید و به بازدیدکنندگان اجازه دهید بین حالت روشن یا تیره جابجا شوند.
```yaml {filename="hugo.yaml"}
params:
theme:
# light | dark | system
default: system
displayToggle: true
```
گزینه‌های `theme.default`:
- `light` - همیشه از حالت روشن استفاده شود
- `dark` - همیشه از حالت تیره استفاده شود
- `system` - همگام‌سازی با تنظیمات سیستم‌عامل (پیش‌فرض)
پارامتر `theme.displayToggle` به شما این امکان را می‌دهد که یک دکمه جابجایی برای تغییر حالت تم‌ها نمایش دهید.
وقتی روی `true` تنظیم شود، بازدیدکنندگان می‌توانند بین حالت روشن یا تیره جابه‌جا شوند و تنظیمات پیش‌فرض را نادیده بگیرند.
### عرض صفحه
عرض صفحه را می‌توان با پارامتر `params.page.width` در پرونده پیکربندی سفارشی کرد:
```yaml {filename="hugo.yaml"}
params:
page:
# full (100%), wide (90rem), normal (1280px)
width: wide
```
سه گزینه در دسترس وجود دارد: `full`، `wide` و normal`. به طور پیش‌فرض، عرض صفحه روی normal` تنظیم شده است.
به طور مشابه، عرض نوار ناوبری و پاورقی را می‌توان با پارامترهای `params.navbar.width` و `params.footer.width` سفارشی کرد.
### فهرست جستجو
جستجوی متن کامل توسط [FlexSearch](https://github.com/nextapps-de/flexsearch) پیاده‌سازی شده و به طور پیش‌فرض فعال است.
برای سفارشی کردن فهرست جستجو، پارامتر `params.search.flexsearch.index` را در پرونده پیکربندی تنظیم کنید:
```yaml {filename="hugo.yaml"}
params:
# Search
search:
enable: true
type: flexsearch
flexsearch:
# index page by: content | summary | heading | title
index: content
```
گزینه‌های `flexsearch.index`:
- `content` - محتوای کامل صفحه (پیش‌فرض)
- `summary` - خلاصه صفحه، برای جزئیات بیشتر به [خلاصه مطالب Hugo](https://gohugo.io/content-management/summaries/) مراجعه کنید
- `heading` - سرتیترهای سطح ۱ و سطح ۲
- `title` - فقط شامل عنوان صفحه است
برای حذف یک صفحه از فهرست جستجو، `excludeSearch: true` را در قسمت بالای صفحه تنظیم کنید:
```yaml {filename="content/docs/guide/configuration.md"}
---
title: پیکربندی
excludeSearch: true
---
```
### گوگل آنالیتیکس
برای فعال کردن [گوگل آنالیتیکس](https://marketingplatform.google.com/about/analytics/)، پرچم `services.googleAnalytics.ID` را در `hugo.yaml` تنظیم کنید:
```yaml {filename="hugo.yaml"}
services:
googleAnalytics:
ID: G-MEASUREMENT_ID
```

View File

@ -5,7 +5,7 @@ weight: 2
Hugo reads its configuration from `hugo.yaml` in the root of your Hugo site.
The config file is where you can configure all aspects of your site.
You can find the config file for this site in `exampleSite/hugo.yaml` as a good starting point.
Check out the config file for this site [`exampleSite/hugo.yaml`](https://github.com/imfing/hextra/blob/main/exampleSite/hugo.yaml) on GitHub to get a comprehensive idea of available settings and best practices.
<!--more-->
@ -90,6 +90,16 @@ params:
For the main sidebar, it is automatically generated from the structure of the content directory.
See the [Organize Files](/docs/guide/organize-files) page for more details.
To exclude a single page from the left sidebar, set the `sidebar.exclude` parameter in the front matter of the page:
```yaml {filename="content/docs/guide/configuration.md"}
---
title: Configuration
sidebar:
exclude: true
---
```
### Extra Links
Sidebar extra links are defined under the `menu.sidebar` section in the config file:
@ -129,17 +139,17 @@ To configure the page edit link, we can set the `params.editURL.base` parameter
```yaml {filename="hugo.yaml"}
params:
editURL:
enable: true
base: "https://github.com/your-username/your-repo/edit/main"
```
The edit links will be automatically generated for each page.
If you want to set edit link for a specific page, you can set the `params.editURL` parameter in the front matter of the page:
The edit links will be automatically generated for each page based on the provided url as root directory.
If you want to set edit link for a specific page, you can set the `editURL` parameter in the front matter of the page:
```yaml {filename="content/docs/guide/configuration.md"}
---
title: Configuration
params:
editURL: "https://example.com/edit/this/page"
editURL: "https://example.com/edit/this/page"
---
```
@ -151,7 +161,7 @@ To modify the copyright text displayed in your website's footer, you'll need to
In this file, specify your new copyright text as shown below:
```yaml {filename="i18n/en.yaml"}
copyright: "© 2023 YOUR TEXT HERE"
copyright: "© 2024 YOUR TEXT HERE"
```
For your reference, an example [`i18n/en.yaml`](https://github.com/imfing/hextra/blob/main/i18n/en.yaml) file can be found in the GitHub repository. Additionally, you could use Markdown format in the copyright text.
@ -180,3 +190,99 @@ Include both `favicon.ico` and `favicon.svg` files in your project to ensure you
While `favicon.ico` is generally for older browsers, `favicon.svg` is supported by modern ones. The optional `favicon-dark.svg` can be included for a tailored experience in dark mode.
Feel free to use tools like [favicon.io](https://favicon.io/) or [favycon](https://github.com/ruisaraiva19/favycon) to generate these icons.
### Theme Configuration
Use the `theme` setting to configure the default theme mode and toggle button, allowing visitors to switch between light or dark mode.
```yaml {filename="hugo.yaml"}
params:
theme:
# light | dark | system
default: system
displayToggle: true
```
Options for `theme.default`:
- `light` - always use light mode
- `dark` - always use dark mode
- `system` - sync with the operating system setting (default)
The `theme.displayToggle` parameter allows you to display a toggle button for changing themes.
When set to `true`, visitors can switch between light or dark mode, overriding the default setting.
### Page Width
The width of the page can be customized by the `params.page.width` parameter in the config file:
```yaml {filename="hugo.yaml"}
params:
page:
# full (100%), wide (90rem), normal (1280px)
width: wide
```
There are three available options: `full`, `wide`, and `normal`. By default, the page width is set to `normal`.
Similarly, the width of the navbar and footer can be customized by the `params.navbar.width` and `params.footer.width` parameters.
### Search Index
Full-text search powered by [FlexSearch](https://github.com/nextapps-de/flexsearch) is enabled by default.
To customize the search index, set the `params.search.flexsearch.index` parameter in the config file:
```yaml {filename="hugo.yaml"}
params:
# Search
search:
enable: true
type: flexsearch
flexsearch:
# index page by: content | summary | heading | title
index: content
```
Options for `flexsearch.index`:
- `content` - full content of the page (default)
- `summary` - summary of the page, see [Hugo Content Summaries](https://gohugo.io/content-management/summaries/) for more details
- `heading` - level 1 and level 2 headings
- `title` - only include the page title
To customize the search tokenize, set the `params.search.flexsearch.tokenize` parameter in the config file:
```yaml {filename="hugo.yaml"}
params:
# ...
flexsearch:
# full | forward | reverse | strict
tokenize: forward
```
Options for [`flexsearch.tokenize`](https://github.com/nextapps-de/flexsearch/#tokenizer-prefix-search):
- `strict` - index whole words
- `forward` - incrementally index words in forward direction
- `reverse` - incrementally index words in both directions
- `full` - index every possible combination
To exclude a page from the search index, set the `excludeSearch: true` in the front matter of the page:
```yaml {filename="content/docs/guide/configuration.md"}
---
title: Configuration
excludeSearch: true
---
```
### Google Analytics
To enable [Google Analytics](https://marketingplatform.google.com/about/analytics/), set `services.googleAnalytics.ID` flag in `hugo.yaml`:
```yaml {filename="hugo.yaml"}
services:
googleAnalytics:
ID: G-MEASUREMENT_ID
```

View File

@ -38,7 +38,7 @@ menu:
icon: github
```
有几种不同类型的菜单项:
有几种不同类型的菜单项
1. Link to a page in the site with `pageRef`
```yaml
@ -114,12 +114,145 @@ params:
```
将为每个页面自动生成编辑链接。
如需为特定页面设置编辑链接,可以在页面的 `front matter` 中设置 `params.editURL`
如需为特定页面设置编辑链接,可以在页面的 `front matter` 中设置 `editURL`
```yaml {filename="content/docs/guide/configuration.md"}
---
title: Configuration
params:
editURL: "https://example.com/edit/this/page"
editURL: "https://example.com/edit/this/page"
---
```
## Footer
### 版权声明
如需修改网站页脚中显示的版权文本您需要创建一个名为“i18n/en.yaml”的文件。
在此文件中,填写新的版权文本,像这样:
```yaml {filename="i18n/en.yaml"}
copyright: "© 2024 YOUR TEXT HERE"
```
你可以在 GitHub 存储库中找到示例 [`i18n/en.yaml`](https://github.com/imfing/hextra/blob/main/i18n/en.yaml) 文件。另外,你可以在版权文本中使用 Markdown 格式。
## 其他
### Favicon
如需自定义 [favicon](https://en.wikipedia.org/wiki/Favicon),请将图标文件放在 `static` 文件夹下以覆盖 [主题中的默认 favicon](https://github.com/imfing/hextra/tree/main/static)
{{< filetree/container >}}
{{< filetree/folder name="static" >}}
{{< filetree/file name="android-chrome-192x192.png" >}}
{{< filetree/file name="android-chrome-512x512.png" >}}
{{< filetree/file name="apple-touch-icon.png" >}}
{{< filetree/file name="favicon-16x16.png" >}}
{{< filetree/file name="favicon-32x32.png" >}}
{{< filetree/file name="favicon-dark.svg" >}}
{{< filetree/file name="favicon.ico" >}}
{{< filetree/file name="favicon.svg" >}}
{{< filetree/file name="site.webmanifest" >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
在您的项目中包含 `favicon.ico` 和 `favicon.svg` 文件,以确保网站的网站图标正确显示。
虽然 `favicon.ico` 通常适用于较旧的浏览器,但 `favicon.svg` 受到现代浏览器的支持,所以更现代的做法是添加 `favicon-dark.svg` 以便在黑暗模式下提供较好的体验体验。
请随意使用 [favicon.io](https://favicon.io/) 或 [favycon](https://github.com/ruisaraiva19/favycon) 等工具来生成这些图标。
### 颜色主题配置
使用`theme`设置来配置默认主题模式和切换按钮,允许访问者在浅色或深色模式之间切换。
```yaml {filename="hugo.yaml"}
params:
theme:
# light | dark | system
default: system
displayToggle: true
```
`theme.default` 的可选项:
- `light` - 仅使用浅色模式
- `dark` - 仅使用神色模式
- `system` - 跟随系统
`theme.displayToggle` 控制显示用于更改主题的切换按钮。
当设置为“true”时访问者可以在浅色或深色模式之间切换覆盖默认设置。
### 页宽
页面的宽度可以通过配置文件中的`params.page.width`参数来调整:
```yaml {filename="hugo.yaml"}
params:
page:
# full (100%), wide (90rem), normal (1280px)
width: wide
```
有三个可选项:`full`, `wide`, and `normal`. 默认的页宽模式是 `normal`.
同样的,导航栏和 `footer` 的宽度也可通过 `params.navbar.width` 和 `params.footer.width` 调整。
### 搜索
默认情况下启用由 [FlexSearch](https://github.com/nextapps-de/flexsearch) 提供全文搜索。
要自定义搜索索引,请在配置文件中设置 `params.search.flexsearch.index`
```yaml {filename="hugo.yaml"}
params:
# Search
search:
enable: true
type: flexsearch
flexsearch:
# index page by: content | summary | heading | title
index: content
```
`flexsearch.index` 的可选项:
- `content` - 全内容搜索
- `summary` - 概述 [Hugo Content Summaries](https://gohugo.io/content-management/summaries/)
- `heading` - 一级和二级标题
- `title` - 仅搜索标题
要自定义检索分词,请在配置文件中设置`params.search.flexsearch.tokenize`
```hugo.yaml
params:
# ...
flexsearch:
# full | forward | reverse | strict
tokenize: forward
```
[`flexsearch.tokenize`](https://github.com/nextapps-de/flexsearch/#tokenizer-prefix-search)的可选项:
- `strict` - 严格单词匹配
- `forward` - 单词前缀匹配
- `reverse` - 单词前后缀匹配
- `full` - 单词子串匹配。
> 在默认的分词逻辑下,中文一句话就是一个“单词”
要从搜索索引中排除页面,更改 front matter 中的 `excludeSearch: true`:
```yaml {filename="content/docs/guide/configuration.md"}
---
title: Configuration
excludeSearch: true
---
```
### Google Analytics
要启用 [Google Analytics](https://marketingplatform.google.com/about/analytics/),设置 `services.googleAnalytics.ID`:
```yaml {filename="hugo.yaml"}
services:
googleAnalytics:
ID: G-MEASUREMENT_ID
```

View File

@ -0,0 +1,162 @@
---
title: به‌کاراندازی سایت
prev: /docs/guide/shortcodes
next: /docs/advanced
---
Hugo وب‌سایت‌های استاتیک را ایجاد می‌کند و امکان گزینه‌های میزبانی انعطاف‌پذیر را فراهم می‌کند.
این صفحه راهنماهایی برای به‌کاراندازی سایت هگزترا شما در پلتفرم‌های مختلف ارائه می‌کند.
<!--more-->
## گیت‌هاب Pages
[گیت‌هاب Pages](https://docs.github.com/pages) روشی توصیه شده برای به‌کاراندازی و میزبانی وب‌سایت شما به صورت رایگان است.
اگر سایت را با استفاده از [hextra-starter-template](https://github.com/imfing/hextra-starter-template) راه‌اندازی سریع پیاده‌سازی می‌کنید، گردش کار گیت‌هاب Actions را به صورت خارج از جعبه ارائه کرده‌ایم که به‌کاراندازی خودکار در گیت‌هاب Pages به شما کمک می‌کند.
{{% details title="پیکربندی گیت‌هاب Actions" closed="true" %}}
در زیر یک پیکربندی مثال از [hextra-starter-template](https://github.com/imfing/hextra-starter-template) آورده شده است:
```yaml {filename=".github/workflows/pages.yaml"}
# Sample workflow for building and deploying a Hugo site to GitHub Pages
name: Deploy Hugo site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
# Default to bash
defaults:
run:
shell: bash
jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.117.0
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.117.0'
extended: true
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc --minify \
--baseURL "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./public
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
```
{{% /details %}}
{{< callout >}}
در تنظیمات مخزن خود، **Pages** > **Build and deployment** > **Source** را روی **GitHub Actions** تنظیم کنید:
![](https://user-images.githubusercontent.com/5097752/266784808-99676430-884e-42ab-b901-f6534a0d6eee.png)
{{< /callout >}}
به‌طور پیش‌فرض، گردش کار گیت‌هاب Actions بالا `.github/workflows/pages.yaml` فرض می‌کند که سایت در حال به‌کاراندازی در `https://<USERNAME>.github.io/<REPO>/` است.
اگر در حال استفاده از `https://<USERNAME>.github.io/` هستید، سپس `--baseURL` را تغییر دهید:
```yaml {filename=".github/workflows/pages.yaml",linenos=table,linenostart=54,hl_lines=[4]}
run: |
hugo \
--gc --minify \
--baseURL "https://${{ github.repository_owner }}.github.io/"
```
اگر می‌خواهید روی دامنه شخصی خود استقرار پیدا کند، لطفا مقدار `--baseURL` را بر این اساس تغییر دهید.
## کلودفلر Pages
1. کد منبع سایت خود را در یک مخزن Git (به عنوان مثال گیت‌هاب) قرار دهید
2. وارد [پیشخوان کلودفلر](https://dash.cloudflare.com/) شوید و حساب خود را انتخاب کنید
3. در صفحه اصلی حساب‌کاربری، **Workers & Pages** > **Create application** > **Pages** > **Connect to Git** را انتخاب کنید
4. مخزن را انتخاب کنید و در بخش Set up builds and Deployments اطلاعات زیر را وارد کنید:
| Configuration | Value |
| ----------------- | -------------------- |
| Production branch | `main` |
| Build command | `hugo --gc --minify` |
| Build directory | `public` |
برای جزئیات بیشتر، بررسی کنید:
- [یک سایت هیوگو راه‌اندازی کنید.](https://developers.cloudflare.com/pages/framework-guides/deploy-a-hugo-site/#deploy-with-cloudflare-pages).
- [پشتیبانی زبان و ابزار.](https://developers.cloudflare.com/pages/platform/language-support-and-tools/).
## Netlify
1. کد خود را به مخزن Git خود (گیت‌هاب، گیت‌لب و غیره) ارسال کنید.
2. [وارد کردن پروژه](https://app.netlify.com/start) به Netlify
3. اگر از [hextra-starter-template][hextra-starter-template] استفاده نمی‌کنید، موارد زیر را به صورت دستی پیکربندی کنید:
- دستور Build را روی `hugo --gc --minify` پیکربندی کنید
- دایرکتوری Publish را برای `public` مشخص کنید
- `HUGO_VERSION` متغیر محیط استقرار را اضافه کنید و روی `0.119.0` تنظیم کنید
4. استقرار!
برای جزئیات بیشتر [Hugo را در Netlify](https://docs.netlify.com/integrations/frameworks/hugo/) بررسی کنید.
## Vercel
1. کد خود را به مخزن Git خود (گیت‌هاب، گیت‌لب و غیره) ارسال کنید.
2. به [پیشخوان Vercel](https://vercel.com/dashboard) بروید و پروژه Hugo خود را وارد کنید
3. پروژه را پیکربندی کنید، Hugo را به‌ عنوان چارچوب Preset انتخاب کنید
4. دستور Build و Install را لغو کنید:
1. دستور Build را روی `hugo --gc --minify` تنظیم کنید
2. دستور Install را روی `yum install golang` تنظیم کنید
![پیکربندی استقرار Vercel](https://github.com/imfing/hextra/assets/5097752/887d949b-8d05-413f-a2b4-7ab92192d0b3)

View File

@ -0,0 +1,164 @@
---
title: Deploy Site
prev: /docs/guide/shortcodes
next: /docs/advanced
---
Hugo generates static websites, allowing for flexible hosting options.
This page provides guides for deploying your Hextra site on various platforms.
<!--more-->
## GitHub Pages
[GitHub Pages](https://docs.github.com/pages) is the recommended way to deploy and host your website for free.
If you bootstrap the site using [hextra-starter-template](https://github.com/imfing/hextra-starter-template), it has provided GitHub Actions workflow out-of-the-box that helps automatically deploy to GitHub Pages.
{{% details title="GitHub Actions Configuration" closed="true" %}}
Below is an example configuration from [hextra-starter-template](https://github.com/imfing/hextra-starter-template):
```yaml {filename=".github/workflows/pages.yaml"}
# Sample workflow for building and deploying a Hugo site to GitHub Pages
name: Deploy Hugo site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
# Default to bash
defaults:
run:
shell: bash
jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.131.0
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history for .GitInfo and .Lastmod
submodules: recursive
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Setup Hugo
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc --minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
```
{{% /details %}}
{{< callout >}}
In your repository settings, set the **Pages** > **Build and deployment** > **Source** to **GitHub Actions**:
![](https://user-images.githubusercontent.com/5097752/266784808-99676430-884e-42ab-b901-f6534a0d6eee.png)
{{< /callout >}}
By default, the above GitHub Actions workflow `.github/workflows/pages.yaml` assumes that the site is deploying to `https://<USERNAME>.github.io/<REPO>/`.
If you are deploying to `https://<USERNAME>.github.io/` then modify the `--baseURL`:
```yaml {filename=".github/workflows/pages.yaml",linenos=table,linenostart=54,hl_lines=[4]}
run: |
hugo \
--gc --minify \
--baseURL "https://${{ github.repository_owner }}.github.io/"
```
If you are deploying to your own domain, please change the `--baseURL` value accordingly.
## Cloudflare Pages
1. Put your site source code in a Git repository (e.g. GitHub)
2. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account
3. In Account Home, select **Workers & Pages** > **Create application** > **Pages** > **Connect to Git**
4. Select the repository, and in the **Set up builds and deployments** section, provide the following information:
| Configuration | Value |
| ----------------- | -------------------- |
| Production branch | `main` |
| Build command | `hugo --gc --minify` |
| Build directory | `public` |
For more details, check out:
- [Deploy a Hugo site](https://developers.cloudflare.com/pages/framework-guides/deploy-a-hugo-site/#deploy-with-cloudflare-pages).
- [Language support and tools](https://developers.cloudflare.com/pages/platform/language-support-and-tools/).
## Netlify
1. Push your code to your Git repository (GitHub, GitLab, etc.)
2. [Import the project](https://app.netlify.com/start) to Netlify
3. If you are not using [hextra-starter-template][hextra-starter-template], configure the following manually:
- Configure the Build command to `hugo --gc --minify`
- Specify the Publish directory to `public`
- Add Environment variable `HUGO_VERSION` and set to `0.132.2`
4. Deploy!
Check [Hugo on Netlify](https://docs.netlify.com/integrations/frameworks/hugo/) for more details.
## Vercel
1. Push your code to your Git repository (GitHub, GitLab, etc.)
2. Go to [Vercel Dashboard](https://vercel.com/dashboard) and import your Hugo project
3. Configure the project, select Hugo as Framework Preset
4. Override the Build Command and Install command:
1. Set Build Command to `hugo --gc --minify`
2. Set Install Command to `yum install golang`
![Vercel Deployment Configuration](https://github.com/imfing/hextra/assets/5097752/887d949b-8d05-413f-a2b4-7ab92192d0b3)

View File

@ -0,0 +1,164 @@
---
title: 部署站点
prev: /docs/guide/shortcodes
next: /docs/advanced
---
Hugo 生成静态站点,允许多种托管方式,你可以自由选择
本页将给出部署你的 Hextra 站点的方法
<!--more-->
## GitHub Pages
[GitHub Pages](https://docs.github.com/pages) 是免费部署和托管网站的推荐方法
如果您使用以下方式引导该网站 [hextra-starter-template](https://github.com/imfing/hextra-starter-template), 它提供了开箱即用的 GitHub Actions 工作流程,有助于自动部署到 GitHub Pages
{{% details title="GitHub Actions Configuration" closed="true" %}}
以下是配置来自 [hextra-starter-template](https://github.com/imfing/hextra-starter-template) 的 Workflow 的示例:
```yaml {filename=".github/workflows/pages.yaml"}
# 用于构建 Hugo 站点并将其部署到 GitHub Pages 的示例工作流程
name: Deploy Hugo site to Pages
on:
# 由默认分支触发
push:
branches: ["main"]
# 允许手动运行
workflow_dispatch:
# 设置 GITHUB_TOKEN 的权限以允许部署到 GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# 仅允许一项并发部署,跳过正在进行的运行和最新排队的运行之间排队的运行
# 但是,不要取消正在进行的运行,因为我们希望完成这些生产部署
concurrency:
group: "pages"
cancel-in-progress: false
# 默认为 bash
defaults:
run:
shell: bash
jobs:
# 开始构建
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.121.2
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # 获取 .GitInfo 和 .Lastmod 的所有历史记录
submodules: recursive
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Setup Hugo
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Build with Hugo
env:
# 最大程度地向后兼容 Hugo 模块
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc --minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public
# 开始部署
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
```
{{% /details %}}
{{< callout >}}
在仓库设置中将 **Pages** > **Build and deployment** > **Source** 调整为 **GitHub Actions**:
![](https://user-images.githubusercontent.com/5097752/266784808-99676430-884e-42ab-b901-f6534a0d6eee.png)
{{< /callout >}}
默认情况下,上述 GitHub Actions 工作流程 `.github/workflows/pages.yaml` 假定站点部署到 `https://<USERNAME>.github.io/<REPO>/`
如需部署到 `https://<USERNAME>.github.io/` 修改参数 `--baseURL`:
```yaml {filename=".github/workflows/pages.yaml",linenos=table,linenostart=54,hl_lines=[4]}
run: |
hugo \
--gc --minify \
--baseURL "https://${{ github.repository_owner }}.github.io/"
```
如需部署到自己的域,请对应修改 `--baseURL`
## Cloudflare Pages
1. 将您的网站托管在 Git 存储库(例如 GitHub
2. 登录到 [Cloudflare dashboard](https://dash.cloudflare.com/) 并选择你的账户
3. 转至在账户主页面中 **Workers & Pages** > **Create application** > **Pages** > **Connect to Git**
4. 选择你的仓库 **Set up builds and deployments** 提供以下信息:
| Configuration | Value |
| ----------------- | -------------------- |
| Production branch | `main` |
| Build command | `hugo --gc --minify` |
| Build directory | `public` |
如需了解更多内容,见:
- [Deploy a Hugo site](https://developers.cloudflare.com/pages/framework-guides/deploy-a-hugo-site/#deploy-with-cloudflare-pages).
- [Language support and tools](https://developers.cloudflare.com/pages/platform/language-support-and-tools/).
## Netlify
1. 将代码推送到 Git 存储库 (如 GitHub, GitLab)
2. [导入项目](https://app.netlify.com/start)
3. 如果您不使用[hextra-starter-template][hextra-starter-template], 手动配置以下内容:
- C 将构建命令配置为 `hugo --gc --minify`
- 指定发布目录为 `public`
- 添加环境变量 `HUGO_VERSION` 并设定为 `0.119.0`
4. 部署
转至 [Hugo on Netlify](https://docs.netlify.com/integrations/frameworks/hugo/) 获得更多信息
## Vercel
1. 将代码推送到 Git 存储库GitHub、GitLab 等)
2. 转至 [Vercel Dashboard](https://vercel.com/dashboard) 并导入你的 Hugo 项目
3. 配置项目,选择 Hugo 作为 Framework Preset
4. 覆盖构建命令和安装命令:
1. 设置构建命令为 `hugo --gc --minify`
2. 将安装命令设置为 `yum install golang`
![Vercel Deployment Configuration](https://github.com/imfing/hextra/assets/5097752/887d949b-8d05-413f-a2b4-7ab92192d0b3)

View File

@ -0,0 +1,53 @@
---
title: نمودارها
weight: 6
next: /docs/guide/shortcodes
---
در حال حاضر، هگزترا از [Mermaid](#mermaid) برای نمودارها پشتیبانی می‌کند.
<!--more-->
## Mermaid
[Mermaid](https://github.com/mermaid-js/mermaid#readme) یک ابزار نمودار و نمودار مبتنی بر جاوااسکریپت است که تعاریف متنی الهام گرفته از مارک‌داون را دریافت می‌کند و نمودارها را به صورت پویا در مرورگر ایجاد می‌کند. به عنوان مثال، Mermaid می‌تواند نمودارهای فلوچارت، نمودارهای توالی، نمودارهای دایره‌ای و موارد دیگر را رندر کند.
استفاده از Mermaid در هگزترا به سادگی نوشتن یک بلوک کد با مجموعه زبان `mermaid` است:
````markdown
```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```
````
به صورت زیر رندر خواهد شد:
```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```
نمودار توالی:
```mermaid
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
```
برای اطلاعات بیشتر، لطفا به [مستندات Mermaid](https://mermaid-js.github.io/mermaid/#/) مراجعه کنید.

View File

@ -4,7 +4,7 @@ weight: 6
next: /docs/guide/shortcodes
---
目前Hextra 支持 [Mermain](#mermaid) 的图表。
目前Hextra 支持 [Mermaid](#mermaid) 的图表。
<!--more-->
@ -12,7 +12,7 @@ next: /docs/guide/shortcodes
[Mermaid](https://github.com/mermaid-js/mermaid#readme) 是一个基于 JavaScript 的图表绘制工具,它的文本定义和 Markdown 类似,可在浏览器中动态创建图表。例如:流程图、序列图、饼图等。
在 Hextra 中使用 Mermain 就像使用代码块一样简单:
在 Hextra 中使用 Mermaid 就像使用代码块一样简单:
````markdown
```mermaid

View File

@ -0,0 +1,60 @@
---
title: "LaTeX"
weight: 4
math: true
---
$\KaTeX$ برای رندر کردن عبارت‌های ریاضی LaTeX استفاده می‌شود. می‌توان آن را در هر صفحه با تنظیم `math` روی `true` در قسمت بالای صفحه فعال کرد.
<!--more-->
```yaml {filename="Markdown"}
---
title: "صفحه من با LaTeX"
math: true
---
```
وقتی فعال باشد، اسکریپت‌ها، شیوه‌نامه‌ها و فونت‌های KaTeX به طور خودکار در سایت شما قرار می‌گیرند. می‌توانید از عبارت‌های ریاضی LaTeX در محتوای مارک‌داون خود استفاده کنید.
## مثال
هر دو عبارت‌های ریاضی درون‌خطی و پاراگراف جداگانه LaTeX در محتوای مارک‌داون پشتیبانی می‌شوند.
### درون‌خطی
```markdown {filename="page.md"}
این $\sigma(z) = \frac{1}{1 + e^{-z}}$ درون‌خطی است.
```
این $\sigma(z) = \frac{1}{1 + e^{-z}}$ درون‌خطی است.
### پاراگراف جداگانه
```markdown {filename="page.md"}
$$F(\omega) = \int_{-\infty}^{\infty} f(t) e^{-j\omega t} \, dt$$
```
به صورت زیر رندر خواهد شد:
$$F(\omega) = \int_{-\infty}^{\infty} f(t) e^{-j\omega t} \, dt$$
## توابع پشتیبانی شده
برای مشاهده فهرست توابع پشتیبانی شده، به [توابع پشتیبانی شده KaTeX](https://katex.org/docs/supported.html) مراجعه کنید.
## شیمی
عبارت‌های شیمی از طریق افزونه [mhchem](https://mhchem.github.io/MathJax-mhchem/) پشتیبانی می‌شوند.
درون‌خطی: $\ce{H2O}$ آب است.
پاراگراف جداگانه:
```markdown {filename="page.md"}
$$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$
```
$$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$

View File

@ -0,0 +1,156 @@
---
title: مارک‌داون
weight: 2
---
Hugo از سینتکس [مارک‌داون](https://en.wikipedia.org/wiki/Markdown) برای قالب‌بندی متن، ایجاد فهرست و موارد دیگر پشتیبانی می‌کند. این صفحه برخی از رایج‌ترین نمونه‌های سینتکس مارک‌داون را به شما نشان می‌دهد.
<!--more-->
## مثال‌های مارک‌داون
### ظاهر طراحی دادن به متن
| سبک | سینتکس | مثال | خروجی |
| -------- | -------- | ------ | ------ |
| توپر | `**متن توپر**` | `**متن توپر**` | **متن توپر** |
| کج | `*متن کج*` | `*متن کج*` | *متن کج* |
| خط خورده | `~~متن خط خورده~~` | `~~متن خط خورده~~` | ~~متن خط خورده~~ |
| پایین‌نویس | `<sub></sub>` | `این یک متن <sub>پایین‌نویس</sub> است` | این یک متن <sub>پایین‌نویس</sub> است |
| بالانویس | `<sup></sup>` | `این یک متن <sup>بالانویس</sup> است` | این یک متن <sup>بالانویس</sup> است |
### بلوک نقل‌قول
بلوک نقل‌قول با ذکر منبع
> با اشتراک‌گذاری حافظه ارتباط برقرار نکنید، حافظه را با برقراری ارتباط به اشتراک بگذارید.<br>
> — <cite>راب پایک[^1]</cite>
[^1]: نقل‌قول بالا گزیده‌ای از [سخنرانی](https://www.youtube.com/watch?v=PAAkCSZUG1c) راب پایک در Gopherfest، در تاریخ ۲۷ آبان ۱۳۹۴ است.
```markdown {filename=Markdown}
> با اشتراک‌گذاری حافظه ارتباط برقرار نکنید، حافظه را با برقراری ارتباط به اشتراک بگذارید.<br>
> — <cite>راب پایک[^1]</cite>
[^1]: نقل‌قول بالا گزیده‌ای از [سخنرانی](https://www.youtube.com/watch?v=PAAkCSZUG1c) راب پایک در Gopherfest، در تاریخ ۲۷ آبان ۱۳۹۴ است.
```
### جدول‌ها
جدول‌ها بخشی از مشخصات اصلی مارک‌داون نیستند، اما Hugo از آنها در خارج از جعبه پشتیبانی می‌کند.
| نام | سن |
|--------|------|
| گودرز | ۳۰|
| آصف | ۳۴ |
```markdown {filename=Markdown}
| نام | سن |
|--------|------|
| گودرز | ۳۰|
| آصف | ۳۴ |
```
#### مارک‌داون درون‌خطی درون جدول‌ها
| کج | توپر | کد |
| -------- | -------- | ------ |
| *کج* | **توپر** | `کد` |
```markdown {filename=Markdown}
| کج | توپر | کد |
| -------- | -------- | ------ |
| *کج* | **توپر** | `کد` |
```
### بلوک‌های کد
{{< cards >}}
{{< card link="../../guide/syntax-highlighting" title="برجسته‌کردن سینتکس" icon="sparkles" >}}
{{< /cards >}}
### فهرست‌ها
#### فهرست مرتب‌شده
1. اولین آیتم
2. دومین آیتم
3. سومین آیتم
```markdown {filename=Markdown}
1. اولین آیتم
2. دومین آیتم
3. سومین آیتم
```
#### فهرست مرتب‌نشده
* فهرست آیتم
* یک آیتم دیگه
* و یک آیتم دیگه
```markdown {filename=Markdown}
* فهرست آیتم
* یک آیتم دیگه
* و یک آیتم دیگه
```
#### فهرست تو در تو
* میوه
* سیب
* پرتقال
* موز
* لبنیات
* شیر
* پنیر
```markdown {filename=Markdown}
* میوه
* سیب
* پرتقال
* موز
* لبنیات
* شیر
* پنیر
```
### عکس‌ها
![landscape](https://picsum.photos/800/600)
```markdown {filename=Markdown}
![landscape](https://picsum.photos/800/600)
```
با توضیحات:
![landscape](https://picsum.photos/800/600 "یک چشم‌انداز Unsplash")
```markdown {filename=Markdown}
![landscape](https://picsum.photos/800/600 "یک چشم‌انداز Unsplash")
```
## پیکربندی
Hugo از [Goldmark](https://github.com/yuin/goldmark) برای تجزیه مارک‌داون استفاده می‌کند.
رندر مارک‌داون را می‌توان در `hugo.yaml` تحت `markup.goldmark` پیکربندی کنید.
در زیر پیکربندی پیش‌فرض هگزترا را می‌توانید ببینید:
```yaml {filename="hugo.yaml"}
markup:
goldmark:
renderer:
unsafe: true
highlight:
noClasses: false
```
برای گزینه‌های پیکربندی بیشتر، به مستندات Hugo در [پیکربندی نشانه‌گذاری](https://gohugo.io/getting-started/configuration-markup/) مراجعه کنید.
## منابع یادگیری
* [راهنمای مارک‌داون](https://www.markdownguide.org/)
* [برگه تقلب مارک‌داون](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)
* [آموزش مارک‌داون](https://www.markdowntutorial.com/)
* [مرجع مارک‌داون](https://commonmark.org/help/)

View File

@ -14,7 +14,7 @@ Hugo supports [Markdown](https://en.wikipedia.org/wiki/Markdown) syntax for form
| Style | Syntax | Example | Output |
| -------- | -------- | ------ | ------ |
| Bold | `**bold text**` | `**bold text**` | **bold text** |
| Italic | `*italicized text*` | `*italicized text* | *italicized text* |
| Italic | `*italicized text*` | `*italicized text*` | *italicized text* |
| Strikethrough | `~~strikethrough text~~` | `~~strikethrough text~~` | ~~strikethrough text~~ |
| Subscript | `<sub></sub>` | `This is a <sub>subscript</sub> text` | This is a <sub>subscript</sub> text |
| Superscript | `<sup></sup>` | `This is a <sup>superscript</sup> text` | This is a <sup>superscript</sup> text |
@ -28,14 +28,28 @@ Blockquote with attribution
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
```markdown {filename=Markdown}
> Don't communicate by sharing memory, share memory by communicating.<br>
> — <cite>Rob Pike[^1]</cite>
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
```
### Tables
Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-box.
Name | Age
--------|------
Bob | 27
Alice | 23
| Name | Age |
|--------|------|
| Bob | 27 |
| Alice | 23 |
```markdown {filename=Markdown}
| Name | Age |
|--------|------|
| Bob | 27 |
| Alice | 23 |
```
#### Inline Markdown within tables
@ -43,6 +57,12 @@ Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-
| -------- | -------- | ------ |
| *italics* | **bold** | `code` |
```markdown {filename=Markdown}
| Italics | Bold | Code |
| -------- | -------- | ------ |
| *italics* | **bold** | `code` |
```
### Code Blocks
{{< cards >}}
@ -57,12 +77,24 @@ Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-
2. Second item
3. Third item
```markdown {filename=Markdown}
1. First item
2. Second item
3. Third item
```
#### Unordered List
* List item
* Another item
* And another item
```markdown {filename=Markdown}
* List item
* Another item
* And another item
```
#### Nested list
* Fruit
@ -73,13 +105,31 @@ Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-
* Milk
* Cheese
```markdown {filename=Markdown}
* Fruit
* Apple
* Orange
* Banana
* Dairy
* Milk
* Cheese
```
### Images
![](https://source.unsplash.com/featured/800x600?landscape)
![landscape](https://picsum.photos/800/600)
```markdown {filename=Markdown}
![landscape](https://picsum.photos/800/600)
```
With caption:
![](https://source.unsplash.com/featured/800x600?landscape "Unsplash Landscape")
![landscape](https://picsum.photos/800/600 "Unsplash Landscape")
```markdown {filename=Markdown}
![landscape](https://picsum.photos/800/600 "Unsplash Landscape")
```
## Configuration

View File

@ -28,14 +28,28 @@ Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
```markdown {filename=Markdown}
> Don't communicate by sharing memory, share memory by communicating.<br>
> — <cite>Rob Pike[^1]</cite>
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
```
### 表格
表格并非核心 Markdown 规范,但 Hugo 支持开箱即用的表格:
Name | Age
--------|------
Bob | 27
Alice | 23
| Name | Age |
|--------|------|
| Bob | 27 |
| Alice | 23 |
```markdown {filename=Markdown}
| Name | Age |
|--------|------|
| Bob | 27 |
| Alice | 23 |
```
#### Markdown 表格中的内联
@ -43,6 +57,12 @@ Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容
| -------- | -------- | ------ |
| *italics* | **bold** | `code` |
```markdown {filename=Markdown}
| Italics | Bold | Code |
| -------- | -------- | ------ |
| *italics* | **bold** | `code` |
```
### 代码块
{{< cards >}}
@ -57,12 +77,24 @@ Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容
2. Second item
3. Third item
```markdown {filename=Markdown}
1. First item
2. Second item
3. Third item
```
#### 无序列表
* List item
* Another item
* And another item
```markdown {filename=Markdown}
* List item
* Another item
* And another item
```
#### 嵌套列表
* Fruit
@ -73,13 +105,31 @@ Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容
* Milk
* Cheese
```markdown {filename=Markdown}
* Fruit
* Apple
* Orange
* Banana
* Dairy
* Milk
* Cheese
```
### 图片
![](https://source.unsplash.com/featured/800x600?landscape)
![landscape](https://picsum.photos/800/600)
```markdown {filename=Markdown}
![landscape](https://picsum.photos/800/600)
```
带有标题:
![](https://source.unsplash.com/featured/800x600?landscape "Unsplash Landscape")
![landscape](https://picsum.photos/800/600 "Unsplash Landscape")
```markdown {filename=Markdown}
![landscape](https://picsum.photos/800/600 "Unsplash Landscape")
```
## 配置

View File

@ -0,0 +1,147 @@
---
title: سازماندهی پرونده‌ها
weight: 1
prev: /docs/guide
---
## ساختار دایرکتوری
به طور پیش‌فرض، Hugo پرونده‌های مارک‌داون را در فهرست `content` جستجو می‌کند و ساختار فهرست، ساختار خروجی نهایی وب‌سایت شما را تعیین می‌کند. همین سایت را به عنوان مثال در نظر بگیرید:
<!--more-->
{{< filetree/container >}}
{{< filetree/folder name="content" >}}
{{< filetree/file name="_index.md" >}}
{{< filetree/folder name="docs" state="open" >}}
{{< filetree/file name="_index.md" >}}
{{< filetree/file name="getting-started.md" >}}
{{< filetree/folder name="guide" state="open" >}}
{{< filetree/file name="_index.md" >}}
{{< filetree/file name="organize-files.md" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< filetree/folder name="blog" state="open" >}}
{{< filetree/file name="_index.md" >}}
{{< filetree/file name="post-1.md" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
هر یک از پرونده‌های `_index.md` صفحه اصلی هر بخش هستند که برای هر بخش مجزا است. سایر پرونده‌های مارک‌داون صفحه‌های معمولی دیگه‌ای هستند.
```
content
├── _index.md // <- /
├── docs
│ ├── _index.md // <- /docs/
│ ├── getting-started.md // <- /docs/getting-started/
│ └── guide
│ ├── _index.md // <- /docs/guide/
│ └── organize-files.md // <- /docs/guide/organize-files/
└── blog
├── _index.md // <- /blog/
└── post-1.md // <- /blog/post-1/
```
## طرح‌بندی‌ها
هگزترا سه طرح‌بندی برای انواع مختلف محتوا ارائه می‌کند:
| طرح‌بندی | دایرکتوری | ویژگی‌ها |
| :-------- | :-------------------- | :--------------------------------------------------------------- |
| `docs` | `content/docs/` | ایده‌آل برای مستندات ساختار یافته، مانند این بخش. |
| `blog` | `content/blog/` | برای نوشته‌های وبلاگ، با هر فهرست‌بندی و هم نمایش جزئیات مقاله. |
| `default` | همه دایرکتوری‌های دیگر | مشاهده مقاله تک صفحه‌ای بدون نوار کناری. |
برای سفارشی کردن یک بخش برای منعکس کردن رفتار یک طرح داخلی، نوع طرح‌بندی مورد نظر را در قسمت بالایی قسمت _index.md` مشخص کنید.
```yaml {filename="content/my-docs/_index.md"}
---
title: مستندات من
cascade:
type: docs
---
```
پیکربندی مثال بالا تضمین می‌کند که پرونده‌های محتوای در داخل `content/my-docs/` به‌طور پیش‌فرض به عنوان مستندات (نوع `docs`) مورد استفاده قرار می‌گیرند.
## ناوبری نوار کناری
ناوبری نوار کناری به طور خودکار براساس حروف الفبا ایجاد می‌شود. برای پیکربندی دستی ترتیب نوار کناری، می‌توانید از پارامتر `weight` در قسمت بالایی پرونده‌های مارک‌داون استفاده کنید.
```yaml {filename="content/docs/guide/_index.md"}
---
title: راهنما
weight: 2
---
```
{{< callout emoji="">}}
توصیه می‌کنیم نوار کناری خیلی عمیق نباشد. اگر محتوای زیادی دارید، آنها را **به چند بخش تقسیم کنید**.
{{< /callout >}}
## پیکربندی دایرکتوری محتوا
به طور پیش‌فرض، دایرکتوری ریشه `content/` توسط Hugo برای ساخت سایت استفاده می‌شود.
اگر نیاز به استفاده از دایرکتوری متفاوتی برای محتوا دارید، برای مثال `docs/`، این کار را می‌توانید با تنظیم پارامتر [`contentDir`](https://gohugo.io/getting-started/configuration/#contentdir) در پیکربندی سایت `hugo.yaml` انجام دهید.
## افزودن تصاویر
برای افزودن تصاویر، ساده‌ترین راه این است که پرونده‌های عکس‌ها را در همان دایرکتوری پرونده مارک‌داون قرار دهید.
برای مثال، یک پرونده عکس `image.png` را در کنار پرونده `my-page.md` اضافه کنید:
{{< filetree/container >}}
{{< filetree/folder name="content" >}}
{{< filetree/folder name="docs" >}}
{{< filetree/file name="my-page.md" >}}
{{< filetree/file name="image.png" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
سپس، می‌توانید از سینتکس مارک‌داون زیر برای افزودن عکس به محتوا استفاده کنید:
```markdown {filename="content/docs/my-page.md"}
![](image.png)
```
همچنین می‌توانید از ویژگی [بسته‌های صفحه][page-bundles] Hugo برای سازماندهی پرونده‌های عکس‌ها همراه با پرونده مارک‌داون استفاده کنید. برای رسیدن به این هدف، پرونده `my-page.md` را به یک دایرکتوری `my-page` تبدیل کنید و محتوا را در پرونده‌ای به نام `index.md` قرار دهید و پرونده‌های عکس‌ها را در دایرکتوری `my-page` قرار دهید:
{{< filetree/container >}}
{{< filetree/folder name="content" >}}
{{< filetree/folder name="docs" >}}
{{< filetree/folder name="my-page" >}}
{{< filetree/file name="index.md" >}}
{{< filetree/file name="image.png" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
```markdown {filename="content/docs/my-page/index.md"}
![](image.png)
```
همچنین می‌توانید پرونده‌های عکس‌ها را در دایرکتوری `static` قرار دهید که عکس‌ها را برای همه صفحات در دسترس قرار می‌دهد:
{{< filetree/container >}}
{{< filetree/folder name="static" >}}
{{< filetree/folder name="images" >}}
{{< filetree/file name="image.png" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< filetree/folder name="content" >}}
{{< filetree/folder name="docs" >}}
{{< filetree/file name="my-page.md" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
توجه داشته باشید که مسیر عکس با یک اسلش `/` شروع می‌شود و نسبت به دایرکتوری استاتیک است:
```markdown {filename="content/docs/my-page.md"}
![](/images/image.png)
```
[page-bundles]: https://gohugo.io/content-management/page-bundles/#leaf-bundles

View File

@ -7,7 +7,7 @@ prev: /docs/guide
## Directory Structure
By default, Hugo searches for Markdown files in the `content` directory, and the structure of the directory determines the final output structure of your website.
Take the example site as an example:
Take this site as an example:
<!--more-->
@ -45,6 +45,28 @@ content
└── post-1.md // <- /blog/post-1/
```
## Layouts
Hextra offers three layouts for different content types:
| Layout | Directory | Features |
| :-------- | :-------------------- | :--------------------------------------------------------------- |
| `docs` | `content/docs/` | Ideal for structured documentation, same as this section. |
| `blog` | `content/blog/` | For blog postings, with both listing and detailed article views. |
| `default` | All other directories | Single-page article view without sidebar. |
To customize a section to mirror the behavior of a built-in layout, specify the desired type in the front matter of the section's `_index.md`.
```yaml {filename="content/my-docs/_index.md"}
---
title: My Docs
cascade:
type: docs
---
```
The above example configuration ensures that the content files inside `content/my-docs/` will be treated as documentation (`docs` type) by default.
## Sidebar Navigation
The sidebar navigation is generated automatically based on the content organization alphabetically. To manually configure the sidebar order, we can use the `weight` parameter in the front matter of the Markdown files.
@ -60,6 +82,106 @@ weight: 2
It is recommended to keep the sidebar not too deep. If you have a lot of content, consider **splitting them into multiple sections**.
{{< /callout >}}
## Breadcrumb Navigation
Breadcrumbs are auto-generated based on the directory structure of `/content`.
For example, consider the file structure [demonstrated above](#directory-structure). Given that structure, the breadcrumbs atop the page at `/docs/guide/organize-files/` would appear automatically as follows:
```
Documentation > Guide > Organize Files
```
### Customizing Breadcrumb Link Titles
By default, each breadcrumb link is generated based on that page's `title` parameter. You can customize this by specifying a `linkTitle`.
For example, if instead of `Organize Files` we wanted the breadcrumb to be `Foo Bar`:
```yaml {filename="content/docs/guide/organize-files.md"}
---
linkTitle: Foo Bar
title: Organize Files
---
```
This would now generate the following breadcrumbs:
```
Documentation > Guide > Foo Bar
```
### Hiding Breadcrumbs
You can hide breadcrumbs completely from a page by specfying `breadcrumbs: false` in its front matter:
```yaml {filename="content/docs/guide/organize-files.md"}
---
breadcrumbs: false
title: Organize Files
---
```
## Configure Content Directory
If we need to use a different directory for our content, we can do so by setting the [`contentDir`](https://gohugo.io/getting-started/configuration/#contentdir) parameter in our site configuration file.
By default, the root `content/` directory is used by Hugo to build the site.
If you need to use a different directory for content, for example `docs/`, this can be done by setting the [`contentDir`](https://gohugo.io/getting-started/configuration/#contentdir) parameter in the site configuration `hugo.yaml`.
## Add Images
To add images, the easiest way is to put the image files in the same directory as the Markdown file.
For example, add an image file `image.png` alongside the `my-page.md` file:
{{< filetree/container >}}
{{< filetree/folder name="content" >}}
{{< filetree/folder name="docs" >}}
{{< filetree/file name="my-page.md" >}}
{{< filetree/file name="image.png" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
Then, we can use the following Markdown syntax to add the image to the content:
```markdown {filename="content/docs/my-page.md"}
![](image.png)
```
We can also utilize the [page bundles][page-bundles] feature of Hugo to organize the image files together with the Markdown file. To achieve that, turn the `my-page.md` file into a directory `my-page` and put the content into a file named `index.md`, and put the image files inside the `my-page` directory:
{{< filetree/container >}}
{{< filetree/folder name="content" >}}
{{< filetree/folder name="docs" >}}
{{< filetree/folder name="my-page" >}}
{{< filetree/file name="index.md" >}}
{{< filetree/file name="image.png" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
```markdown {filename="content/docs/my-page/index.md"}
![](image.png)
```
Alternatively, we can also put the image files in the `static` directory, which will make the images available for all pages:
{{< filetree/container >}}
{{< filetree/folder name="static" >}}
{{< filetree/folder name="images" >}}
{{< filetree/file name="image.png" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< filetree/folder name="content" >}}
{{< filetree/folder name="docs" >}}
{{< filetree/file name="my-page.md" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
Note that the image path begins with a slash `/` and is relative to the static directory:
```markdown {filename="content/docs/my-page.md"}
![](/images/image.png)
```
[page-bundles]: https://gohugo.io/content-management/page-bundles/#leaf-bundles

View File

@ -6,7 +6,7 @@ prev: /docs/guide
## 目录结构
默认情况下Hugo 在 `context` 目录中搜索 Markdown 文件,目录的结构决定了网站的最终输出结构。
默认情况下Hugo 在 `content` 目录中搜索 Markdown 文件,目录的结构决定了网站的最终输出结构。
以示例网站为例:
<!--more-->

View File

@ -0,0 +1,21 @@
---
title: کدهای کوتاه
weight: 9
prev: /docs/guide/diagrams
next: /docs/guide/shortcodes/filetree
---
[کدهای کوتاه Hugo](https://gohugo.io/content-management/shortcodes/) قطعه‌های ساده‌ای در داخل پرونده‌های محتوای شما هستند که قالب‌های داخلی یا سفارشی را فراخوانی می‌کنند.
هگزترا مجموعه‌ای از کدهای کوتاه زیبا را برای بهبود محتوای شما ارائه می‌کند.
{{< cards >}}
{{< card link="filetree" title="FileTree" icon="folder-tree" >}}
{{< card link="icon" title="آیکون" icon="badge-check" >}}
{{< card link="details" title="جزئیات" icon="chevron-right" >}}
{{< card link="tabs" title="زبانه‌ها" icon="collection" >}}
{{< card link="callout" title="فراخوانی" icon="warning" >}}
{{< card link="cards" title="کارت‌ها" icon="card" >}}
{{< card link="steps" title="مراحل" icon="one" >}}
{{< /cards >}}

View File

@ -1,6 +0,0 @@
---
title: コンポーネント
weight: 2
---
Hextraは、[Hugo Shortcodes](https://gohugo.io/content-management/shortcodes/)に基づいたさまざまな組み込みコンポーネントを提供しています。

View File

@ -9,7 +9,6 @@ next: /docs/guide/shortcodes/callout
Hextra provides a collection of beautiful shortcodes to enhance your content.
{{< cards >}}
{{< card link="callout" title="Callout" icon="warning" >}}
{{< card link="cards" title="Cards" icon="card" >}}
@ -19,3 +18,12 @@ Hextra provides a collection of beautiful shortcodes to enhance your content.
{{< card link="steps" title="Steps" icon="one" >}}
{{< card link="tabs" title="Tabs" icon="collection" >}}
{{< /cards >}}
<div style="padding-top:4rem"></div>
Additional shortcodes provided by Hugo and Hextra:
{{< cards >}}
{{< card link="jupyter" title="Jupyter Notebook" icon="jupyter" tag="alpha" >}}
{{< card link="others" title="Others" icon="view-grid" >}}
{{< /cards >}}

View File

@ -0,0 +1,78 @@
---
title: کامپوننت فراخوانی
linkTitle: فراخوانی
aliases:
- فراخوانی‌ها
---
یک کامپوننت داخلی برای نشان دادن اطلاعات مهم به خواننده.
<!--more-->
## مثال
{{< callout emoji="👾">}}
**فراخوانی** یک متن کوتاه است که برای جلب توجه در نظر گرفته شده است.
{{< /callout >}}
{{< callout type="info" >}}
**فراخوانی** یک متن کوتاه است که برای جلب توجه در نظر گرفته شده است.
{{< /callout >}}
{{< callout type="warning" >}}
**فراخوانی** یک متن کوتاه است که برای جلب توجه در نظر گرفته شده است.
{{< /callout >}}
{{< callout type="error" >}}
**فراخوانی** یک متن کوتاه است که برای جلب توجه در نظر گرفته شده است.
{{< /callout >}}
## استفاده
### پیش‌فرض
{{< callout emoji="🌐">}}
Hugo را می‌توانید برای ایجاد طیف گسترده‌ای از وب‌سایت‌ها، از جمله وبلاگ‌ها، نمونه‌کارها، سایت‌های مستندسازی و غیره استفاده کرد.
{{< /callout >}}
```markdown
{{</* callout emoji="🌐" */>}}
Hugo را می‌توانید برای ایجاد طیف گسترده‌ای از وب‌سایت‌ها، از جمله وبلاگ‌ها، نمونه‌کارها، سایت‌های مستندسازی و غیره استفاده کرد.
{{</* /callout */>}}
```
### اطلاعات
{{< callout type="info" >}}
لطفا برای مشاهده آخرین نسخه‌ها به گیت‌هاب مراجعه کنید.
{{< /callout >}}
```markdown
{{</* callout type="info" */>}}
لطفا برای مشاهده آخرین نسخه‌ها به گیت‌هاب مراجعه کنید.
{{</* /callout */>}}
```
### هشدار
{{< callout type="warning" >}}
این API در نسخه بعدی منسوخ خواهد شد.
{{< /callout >}}
```markdown
{{</* callout type="warning" */>}}
این API در نسخه بعدی منسوخ خواهد شد.
{{</* /callout */>}}
```
### خطا
{{< callout type="error" >}}
مشکلی پیش آمد و اتفاقی رخ خواهد شد.
{{< /callout >}}
```markdown
{{</* callout type="error" */>}}
مشکلی پیش آمد و اتفاقی رخ خواهد شد.
{{</* /callout */>}}
```

View File

@ -0,0 +1,78 @@
---
title: 标注
aliases:
- callouts
prev: /docs/guide/shortcodes
---
向读者显示重要信息的内置组件。
<!--more-->
## Example
{{< callout emoji="👾">}}
**标注**是一段旨在吸引注意力的短文本
{{< /callout >}}
{{< callout type="info" >}}
**标注**是一段旨在吸引注意力的短文本。
{{< /callout >}}
{{< callout type="warning" >}}
**标注**是一段旨在吸引注意力的短文本。
{{< /callout >}}
{{< callout type="error" >}}
**标注**是一段旨在吸引注意力的短文本。
{{< /callout >}}
## Usage
### Default
{{< callout emoji="🌐">}}
Hugo 可用于创建各种网站,包括博客、作品集、文档网站等
{{< /callout >}}
```markdown
{{</* callout emoji="🌐" */>}}
Hugo 可用于创建各种网站,包括博客、作品集、文档网站等
{{</* /callout */>}}
```
### Info
{{< callout type="info" >}}
请访问 GitHub 查看最新版本
{{< /callout >}}
```markdown
{{</* callout type="info" */>}}
请访问 GitHub 查看最新版本
{{</* /callout */>}}
```
### Warning
{{< callout type="warning" >}}
该 API 将在下一版本中弃用
{{< /callout >}}
```markdown
{{</* callout type="warning" */>}}
**标注**是一段旨在吸引注意力的简短文字
{{</* /callout */>}}
```
### Error
{{< callout type="error" >}}
出问题了,要爆炸了
{{< /callout >}}
```markdown
{{</* callout type="error" */>}}
出问题了,要爆炸了
{{</* /callout */>}}
```

View File

@ -0,0 +1,64 @@
---
title: کامپوننت کارت‌ها
linkTitle: کارت‌ها
---
## مثال
{{< cards >}}
{{< card link="../callout" title="فراخوانی" icon="warning" >}}
{{< card link="/fa" title="بدون آیکون" >}}
{{< /cards >}}
{{< cards >}}
{{< card link="/" title="کارت تصویر" image="https://source.unsplash.com/featured/800x600?landscape" subtitle="یک چشم‌انداز Unsplash" >}}
{{< card link="/" title="تصویر محلی" image="/images/card-image-unprocessed.jpg" subtitle="تصویر خام در دایرکتوری استاتیک است." >}}
{{< card link="/" title="تصویر محلی" image="images/space.jpg" subtitle="تصویر در دایرکتوری assets می‌باشد و پردازش توسط Hugo شده است." method="Resize" options="600x q80 webp" >}}
{{< /cards >}}
## استفاده
```
{{</* cards */>}}
{{</* card link="../callout" title="فراخوانی" icon="warning" */>}}
{{</* card link="/fa" title="بدون آیکون" */>}}
{{</* /cards */>}}
```
```
{{</* cards */>}}
{{</* card link="/" title="کارت تصویر" image="https://source.unsplash.com/featured/800x600?landscape" subtitle="یک چشم‌انداز Unsplash" */>}}
{{</* card link="/" title="تصویر محلی" image="/images/card-image-unprocessed.jpg" subtitle="تصویر خام در دایرکتوری استاتیک است." */>}}
{{</* card link="/" title="تصویر محلی" image="images/space.jpg" subtitle="تصویر در دایرکتوری assets می‌باشد و پردازش توسط Hugo شده است." method="Resize" options="600x q80 webp" */>}}
{{</* /cards */>}}
```
## پارامترهای کارت
| پارامتر | توضیحات |
|----------- |---------------------------------------|
| `link` | نشانی اینترنتی (داخلی یا خارجی). |
| `title` | عنوان برای کارت. |
| `subtitle` | عنوان زیرنویس (از مارک‌داون پشتیبانی می‌کند).. |
| `icon` | نام آیکون. |
## کارت تصویر
علاوه بر این، کارت از افزودن تصویر و پردازش از طریق این پارامترها پشتیبانی می‌کند:
| پارامتر | توضیحات |
|----------- |---------------------------------------------|
| `image` | نشانی اینترنتی تصویر کارت را مشخص می‌کند. |
| `method` | روش پردازش تصویر Hugo را تنظیم می‌کند. |
| `options` | گزینه‌های پردازش تصویر Hugo را پیکربندی می‌کند. |
کارت از سه نوع تصویر پشتیبانی می‌کند:
1. تصویر از راه دور: نشانی اینترنتی کامل در پارامتر `image`.
2. تصویر استاتیک: از مسیر نسبی در دایرکتوری `static/` Hugo استفاده کنید.
3. تصویر پردازش شده: از مسیر نسبی در دایرکتوری `assets/` Hugo استفاده کنید.
هگزترا در صورت نیاز به پردازش تصویر در حین ساخت، به طور خودکار تشخیص می‌دهد و پارامتر `options` یا تنظیمات پیش‌فرض را اعمال می‌کند (تغییر اندازه، 800x، کیفیت 80، فرمت WebP).
در حال حاضر این `method` را پشتیبانی می‌کند: `Resize`، `Fit`، `Fill` و `Crop`.
برای اطلاعات بیشتر در مورد دستورات، روش‌ها و گزینه‌های پردازش تصویر داخلی Hugo به [مستندات پردازش تصویر](https://gohugo.io/content-management/image-processing/) آن‌ها مراجعه کنید.

View File

@ -7,19 +7,22 @@ linkTitle: Cards
{{< cards >}}
{{< card link="../callout" title="Callout" icon="warning" >}}
{{< card link="../callout" title="Card with tag" icon="tag" tag="custom tag">}}
{{< card link="/" title="No Icon" >}}
{{< /cards >}}
{{< cards >}}
{{< card link="/" title="Image Card" image="https://source.unsplash.com/featured/800x600?landscape" subtitle="Unsplash Landscape" >}}
{{< card link="/" title="Image Card" image="https://github.com/user-attachments/assets/71b7e3ec-1a8d-4582-b600-5425c6cc0407" subtitle="Internet Image" >}}
{{< card link="/" title="Local Image" image="/images/card-image-unprocessed.jpg" subtitle="Raw image under static directory." >}}
{{< card link="/" title="Local Image" image="images/space.jpg" subtitle="Image under assets directory, processed by Hugo." method="Resize" options="600x q80 webp" >}}
{{< /cards >}}
## Usage
```
{{</* cards */>}}
{{</* card link="../callout" title="Callout" icon="warning" */>}}
{{</* card link="../callout" title="Card with tag" icon="warning" tag= "A custom tag" */>}}
{{</* card link="/" title="No Icon" */>}}
{{</* /cards */>}}
```
@ -27,5 +30,60 @@ linkTitle: Cards
```
{{</* cards */>}}
{{</* card link="/" title="Image Card" image="https://source.unsplash.com/featured/800x600?landscape" subtitle="Unsplash Landscape" */>}}
{{</* card link="/" title="Local Image" image="/images/card-image-unprocessed.jpg" subtitle="Raw image under static directory." */>}}
{{</* card link="/" title="Local Image" image="images/space.jpg" subtitle="Image under assets directory, processed by Hugo." method="Resize" options="600x q80 webp" */>}}
{{</* /cards */>}}
```
## Card Parameters
| Parameter | Description |
|----------- |-----------------------------------------------------------------|
| `link` | URL (internal or external). |
| `title` | Title heading for the card. |
| `subtitle` | Subtitle heading (supports Markdown). |
| `icon` | Name of the icon. |
| `tag` | Text in tag. |
| `tagColor` | Color of the tag: `gray` (default), `yellow`, `red` and `blue`. |
## Image Card
Additionally, the card supports adding image and processing through these parameters:
| Parameter | Description |
|----------- |---------------------------------------------|
| `image` | Specifies the image URL for the card. |
| `method` | Sets Hugo's image processing method. |
| `options` | Configures Hugo's image processing options. |
Card supports three kinds of images:
1. Remote image: the full URL in the `image` parameter.
2. Static image: use the relative path in Hugo's `static/` directory.
3. Processed image: use the relative path in Hugo's `assets/` directory.
Hextra auto-detects if image processing is needed during build and applies the `options` parameter or default settings (Resize, 800x, Quality 80, WebP Format).
It currently supports these `method`: `Resize`, `Fit`, `Fill` and `Crop`.
For more on Hugo's built in image processing commands, methods, and options see their [Image Processing Documentation](https://gohugo.io/content-management/image-processing/).
## Tags
Card supports adding tags which could be useful to show extra status information.
{{< cards >}}
{{< card link="../callout" title="Card with default tag" tag="tag text" >}}
{{< card link="../callout" title="Card with error tag" tag="tag text" tagType="error" >}}
{{< card link="../callout" title="Card with info tag" tag="tag text" tagType="info" >}}
{{< card link="../callout" title="Card with warning tag" tag="tag text" tagType="warning" >}}
{{< card link="/" title="Image Card" image="https://github.com/user-attachments/assets/71b7e3ec-1a8d-4582-b600-5425c6cc0407" subtitle="Internet Image" tag="tag text" tagType="error" >}}
{{< /cards >}}
```
{{</* cards */>}}
{{</* card link="../callout" title="Card with default tag color" tag="tag text" */>}}
{{</* card link="../callout" title="Card with default red tag" tag="tag text" tagType="error" */>}}
{{</* card link="../callout" title="Card with blue tag" tag="tag text" tagType="info" */>}}
{{</* card link="../callout" title="Card with yellow tag" tag="tag text" tagType="warning" */>}}
{{</* /cards */>}}
```

View File

@ -0,0 +1,65 @@
---
title: 卡片
linkTitle: Cards
---
## 示例
{{< cards >}}
{{< card link="../callout" title="Callout" icon="warning" >}}
{{< card link="/" title="No Icon" >}}
{{< /cards >}}
{{< cards >}}
{{< card link="/" title="Image Card" image="https://source.unsplash.com/featured/800x600?landscape" subtitle="Unsplash Landscape" >}}
{{< card link="/" title="Local Image" image="/images/card-image-unprocessed.jpg" subtitle="Raw image under static directory." >}}
{{< card link="/" title="Local Image" image="images/space.jpg" subtitle="Image under assets directory, processed by Hugo." method="Resize" options="600x q80 webp" >}}
{{< /cards >}}
## 使用
```
{{</* cards */>}}
{{</* card link="../callout" title="Callout" icon="warning" */>}}
{{</* card link="/" title="No Icon" */>}}
{{</* /cards */>}}
```
```
{{</* cards */>}}
{{</* card link="/" title="Image Card" image="https://source.unsplash.com/featured/800x600?landscape" subtitle="Unsplash Landscape" */>}}
{{</* card link="/" title="Local Image" image="/images/card-image-unprocessed.jpg" subtitle="Raw image under static directory." */>}}
{{</* card link="/" title="Local Image" image="images/space.jpg" subtitle="Image under assets directory, processed by Hugo." method="Resize" options="600x q80 webp" */>}}
{{</* /cards */>}}
```
## 卡片参数
| Parameter | Description |
|----------- |---------------------------------------|
| `link` | URL内部或外部 |
| `title` | 卡片的标题 |
| `subtitle` | 字幕标题(支持 Markdown |
| `icon` | 图标的名称 |
## Image Card
此外,该卡还支持通过以下参数添加图像和处理:
| Parameter | Description |
|----------- |---------------------------------------------|
| `image` | 指定卡片的图像 URL. |
| `method` | 设置 Hugo 的图像处理方法。 |
| `options` | 配置 Hugo 的图像处理选项。|
卡片支持三种图像:
1. 远程图片:完整网址应放置在 image 参数中
2. 静态图片:使用 Hugo 的 static/ 目录中的相对路径
3. 处理过的图片:使用 Hugo 的 assets/ 目录中的相对路径
Hextra 在构建过程中会自动检测图片是否需要处理,并根据需要应用 options 参数或默认设置缩放800x质量 80WebP 格式)。
它目前支持以下处理方法Resize缩放、Fit适应、Fill填充和 Crop裁剪
有关 Hugo 内置图像处理命令、方法和选项的更多信息,请参阅他们的 [Image Processing Documentation](https://gohugo.io/content-management/image-processing/).

View File

@ -0,0 +1,43 @@
---
title: جزئیات
---
یک کامپوننت داخلی برای نمایش محتوای قابل باز و بسته شدن.
<!--more-->
## مثال
{{% details title="جزئیات" %}}
این محتوای جزئیات است.
مارک‌داون **پشتیبانی می‌شود**.
{{% /details %}}
{{% details title="برای نمایش روی من کلیک کنید" closed="true" %}}
این به طور پیش‌فرض پنهان می‌شود.
{{% /details %}}
## استفاده
````markdown
{{%/* details title="جزئیات" */%}}
این محتوای جزئیات است.
مارک‌داون **پشتیبانی می‌شود**.
{{%/* /details */%}}
````
````markdown
{{%/* details title="برای نمایش روی من کلیک کنید"closed="true" */%}}
این به طور پیش‌فرض پنهان می‌شود.
{{%/* /details */%}}
````

View File

@ -24,7 +24,7 @@ This will be hidden by default.
## Usage
````
````markdown
{{%/* details title="Details" */%}}
This is the content of the details.
@ -34,7 +34,7 @@ Markdown is **supported**.
{{%/* /details */%}}
````
````
````markdown
{{%/* details title="Click me to reveal" closed="true" */%}}
This will be hidden by default.

View File

@ -0,0 +1,43 @@
---
title: 详情
---
用于显示可折叠内容的内置组件。
<!--more-->
## 示例
{{% details title="Details" %}}
这是细节的内容
Markdown is **supported**.
{{% /details %}}
{{% details title="Click me to reveal" closed="true" %}}
默认情况下这将被隐藏
{{% /details %}}
## Usage
````markdown
{{%/* details title="Details" */%}}
这是细节的内容
**支持** Markdown
{{%/* /details */%}}
````
````markdown
{{%/* details title="Click me to reveal" closed="true" */%}}
默认情况下这将被隐藏
{{%/* /details */%}}
````

View File

@ -0,0 +1,36 @@
---
title: کامپوننت FileTree
linkTitle: FileTree
prev: /docs/guide/shortcodes
next: /docs/guide/shortcodes/icon
---
## مثال
{{< filetree/container >}}
{{< filetree/folder name="content" >}}
{{< filetree/file name="_index.md" >}}
{{< filetree/folder name="docs" state="closed" >}}
{{< filetree/file name="_index.md" >}}
{{< filetree/file name="introduction.md" >}}
{{< filetree/file name="introduction.fa.md" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< filetree/file name="hugo.toml" >}}
{{< /filetree/container >}}
## استفاده
```text {filename="Markdown"}
{{</* filetree/container */>}}
{{</* filetree/folder name="content" */>}}
{{</* filetree/file name="_index.md" */>}}
{{</* filetree/folder name="docs" state="closed" */>}}
{{</* filetree/file name="_index.md" */>}}
{{</* filetree/file name="introduction.md" */>}}
{{</* filetree/file name="introduction.fa.md" */>}}
{{</* /filetree/folder */>}}
{{</* /filetree/folder */>}}
{{</* filetree/file name="hugo.toml" */>}}
{{</* /filetree/container */>}}
```

View File

@ -0,0 +1,33 @@
---
title: 文件树
---
## 示例
{{< filetree/container >}}
{{< filetree/folder name="content" >}}
{{< filetree/file name="_index.md" >}}
{{< filetree/folder name="docs" state="closed" >}}
{{< filetree/file name="_index.md" >}}
{{< filetree/file name="introduction.md" >}}
{{< filetree/file name="introduction.fr.md" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< filetree/file name="hugo.toml" >}}
{{< /filetree/container >}}
## 用法
```text {filename="Markdown"}
{{</* filetree/container */>}}
{{</* filetree/folder name="content" */>}}
{{</* filetree/file name="_index.md" */>}}
{{</* filetree/folder name="docs" state="closed" */>}}
{{</* filetree/file name="_index.md" */>}}
{{</* filetree/file name="introduction.md" */>}}
{{</* filetree/file name="introduction.fr.md" */>}}
{{</* /filetree/folder */>}}
{{</* /filetree/folder */>}}
{{</* filetree/file name="hugo.toml" */>}}
{{</* /filetree/container */>}}
```

View File

@ -0,0 +1,47 @@
---
title: آیکون
---
برای استفاده از این کد کوتاه درون‌خطی، باید آن را در پیکربندی فعال کنید:
```yaml {filename="hugo.yaml"}
enableInlineShortcodes: true
```
فهرست آیکون‌های موجود را می‌توانید در [`data/icons.yaml`](https://github.com/imfing/hextra/blob/main/data/icons.yaml) پیدا کنید.
<!--more-->
## مثال
{{< icon "academic-cap" >}}
{{< icon "cake" >}}
{{< icon "gift" >}}
{{< icon "sparkles" >}}
## استفاده
```
{{</* icon "github" */>}}
```
آیکون‌های با طرح‌های متفاوت در [Heroicons](https://v1.heroicons.com/) نسخه ۱ خارج از جعبه در دسترس هستند.
### چجوری آیکون‌های خودمان را اضافه کنیم
پرونده `data/icons.yaml` را ایجاد کنید، سپس آیکون‌های SVG خود را در فرمت زیر اضافه کنید:
```yaml {filename="data/icons.yaml"}
your-icon: <svg>your icon svg content</svg>
```
سپس می‌توان آن را در کد کوتاه مانند زیر استفاده کرد:
```
{{</* icon "your-icon" */>}}
{{</* card icon="your-icon" */>}}
```
نکته: [Iconify Design](https://iconify.design/) مکانی عالی برای پیدا کردن آیکون‌های SVG برای سایت شما است.

View File

@ -8,7 +8,9 @@ To use this shortcode inline, inline shortcode needs to be enabled in the config
enableInlineShortcodes: true
```
The list of available icons can be found in `data/icons.yaml`.
List of available icons can be found in [`data/icons.yaml`](https://github.com/imfing/hextra/blob/main/data/icons.yaml).
<!--more-->
## Example
@ -25,14 +27,20 @@ The list of available icons can be found in `data/icons.yaml`.
[Heroicons](https://v1.heroicons.com/) v1 outline icons are available out of the box.
You can also add your own icons by adding them to `data/icon.yaml`:
### How to add your own icons
```yaml {filename="data/icon.yaml"}
Create `data/icons.yaml` file, then add your own SVG icons in the following format:
```yaml {filename="data/icons.yaml"}
your-icon: <svg>your icon svg content</svg>
```
which can then be used like this:
It then can be used in the shortcode like this:
```
{{</* icon "your-icon" */>}}
{{</* card icon="your-icon" */>}}
```
Tip: [Iconify Design](https://iconify.design/) is a great place to find SVG icons for your site.

View File

@ -0,0 +1,46 @@
---
title: 图标
---
要内联使用此短代码,需要在配置中启用内联短代码:
```yaml {filename="hugo.yaml"}
enableInlineShortcodes: true
```
可用图标列表可以在以下位置找到 [`data/icons.yaml`](https://github.com/imfing/hextra/blob/main/data/icons.yaml).
<!--more-->
## 示例
{{< icon "academic-cap" >}}
{{< icon "cake" >}}
{{< icon "gift" >}}
{{< icon "sparkles" >}}
## 用法
```
{{</* icon "github" */>}}
```
[Heroicons](https://v1.heroicons.com/) v1 轮廓图标开箱即用
### 如何添加自己的图标
创建 `data/icons.yaml` 文件,然后按以下格式添加您自己的 SVG 图标:
```yaml {filename="data/icons.yaml"}
your-icon: <svg>your icon svg content</svg>
```
然后可以在短代码中使用它,如下所示:
```
{{</* icon "your-icon" */>}}
{{</* card icon="your-icon" */>}}
```
提示:[Iconify Design](https://iconify.design/) 是为您的网站查找 SVG 图标的好地方

View File

@ -0,0 +1,79 @@
---
title: "Jupyter Notebook Component"
linktitle: "Jupyter Notebook"
math: true
sidebar:
exclude: true
---
{{< callout >}}Experimental feature to include Jupyter Notebooks via a shortcode. Note that not all cell types are supported.{{< /callout >}}
[Jupyter Notebook](https://jupyter.org/) is a language-agnostic HTML notebook application for [Project Jupyter](https://jupyter.org/). It allows you to create and share documents that contain live code, equations, visualizations, and narrative text.
<!--more-->
## How to use
### Using a local notebook
To use the Jupyter Notebook shortcode, you need to have a Jupyter Notebook file in your project. Similar to how you would [add images](../../organize-files#add-images) to the project, you can add Jupyter Notebooks to the `assets` folder.
{{< filetree/container >}}
{{< filetree/folder name="assets" >}}
{{< filetree/file name="notebook.ipynb" >}}
{{< /filetree/folder >}}
{{< filetree/folder name="content" >}}
{{< filetree/folder name="docs" >}}
{{< filetree/file name="my-page.md" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
Include the Jupyter Notebook in the page using the `jupyter` shortcode:
```markdown {filename="content/docs/my-page.md"}
---
title: My Page
math: true
---
{{%/* jupyter "notebook.ipynb" */%}}
```
Alternatively, you can utilize the [page bundles][page-bundles] feature of Hugo to organize the Jupyter Notebooks together with the Markdown file.
{{< filetree/container >}}
{{< filetree/folder name="content" >}}
{{< filetree/folder name="docs" >}}
{{< filetree/folder name="my-page" >}}
{{< filetree/file name="index.md" >}}
{{< filetree/file name="notebook.ipynb" >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/folder >}}
{{< /filetree/container >}}
```markdown {filename="content/docs/my-page/index.md"}
---
title: My Page
math: true
---
{{%/* jupyter "notebook.ipynb" */%}}
```
### Using a remote notebook
You can also use a remote notebook by providing the URL to the notebook file. For example, to include [What is the Jupyter Notebook](https://github.com/jupyter/notebook/blob/main/docs/source/examples/Notebook/What%20is%20the%20Jupyter%20Notebook.ipynb) notebook in the page, you can use the following shortcode:
```
{{%/* jupyter "https://raw.githubusercontent.com/jupyter/notebook/main/docs/source/examples/Notebook/What%20is%20the%20Jupyter%20Notebook.ipynb" */%}}
```
## Example Notebook
{{< callout type="info" >}}The following is an example of a notebook file that is included in the project assets folder.{{< /callout >}}
{{% jupyter "example.ipynb" %}}
[page-bundles]: https://gohugo.io/content-management/page-bundles/#leaf-bundles

View File

@ -0,0 +1,43 @@
---
title: Other Shortcodes
linkTitle: Others
sidebar:
exclude: true
---
{{< callout emoji="" >}}
Some of these are Hugo built-in shortcodes.
These shortcodes are considered less stable and may be changed anytime.
{{< /callout >}}
## YouTube
Embed a YouTube video.
```
{{</* youtube VIDEO_ID */>}}
```
Result:
{{< youtube id=dQw4w9WgXcQ loading=lazy >}}
For more information, see [Hugo's YouTube Shortcode](https://gohugo.io/content-management/shortcodes/#youtube).
## PDF
With PDF shortcode, you can embed a PDF file in your content.
```
{{</* pdf "https://example.com/sample.pdf" */>}}
```
You can also place the PDF file in your project directory and use the relative path.
```
{{</* pdf "path/to/file.pdf" */>}}
```
Example:
{{< pdf "https://upload.wikimedia.org/wikipedia/commons/1/13/Example.pdf" >}}

View File

@ -0,0 +1,42 @@
---
title: مراحل
next: /docs/guide/deploy-site
---
یک کامپوننت داخلی برای نمایش یک سری مراحل.
## مثال
{{% steps %}}
### مرحله ۱
این اولین مرحله است.
### مرحله ۲
این دومین مرحله است.
### مرحله ۳
این سومین مرحله است.
{{% /steps %}}
## استفاده
سرتیتر مارک‌داون h3 را در کد کوتاه `steps` قرار دهید.
```
{{%/* steps */%}}
### مرحله ۱
این اولین مرحله است.
### مرحله ۲
این دومین مرحله است.
{{%/* /steps */%}}
```

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