Foreword
I went a long long walk today, approximately 21km and took me 6.7 hours. The weather today was just so great. Recently, I noticed that if the article I posted only has the techicial contents, that might be a bit boring. The whole keep posting thing is for me to be motivated, so I decided that I need to write down some thoughts ahead or behind the article, to make it more human.
What’s my thoughts about YAML before learning it.
I have had much knowledge about yaml before I tried to post on github Page. I am currently using the hexo framework, organizing my blogs, and inside the folder, there’s one .yaml file owns a lot of settings we can play around.
Lecture
https://www.youtube.com/watch?v=cdLNKUoMc6c&t=2s
YAML is a
data_serializationlanguage, which means it’s basically just used to store information about different things
- We can use yaml to define
key-valuepairs. - Very similar to
JSON, but YAML focusing onreadabilityand user friendiness
Format
.yml.yaml
comment in YAML
1 | # This won't be executed in yaml |
key-value example in yaml
1 | person: |
The way that we can define scope inside of yaml is with indentation(
tab).
- With
>before a bunch of text,yamlwill render the text in a single line. - With
|, this will preserve the format correctly. &as an anchor mark,*to call that anchor value&anchor mark can also anchor a entirekey-value, the example&base!!floatcan force int to float, changing the type