Hugo 主题
re-Terminal
一个简洁的、复古的 Hugo 主题。
re-Terminal
欢迎使用 Hugo 主题 re-Terminal!
您好!我很高兴地宣布,我们收到了 Hugo 主题 re-Terminal 的全新分支,现在正式名为 Hugo 主题 Re-Terminal!
作为维护者,我很高兴分享这个主题将继续发展并接收新功能的更新。为什么?因为我自己也在使用它!你可以放心,我所做的任何更改都将经过彻底的测试,并针对实际使用进行改进。
这个分支旨在为最初的 re-Terminal 主题注入新的活力,该主题曾经是 Hugo 爱好者中的热门选择。不幸的是,随着时间的推移,它被忽视了。但现在不会了!通过 re-Terminal,我们致力于保持原始精神的活力,同时添加新的视角和创新。
在未来的几周和几个月里,您将会看到新的功能和错误修复。我们还将积极寻求社区的反馈,以确保这个主题继续满足您的需求并超越您的期望。
所以,欢迎加入!我很高兴您能加入我们的旅程,共同塑造 Hugo 主题 re-Terminal 的未来。让我们开始吧!
演示 - https://re-terminal.nebrowser.com/
⚠️ 该主题至少需要 Hugo Extended v0.129.0。
- 功能
- 内置短代码
- 代码高亮
- 如何开始
- 如何运行您的站点
- 如何配置
- 文章原型
- 附加组件
- 如何编辑主题
- 发现错误?
- 新的酷炫想法或功能
- 终端主题用户?
- 许可证
功能
- 5 种双色主题,取决于您的偏好(橙色是默认值,红色、蓝色、绿色、粉色)
- Fira Code 作为默认的等宽字体。它非常漂亮!
- 非常棒的双色调,基于 PrismJS 的自定义语法高亮
- 完全响应式
- 完全基于 Hugo 生态系统 (Pipes 和 Modules)
内置短代码
image
(必需属性:src
;可选属性:alt
、position
(左是默认值 | center | right)、style
)- 例如
{{< image src="/img/hello.png" alt="Hello Friend" position="center" style="border-radius: 8px;" >}}
figure
(与image
相同,外加一些可选属性:caption
、captionPosition
(left | center 是默认值 | right)、captionStyle
)- 例如
{{< figure src="/img/hello.png" alt="Hello Friend" position="center" style="border-radius: 8px;" caption="Hello Friend!" captionPosition="right" captionStyle="color: red;" >}}
code
(必需属性:language
;可选属性:title
、id
、expand
(默认 “△”)、collapse
(默认 “▽”)、isCollapsed
)- 例如
{{< code language="css" title="Really cool snippet" id="1" expand="Show" collapse="Hide" isCollapsed="true" >}} pre { background: #1a1a1d; padding: 20px; border-radius: 8px; font-size: 1rem; overflow: auto; @media (--phone) { white-space: pre-wrap; word-wrap: break-word; } code { background: none !important; color: #ccc; padding: 0; font-size: inherit; } } {{< /code >}}
代码高亮
基于 PrismJS 的自定义语法高亮。您需要做的就是像这样包装您的代码
```html
// your code here
```
支持的语言:actionscript、apacheconf、applescript、bash、c、clike、cmake、coffeescript、cpp、csharp、csp、css、css-extras、diff、django、docker、elixir、elm、erlang、flow、fsharp、git、go、graphql、haml、handlebars、haskell、http、java、javascript、json、jsx、kotlin、latex、less、llvm、makefile、markdown、markup、markup-templating、nasm、objectivec、ocaml、perl、php、php-extras、powershell、processing、pug、python、r、reason、ruby、rust、sass、scala、scheme、scss、sql、stylus、swift、textile、toml、tsx、twig、typescript、vim、visual-basic、wasm、yaml。
如何开始
您可以通过访问 https://github.com/mirus-ua/hugo-theme-re-terminal.git 并将其粘贴到根目录中的 themes/re-terminal
来手动下载主题。
您还可以选择 3 种可能性之一 来安装主题
- 作为 Hugo 模块
- 作为独立的本地目录
- 作为 git 子模块
⚠️ 该主题至少需要 Hugo Extended v0.90.x。
将主题作为 Hugo 模块安装
# If this is the first time you're using Hugo Modules
# in your project. You have to initiate your own module before
# you fetch the theme module.
#
# hugo mod init [your website/module name]
hugo mod get github.com/mirus-ua/hugo-theme-re-terminal
并在您的配置文件中添加
[module]
# this is needed when you fetch the theme as a submodule to your repo.
# replacements = "github.com/mirus-ua/hugo-theme-re-terminal -> themes/re-terminal"
[[module.imports]]
path = 'github.com/mirus-ua/hugo-theme-re-terminal'
请记住,默认情况下,该主题不会出现在 themes
目录中。这意味着您正在使用主题,因为它在您获取它时位于存储库中。您的本地 go.sum
文件保留所有引用。请阅读官方文档中有关 Hugo 模块的更多信息。
在本地安装主题
git clone https://github.com/mirus-ua/hugo-theme-re-terminal.git themes/re-terminal
这将直接将存储库克隆到 themes/re-terminal
目录。
将主题作为子模块安装
git submodule add -f https://github.com/mirus-ua/hugo-theme-re-terminal.git themes/re-terminal
这将把存储库作为 themes/re-terminal
目录中的一个子模块安装。
⚠️ 如果您遇到任何问题
Error: module "re-terminal" not found; either add it as a Hugo Module or store it in "[...your custom path]/themes".: module does not exist
那么请尝试从您的配置文件中删除 theme = "re-terminal"
。
如何运行您的站点
hugo server -t re-terminal
并在您的浏览器中访问 localhost:1313
。从现在开始,您所做的所有更改都将生效,因此您无需每次都刷新浏览器。
如何配置
该主题不需要任何高级配置。只需复制
baseurl = "/"
languageCode = "en-us"
# Add it only if you keep the theme in the `themes` directory.
# Remove it if you use the theme as a remote Hugo Module.
theme = "re-terminal"
paginate = 5
[params]
# dir name of your main content (default is `content/posts`).
# the list of set content will show up on your index page (baseurl).
contentTypeName = "posts"
# ["orange", "blue", "red", "green", "pink"]
themeColor = "orange"
# if you set this to 0, only submenu trigger will be visible
showMenuItems = 2
# show selector to switch language
showLanguageSelector = false
# set theme to full screen width
fullWidthTheme = false
# center theme with default width
centerTheme = false
# if your resource directory contains an image called `cover.(jpg|png|webp)`,
# then the file will be used as a cover automatically.
# With this option you don't have to put the `cover` param in a front-matter.
autoCover = true
# set post to show the last updated
# If you use git, you can set `enableGitInfo` to `true` and then post will automatically get the last updated
showLastUpdated = false
# set a custom favicon (default is a `themeColor` square)
# favicon = "favicon.ico"
# Provide a string as a prefix for the last update date. By default, it looks like this: 2020-xx-xx [Updated: 2020-xx-xx] :: Author
# updatedDatePrefix = "Updated"
# set all headings to their default size (depending on browser settings)
# oneHeadingSize = true # default
# whether to show a page's estimated reading time
# readingTime = false # default
# whether to show a table of contents
# can be overridden in a page's front-matter
# Toc = false # default
# set title for the table of contents
# can be overridden in a page's front-matter
# TocTitle = "Table of Contents" # default
# you can set a banner on the top of the page with a call to action
# defaults: dismissible = false; URL is optional
# [params.banner]
# dismissible = false
# text = "Check it out on GitHub"
# url = "https://github.com/mirus-ua/hugo-theme-re-terminal"
[params.twitter]
# set Twitter handles for Twitter cards
# see https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/getting-started#card-and-content-attribution
# do not include @
creator = ""
site = ""
[languages]
[languages.en.params]
languageName = "English"
title = "re-Terminal"
subtitle = "A simple, retro theme for Hugo"
owner = ""
keywords = ""
copyright = ""
menuMore = "Show more"
readMore = "Read more"
readOtherPosts = "Read other posts"
newerPosts = "Newer posts"
olderPosts = "Older posts"
missingContentMessage = "Page not found..."
missingBackButtonLabel = "Back to home page"
minuteReadingTime = "min read"
words = "words"
[languages.en.params.logo]
logoText = "re-Terminal"
logoHomeLink = "/"
[languages.en.menu]
[[languages.en.menu.main]]
identifier = "about"
name = "About"
url = "/about"
[[languages.en.menu.main]]
identifier = "showcase"
name = "Showcase"
url = "/showcase"
[module]
# In case you would like to make changes to the theme and keep it locally in you repository,
# uncomment the line below (and correct the local path if necessary).
# --
# replacements = "github.com/mirus-ua/hugo-theme-re-terminal -> themes/re-terminal"
[[module.imports]]
path = 'github.com/mirus-ua/hugo-theme-re-terminal'
到你 Hugo 根目录下的 config.toml
文件中,并更改 params 字段。 如果需要,这里有一个 YAML 版本。
注意:请记住,目前 main menu
不支持嵌套。
文章原型
请查看主题支持的默认 post
文件参数 — https://github.com/mirus-ua/hugo-theme-re-terminal/blob/main/archetypes/posts.md
附加组件
- 评论 — 要为你的博客文章添加评论,请查看
layouts/partials/comments.html
https://github.com/mirus-ua/hugo-theme-re-terminal/blob/main/layouts/partials/comments.html。 - 评论计数器 — 要为你的博客文章添加评论计数器,请查看
layouts/partials/comments_counter.html
https://github.com/mirus-ua/hugo-theme-re-terminal/blob/main/layouts/partials/comments_counter.html。 - 扩展头部 — 请查看
layouts/partials/extended_head.html
https://github.com/mirus-ua/hugo-theme-re-terminal/blob/main/layouts/partials/extended_head.html - 扩展页脚 — 请查看
layouts/partials/extended_footer.html
https://github.com/mirus-ua/hugo-theme-re-terminal/blob/main/layouts/partials/extended_footer.html
底层附加组件
- 文章基础 — 渲染文章内容的最基本部分。有关动机和详细信息,请查看 https://github.com/mirus-ua/hugo-theme-re-terminal/blob/main/layouts/partials/extended_footer.html
如何编辑主题
如果你使用远程 Hugo 模块(你的 theme/re-terminal
中没有主题文件),并且你只需要覆盖一些样式,你可以通过在你的根目录中添加 static/style.css
文件并指向你想要更改的内容来轻松实现。
如果你的主题文件在 theme 目录中,那么你可以直接编辑主题中的任何内容,你只需转到 themes/re-terminal
并修改文件。无需编译步骤。
发现错误?
如果你发现任何错误,请使用 Issue Tracker 或创建一个新的 Pull Request 来修复该问题。
新的酷想法或功能?
该主题自 2019 年以来一直在不断开发,并获得了许多很棒的功能,这些功能帮助了你们中的许多人,并使主题变得更好。但是也有许多我不确定的功能,因为我想尽可能保持主题的简单性。
所以,假设你有一个关于如何扩展主题的想法。这很酷,欢迎你这样做,只需按照以下步骤操作
- fork 该主题
- 实现该功能
- 编写关于如何使用该功能的说明
- 为其他用户提供该实现的工作示例
- 将你的工作信息添加到
COMMUNITY-FEATURES.md
- 创建一个包含已编辑的
COMMUNITY-FEATURES.md
的 PR
这将有助于保持主题接近其根源,并允许任何希望改进它并满足其需求的人做任何他们想做的事。
听起来不错?太棒了,让我们开始吧! 🤘
re-Terminal 主题用户?
我很乐意了解更多关于你和你正在做的事情。如果你想分享,请做出贡献并将你的网站添加到列表中! 🤗
许可证
版权所有 © 2019-2022 Radosław Kozieł (@panr)
版权所有 © 2024-now Mirus
该主题在 MIT 许可证下发布。查看原始主题许可证以获取其他许可信息。