常量 - (Constants)


Theme author

2 minute read

常量 Constants 定义常量 通过const关键字,可以定义一个常量,语法如下 const constantName [type]= value 在线抄写代码,运行,排查错误是高效学习Go的秘籍! code run online. package main import "fmt" import "math" // const declares a constant value. const s string = "constant" func main() { fmt.Println(s) // A const statement can appear anywhere a var // statement can. const n = 500000000 // Constant expressions perform arithmetic with // arbitrary precision. const d = 3e20 / n fmt.Println(d) // A numeric constant has no type until it’s given // one, such as by an explicit cast.

Creating a New Theme

Learn how to create a theme on Hugo

Theme author

35 minute read

Introduction This tutorial will show you how to create a simple theme in Hugo. I assume that you are familiar with HTML, the bash command line, and that you are comfortable using Markdown to format content. I’ll explain how Hugo uses templates and how you can organize your templates to create a theme. I won’t cover using CSS to style your theme. We’ll start with creating a new site with a very basic template.