Creating a New Theme

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. Then we’ll add in a few pages and posts. With small variations on that, you will be able to create many different types of web sites. In this tutorial, commands that you enter will start with the “$” prompt. The output will follow. Lines that start with “#” are comments that I’ve added to explain a point. When I show updates to a file, the “:wq” on the last line means to save the file.……

Continue reading

Migrate to Hugo from Jekyll

Move static content to static Jekyll has a rule that any directory not starting with _ will be copied as-is to the _site output. Hugo keeps all static content under static. You should therefore move it all there. With Jekyll, something that looked like ▾ <root>/ ▾ images/ logo.png should become ▾ <root>/ ▾ static/ ▾ images/ logo.png Additionally, you’ll want any files that should reside at the root (such as CNAME) to be moved to static. Create your Hugo configuration file Hugo can read your configuration as JSON, YAML or TOML. Hugo supports parameters custom configuration too. Refer to the Hugo configuration documentation for details. Set your configuration publish folder to _site The default is for Jekyll to publish to _site and for Hugo to publish to public. If, like me, you have _site mapped to a git submodule on the gh-pages branch, you’ll want to do one of two alternatives:……

Continue reading

必知必会的22种设计模式(GO语言)

日常工作中免不了使用设计模式,那么你使用了哪些设计模式呢? 设计模式是什么? 设计模式是一种在软件设计中对常见问题的通用解决方案。 它们是经过验证的、可重用的设计思想,可以帮助解决开发过程中遇到的各种问题。 设计模式提供了一种共同的词汇表和方法论,让不同团队的开发人员能够更有效地沟通和协……

Continue reading

我们要不要使用 ORM?

本次主要来聊聊关于 ORM 的内容,欢迎评论交流,欢迎批评指正 分别从如下 4 个方面来展开 ORM 他是个啥? 为什么要用 ORM? ORM 给我们带来了哪些问题? 如何去考虑是否要使用 ORM? ORM 他是个啥? 一提到 ORM 很多同学知道他是跟数据库相关的一个内容,但是并不清楚他到底是这个啥,自己需不需要,到底怎么玩? 实际上……

Continue reading

Go 语言中 panic 和 recover 搭配使用

本次主要聊聊 Go 语言中关于 panic 和 recover 搭配使用 ,以及 panic 的基本原理 最近工作中审查代码的时候发现一段代码,类似于如下这样,将 recover 放到一个子协程里面,期望去捕获主协程的程序异常 看到此处,是否会想这段代码在项目中是想当然写出来的吧,然而平日中,大多问题是出现在认知偏差上,那么本次,我们就来消除一下……

Continue reading

Go 语言中的反射

今天主要来聊聊 Go 语言中反射,希望对你有新的认知 虽然很多人使用 Go 语言有一定时间了,甚至有的使用了 1 年 2 年,然后对于 Go 语言中的反射还是模棱两可,使用起来的时候,心里也不是非常有底气 更有甚者,几乎不使用反射,当然,也不是什么错,在工作中能用最简单最高效,又可扩展,性能还好的方式来进行处……

Continue reading

Go 语言切片扩容规则是扩容2倍?1.25倍?到底几倍

本次主要来聊聊关于切片的扩容是如何扩的,还请大佬们不吝赐教 切片,相信大家用了 Go 语言那么久这这种数据类型并不陌生,但是平日里聊到关于切片是如何扩容的,很多人可能会张口就来,切片扩容的时候,如果老切片的容量小于 1024 那么就再扩容 1倍,也就是新的切片容量是老切片容量的两倍,同理,如果老切片……

Continue reading

团队变动,裁员 ,拿股权,年底降薪,微信接入 ChatGPT 我都经历了,仍然要往云原生方向进发!!

年底,又是一个总结过去和展望未来的时刻,在病痛交加的周六,捂着被子,拿着手机回顾我这时而平凡时而精彩的 2022,回望本年,又是没有财务自由的一年,团队变动,裁员,年底降薪,拿股权,健身,小刀刮喉咙,见她的父母,今年都经历个遍 对于财务自由。这个词相信兄弟们并不陌生,但每个人对财务自……

Continue reading

何必卷 AI

一天,小明要写一篇论文,但是他遇到了一个问题:他期望有这么一个软件可以智能精准回复,能进行训练,还能帮忙处理数据。于是他开始寻找解决方案。 可以使用最近很火很卷的 chatgpt 呀,于是简单搜索并了解了一下 什么是 chatgpt 什么是 chatgpt Chatgpt 是一种基于自然语言处理技术的智能聊天系统。它可以自动理解用户输入的文本,……

Continue reading

我的个人微信迅速接入了chatgpt

本文主要来聊聊如何快速使用个人微信接入 ChatGPT,欢迎 xdm 尝试起来,仅供学习参考,切莫用于做不正当的事情 关于 ChatGPT 我们每个人都可以简单的使用上,不需要你有很强的技术背景,不需要你有公众号,甚至不需要你自己接入,只要你有一个微信号,就可以享受到 ChatGPT 带给你的惊喜,那么我们开始吧 本文分别从……

Continue reading