diff --git a/README.md b/README.md index 6f8cea4..235978c 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,16 @@ $ cp themes/hugo-theme-next/exampleSite/config.yaml . $ mv config.toml config.toml.backup ``` +Or use `Hugo module` to lead into the theme, see below commands: + +```shell +$ cd hugo-next-exmaple +$ hugo mod init hugo-next-exmaple +$ wget -O config.yaml https://github.com/hugo-next/hugo-theme-next/raw/main/exampleSite/config.yaml +$ sed -i 's/hugo-theme-next/github.com\/hugo-next\/hugo-theme-next\/v4/' config.yaml +$ mv config.toml config.toml.backup +``` + ### 💻 Preview on Local ```shell @@ -74,6 +84,13 @@ $ cd hugo-next-exmaple $ git submodule update --remote ``` +Execute command as below if you are using `Hugo module`: + +```shell +$ cd hugo-next-exmaple +$ hugo mod get -u +``` + ## 📝 New Post There had ready a new post template for you, It is recommended to use the following Hugo command to quickly create a new post: diff --git a/README.zh.md b/README.zh.md index ea54e6b..afca5fd 100644 --- a/README.zh.md +++ b/README.zh.md @@ -52,6 +52,16 @@ $ cp themes/hugo-theme-next/exampleSite/config.yaml . $ mv config.toml config.toml.backup ``` +或通过 `Hugo module` 模式引用本主题,参考如下命令: + +```shell +$ cd hugo-next-exmaple +$ hugo mod init hugo-next-exmaple +$ wget -O config.yaml https://github.com/hugo-next/hugo-theme-next/raw/main/exampleSite/config.yaml +$ sed -i 's/hugo-theme-next/github.com\/hugo-next\/hugo-theme-next\/v4/' config.yaml +$ mv config.toml config.toml.backup +``` + ### 💻 本地预览 ```shell @@ -73,6 +83,13 @@ $ cd hugo-next-exmaple $ git submodule update --remote ``` +如使用 `Hugo module`,执行如下命令: + +```shell +$ cd hugo-next-exmaple +$ hugo mod get -u +``` + > **Note** > 本主题的代码同时也同步到 `Gitee` 仓库,在国内环境可切换用 [https://gitee.com/hugo-next/hugo-theme-next.git](https://gitee.com/hugo-next/hugo-theme-next.git) 镜像速度更快,也更稳定。 diff --git a/VERSION b/VERSION index 28446a5..f4fa8fc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.6.0 \ No newline at end of file +4.6.1 \ No newline at end of file diff --git a/assets/css/_mixins.scss b/assets/css/_mixins.scss index e0c65c5..0243dd5 100644 --- a/assets/css/_mixins.scss +++ b/assets/css/_mixins.scss @@ -99,7 +99,7 @@ @if $icon { content: $icon; } - font-family: 'Font Awesome 5 Free'; + font-family: 'Font Awesome 6 Free'; font-weight: 900; } diff --git a/assets/js/utils.js b/assets/js/utils.js index f03bf25..7510a72 100644 --- a/assets/js/utils.js +++ b/assets/js/utils.js @@ -278,7 +278,7 @@ NexT.utils = { const button = element.querySelector('.copy-btn'); button.addEventListener('click', () => { const lines = element.querySelector('.code') || element.querySelector('code'); - const code = lines.innerText; + const code = lines.innerText.replace(/(\n{2,})/g, '\n'); if (navigator.clipboard) { // https://caniuse.com/mdn-api_clipboard_writetext navigator.clipboard.writeText(code).then(() => { @@ -670,4 +670,4 @@ NexT.utils = { intersectionObserver.observe(element); }); } -}; \ No newline at end of file +}; diff --git a/data/config.yaml b/data/config.yaml index 0866ce7..85fae72 100644 --- a/data/config.yaml +++ b/data/config.yaml @@ -1,5 +1,5 @@ # Hugo NexT theme's custom config -version: 4.6.0 +version: 4.6.1 domain: hugo-next.eu.org \ No newline at end of file diff --git a/data/resources.yaml b/data/resources.yaml index 5c8c52e..80510ce 100644 --- a/data/resources.yaml +++ b/data/resources.yaml @@ -20,7 +20,7 @@ js: # CSS Resources css: - name: '@fortawesome/fontawesome-free' - version: 6.1.2 + version: 6.4.2 file: css/all.min.css alias: font-awesome - name: animate.css @@ -52,12 +52,12 @@ addthis: waline: js: name: '@waline/client' - version: 2.13.0 + version: 2.15.8 file: dist/waline.js alias: waline css: name: '@waline/client' - version: 2.13.0 + version: 2.15.8 file: dist/waline.css alias: waline diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 0074bb3..499d3d0 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -153,7 +153,6 @@ menus: pageref: /post/math-formula.html weight: 2 parent: example - parent: example - identifier: syntax name: 语法高亮 pageref: /post/syntax-highlighting.html @@ -1047,7 +1046,7 @@ params: # - flat flat callout style with background, like on Mozilla or StackOverflow. # - disabled disable all CSS styles import of note tag. style: simple - icons: false + icons: true # Offset lighter of background in % for modern and flat styles (modern: -12 | 12; flat: -18 | 6). # Offset also applied to label tag variables. This option can work with disabled note tag. lightBgOffset: 0 diff --git a/exampleSite/content/post/custom-files.md b/exampleSite/content/post/custom-files.md index c374deb..fcc99c7 100644 --- a/exampleSite/content/post/custom-files.md +++ b/exampleSite/content/post/custom-files.md @@ -39,7 +39,7 @@ customFilePath: {{< /note >}} -然后在站点的根目录下创建 `layouts/partials` 2个目录,用于存放自定布局设计文件,另外在站点根目录下创建 `statics/css` 2个目录,用于存放自定义 CSS 样式文件。一切就绪后,就可以参考如下的步骤,完成自己的设计想法。 +然后在站点的根目录下创建 `layouts/partials` 2个目录,用于存放自定布局设计文件,另外在站点根目录下创建 `static/css` 2个目录,用于存放自定义 CSS 样式文件。一切就绪后,就可以参考如下的步骤,完成自己的设计想法。 ## 侧边栏设计 diff --git a/exampleSite/content/post/shortcodes.md b/exampleSite/content/post/shortcodes.md index 4cac174..655e18c 100644 --- a/exampleSite/content/post/shortcodes.md +++ b/exampleSite/content/post/shortcodes.md @@ -66,6 +66,11 @@ url: "post/shortcodes.html" **Welcome** to [Hugo NexT!](https://preview.hugo-next.eu.org) {{< /note >}} +{{< note primary >}} + ### Primary Header + **Welcome** to [Hugo NexT!](https://preview.hugo-next.eu.org) +{{< /note >}} + {{< note info >}} ### Info Header **Welcome** to [Hugo NexT!](https://preview.hugo-next.eu.org) @@ -84,4 +89,4 @@ url: "post/shortcodes.html" {{< note danger >}} ### Danger Header **Welcome** to [Hugo NexT!](https://preview.hugo-next.eu.org) -{{< /note >}} +{{< /note >}} \ No newline at end of file diff --git a/go.mod b/go.mod index 700af5c..b60b59f 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module github.com/hugo-next/hugo-theme-next -go 1.18 +go 1.18 \ No newline at end of file diff --git a/go.mod.orig b/go.mod.orig new file mode 100644 index 0000000..700af5c --- /dev/null +++ b/go.mod.orig @@ -0,0 +1,3 @@ +module github.com/hugo-next/hugo-theme-next + +go 1.18 diff --git a/hugo-theme-next.go b/hugo-theme-next.go new file mode 100644 index 0000000..31341b5 --- /dev/null +++ b/hugo-theme-next.go @@ -0,0 +1 @@ +package hugothemenext diff --git a/i18n/fr.yaml b/i18n/fr.yaml new file mode 100644 index 0000000..fcd936c --- /dev/null +++ b/i18n/fr.yaml @@ -0,0 +1,136 @@ +#-------------------------------------- +# French Version +#-------------------------------------- +archives: + other: Billets +tag: + other: Tag +tags: + other: Tags +TagTitle: + other: Liste des Tags +category: + other: Categorie +categories: + other: Categories +CateTitle: + other: Classification des items +AllSome: + other: "Total :{{ .Some }}" + + +Symbol: + colon: ":" + comma: "," + period: "." + +Sidebar: + label: + posts: Billets + categories: Categories + tags: Tags + rss: RSS + ccommons: "Creative Commons" + toc: Sommaire + overview: "Présentation" + navToggle: "Fermer/Ouvrire la bar de navigation" + search: Chercher + +Terms: + archives: "{{ .Count }} Billets au total" + categories: "{{ .Count }} Categories au total" + tags: "{{ .Count }} Tags au total" + +PostArchive: + cheers: + um: Hum... + ok: Ok + nice: Cool + good: Bien + great: Génial + excellent: Excellent + keepOn: Continue de publier.╰(*°▽°*)╯ + +PostMeta: + sticky: Stickys + publish: + date: "Publié le " + time: "Date de création" + lastmod: + date: "Mise à jour le " + time: "Modifié le " + category: "Classé comme " + words: + title: Nb. Mots + count: "{{- .WordCount -}}" + reading: + title: "Lectures " + time: "{{- .ReadingTime -}} mins" + views: Vues + comments: Commentaires + tags: Tags + more: "Lire la suite" + edit: "Editer ce billet" + +Reward: + title: Donner + wechatpay: WechatPay + alipay: Alipay + paypal: Paypal + bitcoin: Bitcoin + +PostCopyRight: + title: Titre du billet + author: Autheur du billet + link: Lien du billet + origin: + author: Écrit par + link: Originellement de + license: + title: Note de Copyright + content: "Tous les articles sont sous licence %s." + +PostFollowMe: + other: "Autres réseaux sociaux" + +PostComments: + title: Commentaires + +SiteInfoItems: + title: "Statistiques" + runTimes: "En cours:" + words: "Nb. Mots:" + readTimes: "Temps de lecture: " + visitors: "Visiteurs: " + pageViews: "Vues: " + todayViews: "Nombre de vues du jour: " + yesterdayViews: "Nombre de vues d'hier: " + monthViews: "Vues du mois: " + totalViews: "Total des vues: " + lastUpdate: "Dernière mise à jour: " + +Footer: + powerby: "Fait par %s" + +Search: + placeholder: Recherche... + empty: "Nous n'avons pas trouvé ce que vous cherchiez pour : ${query}" + hits: "${hits} resultats trouvés" + time: "${hits} resultats trouvés en ${time} ms" + +DateSuffix: + years: " Années" + days: " Jours" + hours: " Heures" + mins: " Minutes" + month: " Mois" + day: " Jour" + hour: " Heur" + min: " Minute" + just: "A l'instant" + +ToolBtns: + comment: "Commenter" + theme: "Changer le theme" + lang: "Traduction Multilingue" + backTop: "Remonter" diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index 85ff661..64e6d49 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -42,7 +42,7 @@ {{ if not (in $allSecondaryCats $primaryCategory) }}