✨ 🎨 Upgrade Hugo min version is 134 & add read more feature
This commit is contained in:
parent
c4649b8284
commit
f7f5311e6f
@ -10,7 +10,7 @@
|
||||
|
||||
> All page designs & configuration compatibility with Hexo NexT, it's very easy migrate your site from Hexo to Hugo and enjoy yourself.
|
||||
|
||||
[](https://app.gitter.im/#/room/#hugo-next_community:gitter.im) [](https://github.com/gohugoio/hugo/releases/latest) [](https://github.com/hugo-next/hugo-theme-next) [](https://github.com/hugo-next/hugo-theme-next/graphs/contributors) [](https://github.com/hugo-next/hugo-theme-next/releases) [](https://github.com/hugo-next/hugo-theme-next/find/main) [](https://github.com/hugo-next/hugo-theme-next/blob/main/LICENSE)
|
||||
[](https://app.gitter.im/#/room/#hugo-next_community:gitter.im) [](https://github.com/gohugoio/hugo/releases/latest) [](https://github.com/hugo-next/hugo-theme-next) [](https://github.com/hugo-next/hugo-theme-next/graphs/contributors) [](https://github.com/hugo-next/hugo-theme-next/releases) [](https://github.com/hugo-next/hugo-theme-next/find/main) [](https://github.com/hugo-next/hugo-theme-next/blob/main/LICENSE)
|
||||
|
||||

|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
> 本主题的所有页面设计和配置项都与原来 `Hexo` 引擎的 `NexT` 主题保持了良好的兼容性,可以非常平滑的从 `Hexo` 迁移至 `Hugo` 引擎,欢迎大家使用并反馈。
|
||||
|
||||
[](https://app.gitter.im/#/room/#hugo-next_community:gitter.im) [](https://github.com/gohugoio/hugo/releases/latest) [](https://github.com/hugo-next/hugo-theme-next) [](https://github.com/hugo-next/hugo-theme-next/graphs/contributors) [](https://github.com/hugo-next/hugo-theme-next/releases) [](https://github.com/hugo-next/hugo-theme-next/find/main) [](https://github.com/hugo-next/hugo-theme-next/blob/main/LICENSE)
|
||||
[](https://app.gitter.im/#/room/#hugo-next_community:gitter.im) [](https://github.com/gohugoio/hugo/releases/latest) [](https://github.com/hugo-next/hugo-theme-next) [](https://github.com/hugo-next/hugo-theme-next/graphs/contributors) [](https://github.com/hugo-next/hugo-theme-next/releases) [](https://github.com/hugo-next/hugo-theme-next/find/main) [](https://github.com/hugo-next/hugo-theme-next/blob/main/LICENSE)
|
||||
|
||||

|
||||
|
||||
|
@ -80,4 +80,9 @@
|
||||
svg {
|
||||
max-width: 98%;
|
||||
}
|
||||
|
||||
// For read more post content anchor
|
||||
#more {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,8 @@ languageCode: zh-CN
|
||||
hasCJKLanguage: true
|
||||
# 每页显示文章数量
|
||||
# Display items per page
|
||||
paginate: 10
|
||||
pagination:
|
||||
pagerSize: 10
|
||||
# 开启支持表情符号
|
||||
# Enable Emoji support
|
||||
enableEmoji: true
|
||||
|
@ -20,8 +20,6 @@ toc: true
|
||||
|
||||
对于熟悉前端开发的用户来说,可以通过自定义文件配置,实现对站点的样式和布局进行个性化的调整。其中布局方面主要是支持左侧边栏的站点概览部分,以及站点底部2个位置,但样式的重置可以是整个站点的任意位置。
|
||||
|
||||
<!--more-->
|
||||
|
||||
## 打开配置参数
|
||||
|
||||
首先要明确在配置文件的 `params` 区域中有配置如下参数:
|
||||
@ -65,7 +63,6 @@ Website source code <a href="https://github.com/hugo-next/hugo-theme-next/tree/d
|
||||
|
||||
再把该文件的路径配置到相应的参数中,效果请查看站点底部的效果。
|
||||
|
||||
|
||||
## 自定义样式
|
||||
|
||||
在前面创建 `css` 目录中新一个后缀名为 `css` 的文件,然后可以在里面把站点的样式进行重定义,或是增加一些自己定义的样式设计,在写文章时进行引用,示例如下:
|
||||
|
@ -1,17 +1,15 @@
|
||||
{{/* Use to defind global variables */}}
|
||||
|
||||
{{ $version := int (index (split hugo.Version ".") 1) }}
|
||||
{{ if lt $version 89 }}
|
||||
{{ warnf "当前 Hugo 版本小于 0.89.0,请到官方地址下载 Hugo 最新版本:https://github.com/gohugoio/hugo/releases" }}
|
||||
{{ errorf "Current Hugo version is less then 0.89.0, Please download Hugo latest version on offical site: https://github.com/gohugoio/hugo/releases" }}
|
||||
{{ end }}
|
||||
|
||||
{{ $majorVer := int (index (split hugo.Version ".") 1) }}
|
||||
{{ if lt $majorVer 134 }}
|
||||
{{ errorf "当前 Hugo 版本为 %s 小于 0.134.0,请到官方地址下载 Hugo 最新版本:https://github.com/gohugoio/hugo/releases" hugo.Version }}
|
||||
{{ errorf "Current Hugo version is %s less then 0.134.0, Please download the Hugo latest version from offical site: https://github.com/gohugoio/hugo/releases" hugo.Version }}
|
||||
{{ end }}
|
||||
|
||||
{{ if not hugo.IsExtended }}
|
||||
{{ warnf "Hugo NexT 主题使用了 SCSS 框架,请到官方地址下载 Hugo Extended 版本:https://github.com/gohugoio/hugo/releases" }}
|
||||
{{ errorf "Because that use SCSS framework in Hugo NexT, Please download Hugo extended version on offical site: https://github.com/gohugoio/hugo/releases" }}
|
||||
{{ errorf "Hugo NexT 主题使用了 SCSS 框架,请到官方地址下载 Hugo Extended 版本:https://github.com/gohugoio/hugo/releases" }}
|
||||
{{ errorf "Because that use SCSS framework in Hugo NexT, Please download the Hugo extended version from offical site: https://github.com/gohugoio/hugo/releases" }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ $globalVars := newScratch }}
|
||||
|
||||
{{ $pages := (where .Page.Site.RegularPages "Section" "in" .Site.Params.mainSections) }}
|
||||
|
@ -6,6 +6,9 @@
|
||||
{{ .Summary }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ .Content }}
|
||||
{{/** Started use the read more content anchor the need Hugo framework min marjo version greater than 0.134.0 **/}}
|
||||
{{ .Summary }}
|
||||
<a id="more"><!-- It's an anchor point to locate read more content start. --></a>
|
||||
{{ .ContentWithoutSummary }}
|
||||
{{ end }}
|
||||
{{ end }}
|
@ -5,7 +5,7 @@ description = "Easily & powerful theme for Hugo engine."
|
||||
homepage = "https://github.com/hugo-next/hugo-theme-next"
|
||||
tags = ["Blog", "Simple", "Personal", "Responsive", "Documentation", "Light", "Dark"]
|
||||
features = ["Blog", "Responsive", "Documentation", "Light", "Dark"]
|
||||
min_version = "0.89.0"
|
||||
min_version = "0.134.0"
|
||||
demosite = "https://preview.hugo-next.eu.org"
|
||||
|
||||
[author]
|
||||
|
Loading…
Reference in New Issue
Block a user