Hugo 主题
BlogRa
终极技术博客主题
演示
你可以在 rafed.github.io/devra 上查看我的博客的这个主题的实时演示。
功能
站点功能
- Google 搜索栏
- Google Analytics (v4)
- 文章下方用于在社交媒体上分享的分享栏
- 用于链接到不同社交媒体的社交链接占位符
- 使用 Disqus 的评论
- 可自定义的导航栏
- 移动响应式 - 在桌面、平板电脑和手机上都能完美运行
- SEO 友好 (Opengraph, Twitter 卡片)
- 用于查看站点摘要(帖子数、标签、部分)的管理面板
博客功能
- 有吸引力的登录页面,到处都有文章/标签链接
- 在帖子中添加特色图片
- 为相关文章创建章节(例如,关于某个主题的教程)
- 添加代码片段
- 添加数学公式
- 使用 mermaid 添加图表
- 向文章添加标签,并按标签列出文章
安装和更新
您需要下载 Hugo 的扩展版本才能使用此主题构建您的站点。 从发布页面搜索并下载它。
$ # create directory for the blog
$ mkdir site & cd site
$
$ git submodule add https://github.com/rafed/BlogRa.git themes/BlogRa
$ echo "theme = 'BlogRa'" >> config.toml
要获取更新的主题,请运行
$ git submodule update --remote --merge
如果您想了解更多信息,请参阅 Hugo 文档。
config.toml
示例
baseURL = "https://example.com/"
canonifyURLs=true
pluralizeListTitles = false
summaryLength = 25
theme = "BlogRa"
languageCode = "en-us"
title = "BlogRa Theme"
disqusShortname = ""
[params]
description = "The Ultimate Tech Blogging Theme"
contactEmail = "your-email@domain.com"
footer = ""
googleSearch = "google-cse-key"
googleAnalytics = "G-A1B2C3D4E5" # v4
adsense = "adsense-key"
math = false # best to enable this in the front matter of a page
mermaid = false # best to enable this in the front matter of a page
# Social Media Params
facebook = "https://#/DevHacker-2351204168278028"
twitter = "https://x.com/rafedyasir"
youtube = "https://www.youtube.com/channel/UC6uDg4IlPbLh2xNKrqnBczw"
instagram = "https://www.instagram.com/rafedyasir/"
github = "https://github.com/rafed"
pinterest = ""
linkedin = "https://www.linkedin.com/in/rafed-m-yasir/"
# Configure the site menu here
[menu]
[[menu.main]]
name = "Home"
url = "/"
weight = 1
[[menu.main]]
identifier = "blog"
name = "Blog"
weight = 2
[[menu.main]]
parent = "blog"
name = "Posts"
url = "/posts/"
weight = 1
[[menu.main]]
parent = "blog"
name = "Sections"
url = "/sections/"
weight = 2
[[menu.main]]
parent = "blog"
name = "divider"
weight = 3
[[menu.main]]
parent = "blog"
name = "Tags"
url = "/tags/"
weight = 4
[[menu.main]]
name = "About"
url = "/about/"
weight = 3
[[menu.main]]
name = "Contact"
url = "/contact/"
weight = 4
# Don't touch this
[markup.goldmark.renderer]
unsafe = true
Frontmatter 示例
---
title: {{ replace .Name "-" " " | title }}
date: {{ now.Format "2006-01-2" }}
tags: [tag1, tag2]
image: "blog-pic.png"
description: "A smalll optional description"
math: true # to enable showing equations (katex)
mermaid: true # to add diagrams using mermaid
---
贡献
如果您在主题中发现问题,请提交 issue。 此外,欢迎贡献/pull requests。
许可证
GPL。