/images/avatar.png

科比:梦想的力量

那些起早努力的日子,那些熬夜的时光,那些你太累觉得站不起来却依然之城自己起身得夜晚,那才是梦想的力量,重要的不是结果,是过程,也许你的梦想不会实现,但是更好的一定在路上。kobe

kobe.jpg

You do the work

如果你付出努力

you work hard enough

足够努力

dreams come true

梦想会实现

you know that

你知道这个道理

that we all know that

我们都知道这个道理

But hopefully would you get from tonight?

但是希望你你们今晚能明白的是

Is your standing that?

你们能感悟到

Those times when you get up early and

那些你早早起来的时刻

you work hard

你努力付出

Those times you stay up late and you work hard

那些你努力到晚上很迟,努力付出

Those times when you don’t feel like working

那些你不想努力的时刻

you’re too tired

你太累了

You don’t wanna push yourself

你不想再逼你自己

but you do it anyway

但你还是坚持努力了

That is actually the dream

这些时刻才是梦想本身

That’s the dream

这些时刻就是梦想

it’s not the destination, it’s the journey

梦想无关终点,关键在于过程

And if you guys can understand that

如果你们能明白这个道理

then what you’ll see happen is that

你们将看到

you won’t accomplish your dreams

你不能实现你的梦想

your dreams won’t come true

你的梦想不会成真

Something greater will

更伟大的梦想能实现

kobetalk

Hugo日常操作

hugo日常操作

新建文章

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 1.新建一篇文章,在网站根目录:G:\hugo\blog
hugo new posts/测试博客.md

# 2.在目录 G:\hugo\blog\content\posts下找到对应文件进行修改

# 3.本地预览, http://localhost:1313/

hugo server -D

# 4.构建 Hugo 网站(在blog目录)

hugo

# 5.切换到目录 H:\HugoWebsite\blog\public ,提交修改至本地库

cd public
git add .
git commit -m 'commit info'

# 6.将修改推至远程库

git push -u origin master

修改文章

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# 1.当前工作目录:G:\hugo\blog

# 2.在目录 G:\hugo\blog\content\posts下找到对应文件进行修改

# 3.本地预览, http://localhost:1313/ 

hugo server -D

# 4.构建 Hugo 网站(在blog目录)

hugo

# 5.切换到目录 G:\hugo\blog\public ,提交修改至本地库

cd public
git add .
git commit -m 'commit info'

# 6.将修改推至远程库

git push -u origin master

删除文章

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# 1.当前工作目录:G:\hugo\blog

# 2.删除两处文件(在目录 G:\hugo\blog\content\posts 、G:\hugo\blog\public  下找到对应文件进行删除),其中 public 下文件不删除也不影响显示,只是该文件就会一直存在,另外该目录下即便文件(除.git)删错或者全部删除也是不影响的,应为 hugo 命令会全部重建。

# 3.本地预览, http://localhost:1313/ 

hugo server -D

# 4.构建 Hugo 网站

hugo

# 5.切换到目录 H:\HugoWebsite\blog\public ,提交修改至本地库

cd public
git add .
git commit -m 'commit info'

# 6.将修改推至远程库

git push -u origin master

删除博客不完全导致文章不能正常显示

如果文章删除不完全,就再推送,导致文章页面出错,不能显示。这是删除此篇文章(posts和public下对应内容),再新建一篇即可正常显示。

hugo博文内增加图片

在文章中插入图片的方式有绝对路径和相对路劲两种,各有利弊,可以根据情况选择。

  • 把图片放到 static/()下,在文章中使用绝对路径引用图片
  • 把图片放到和文章同级目录下,通过相对路径引用图片

从最终效果来看,两种方法在构建后都能正确显示图片,但第一种方法的问题在于使用 hugo server -D预览时无法正确加载图片,第二种方法可以在预览时正确加载图片,但会导致 content/{{section}}/下多嵌套一层目录。 之所以把图片放到 static/下,是因为hugo在构建时会把 static/下所有内容移到 public/下。构建后 content/下的内容也会被移到 public/下,这样相当于文章和图片有共同的根目录,在文章中使用绝对引用即可正确显示图片。比如下面几张图。 202206070101.png

202206070102.png

202206070103.png

第二种方法是把图片和文章放在同级目录 content/{{section}}/{{article_name}}/,这样虽会显得 content/下略显冗余,但可以在预览或构建后都正确显示图片。