All Projects → chinanf-boy → gohugo-theme-yinwang

chinanf-boy / gohugo-theme-yinwang

Licence: MIT license
hugo: theme<yinwang> yinwang.org 样式 hugo主题 ❤️ work ✅

Programming Languages

HTML
75241 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to gohugo-theme-yinwang

Atlas
The Hugo boilerplate we use for our projects.
Stars: ✭ 232 (+759.26%)
Mutual labels:  hugo
distillpub
Hugo Theme for Distill
Stars: ✭ 31 (+14.81%)
Mutual labels:  hugo
hugo-artists-theme
Port of Travis Neilson's (DevTips) awesome Artists Theme to Hugo
Stars: ✭ 57 (+111.11%)
Mutual labels:  hugo
Emacs Easy Hugo
Emacs major mode for managing hugo
Stars: ✭ 235 (+770.37%)
Mutual labels:  hugo
Hugo
The world’s fastest framework for building websites.
Stars: ✭ 55,899 (+206933.33%)
Mutual labels:  hugo
documentation-site
This repository contains source for TravelgateX documentation. TravelgateX is a collection of GraphQL APIs for the travel trade.
Stars: ✭ 17 (-37.04%)
Mutual labels:  hugo
Archie
A minimal Hugo Theme
Stars: ✭ 226 (+737.04%)
Mutual labels:  hugo
hackerinnen
hackerinnen.space is a project to provide encouragement and enhance visibility in different places
Stars: ✭ 22 (-18.52%)
Mutual labels:  hugo
hugo-component-matomo
Matomo user tracking and optout scripts for Hugo
Stars: ✭ 38 (+40.74%)
Mutual labels:  hugo
nycmesh.net
NYC Mesh Website
Stars: ✭ 33 (+22.22%)
Mutual labels:  hugo
The Indie Web
A hotspot for indie creations on the web
Stars: ✭ 240 (+788.89%)
Mutual labels:  hugo
Gowebexamples
Go Web Examples Generator
Stars: ✭ 252 (+833.33%)
Mutual labels:  hugo
github-markdown-tailwindcss
⛵ Replicate GitHub Flavored Markdown with Tailwind CSS components
Stars: ✭ 100 (+270.37%)
Mutual labels:  hugo
Forestry.io
Forestry.io website
Stars: ✭ 233 (+762.96%)
Mutual labels:  hugo
hugo-deploy
Easily deploy Hugo sites to Github Pages
Stars: ✭ 11 (-59.26%)
Mutual labels:  hugo
Hugo Future Imperfect Slim
Multilingual Blogging Theme for Hugo | Check the Wiki for Documentation
Stars: ✭ 233 (+762.96%)
Mutual labels:  hugo
hugoblog
Hugoblog is responsive, simple, and clean that would fit for your personal blog based on Hugo Theme Static Site Generator (SSG)
Stars: ✭ 48 (+77.78%)
Mutual labels:  hugo
hugo-docs
Theme for Dgraph documentation built via Hugo
Stars: ✭ 13 (-51.85%)
Mutual labels:  hugo
restaurant-hugo
The restaurant is a creative and responsive restaurant website theme in Hugo environment. It is very well decorated theme which will make your website building easier.
Stars: ✭ 50 (+85.19%)
Mutual labels:  hugo
hugo-kiera
Kiera - A Hugo Theme for writing
Stars: ✭ 61 (+125.93%)
Mutual labels:  hugo

hugo 的 yinwang.org 博客主题

hugo 准备

若你第一次使用 hugo, 请参照一下官方快速教程

直到 添加主题 那一步往下看

主题下载

  • 0. 记得初始化
git init
  • 1. 加入子模块
git submodule add https://github.com/chinanf-boy/gohugo-theme-yinwang.git themes/yinwang;
  • 2. 主题设置
echo 'theme = "yinwang"' >> config.toml
  • 2.1 加个文章
hugo new post/hello.md

注意 ⚠️:是post目录,最好再加个hugo new about.md

  • 3. 服务器启动
hugo server -D

config.toml 配置

baseURL = "http://example.org/"
languageCode = "zh-CN"
title = "我是"
theme = "yinwang"
#pygmentsCodeFences = true
#pygmentsCodefencesGuessSyntax = false
#pygmentsStyle = "dracula"
#pygmentsOptions = ['linenos']
# 代码高亮/chroma,hugo默认自带(可选)

[params]
    author = "yobrave Lee"
    github = "chinanf-boy"
    # gitlab = "yobrave"
    googleAnalytics = "UA-128555056-1" # 谷歌统计gtag
    highlight = "atom-one-dark" # 默认样式 `github`
    langs = ["go"]
    # 默认加载 highlight.min.js,但 一些不支持的语言, 你自己添加,
    # 其实也可以使用hugo自带的语法高亮器设置,不过我有点懒
    # single = false # 单页面的Home 按钮去除
    # menus = true # 想加更多目录,具体请看常见问题中的更多配置
    backgroundColor = "#fbf6ec" # 加点黄黄的背景色
    githubRepo = "https://github.com/chinanf-boy/html-css-list"
    editBtn = true # 两个字段一起,才能搞好编辑按钮
    anchorLink = "" # 瞄点链接
    copyCode = true # 代码复制按钮
    imageZoom = true # 图片点击 zoom 一下
    labels = true # 添加标签链接

单页面配置优先

现在,单页面,可覆盖config.toml4 个 配置。

title: 'Water.css 为简单而生的 css 框架'
date: 2019-04-29T21:50:59+08:00
categories: ['css']
tags: ['simple']
description: '为简单文章而生的 css 框架'
css:
  [
    'https://watercss.netlify.com/dist/light.css',
  ]
draft: false
editBtn: false # 关闭
anchorLink: false # 关闭
copyCode: false # 关闭
imageZoom: false # 关闭
labels: false # 关闭

小目录

功能添加

1. 可通过<rawhtml>短语添加html内容

注意,只需要一个<rawhtml>,同时注意换行不要接-多个空格。(这个 Hugo 功能我也没怎么搞懂,写法不对请指出)

<rawhtml>
  <style>
    div.inner {
      margin: 0 4%;
    }
    tr td:nth-child(2n) {
      background-color: #ffdfac;
    }
    tr td:not(:first-child) code {
      background-color: #ffdfac;
      font-size: 14px;
      margin: 1px;
      display: block;
      padding: 5px;
      text-align: center;
    }
    tr th:not(:first-child) {
      width: 14%;
    }
    th {
      position: static;
    }
  </style></rawhtml
>

具体例子:llever.com | 源文件


2. 使用rawcss,使用 css 内容(主要是修复< >符号的转义问题)

{{< rawcss >}}.blog-post > h2:first-child {display:none}{{< /rawcss >}}

具体例子: llever.com | 源文件

3. 单文件页面,添加独有的 css 文件

可通过css来完成,点击以下例子

title: 'NES.css 任天堂风格css框架 Yummy'
date: 2018-12-06T12:23:36+08:00
categories: ['css']
tags: ['NES']
description: 'NES.css 任天堂风格css框架'
css: # 当你输入这个字段,会覆盖掉默认css文件
  [
    '/css/main.css', # 这个就是默认,只在博文页面 css文件
    '/css/stylesheet.css'  # 这个用来存有主页与博文,相同的css格式的文件
    'https://unpkg.com/[email protected]/css/nes.min.css',
  ]

网页可看:css 格式添加说明

注意 ⚠️:若你的baseURL不是根目录,留心'/css/main.css'的前路径。看看具体操作

4. series系列博文

series: "我是系列博文哦"

具体操作可看llever.com,与 js 脚本

5. 编辑按钮

    githubRepo = "https://github.com/chinanf-boy/html-css-list"
    editBtn = true

githubRepoeditBtn 要一起使用,才能发挥作用。

6. 复制代码

    copyCode = true

7. h*元素的 anchor

    anchorLink = "" # 可以自己改为喜欢的字符

常见问题

0. : 想加其他统计脚本?

关于百度的统计工具,因为我很少用,若有需要可添加到footer.html,再加个配置config.toml可控私人 ID,就好,等你 PR 噢

1. : 我 想正常添加,更多目录

[params]
    menus = true

[[menu.main]]
name = "分类"
url = "/categories/"

[[menu.main]]
name = "标签"
url = "/tags"

[[menu.main]]
  name = "Home"
  url = "/"
  # weight = 10
# 这个权重,是衡量顺序的

提示:main 的 html 顺序是相反的, 若想自定义顺序,添加 权重值

2. : 我 想单页面的 Home 按钮去除

[params]
    single = false

3. : 我要最终输出文件的baseURL配置,不是根目录,但我又想用开发服务器

答:那么你就有两个命令

  • 一是 hugo -b "/",构建静态文件(输入-b选项,换网址)命令;
  • 二是 hugo server -D 开发服务器命令

警告 ⚠️: baseURL一定要有/结尾。

本主题来源

是由basics hugo 主题, 拿来改的

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].