diff --git a/assets/scss/style.scss b/assets/scss/style.scss index d653ee2..6d622d5 100644 --- a/assets/scss/style.scss +++ b/assets/scss/style.scss @@ -18,6 +18,21 @@ } } +.site-main { + display: flex; + min-height: 100vh; + flex-direction: column; + align-items: start; + justify-content: space-between; + max-width: 400px; + margin: auto; + font-size: 1.5rem; + + @media (max-width: 448px) { + margin-left: 24px; + } +} + #home-center { display: flex; flex-direction: column; @@ -51,6 +66,8 @@ } #home-footer { + width: 100%; + p { color: #5C5C5C; font-family: Inter; diff --git a/content/about.tr.md b/content/about.md similarity index 100% rename from content/about.tr.md rename to content/about.md diff --git a/content/posts/goisforlovers.md b/content/posts/goisforlovers.md new file mode 100644 index 0000000..76668cd --- /dev/null +++ b/content/posts/goisforlovers.md @@ -0,0 +1,339 @@ ++++ +title = "Yazmak Güzeldir" +tags = [ + "go", + "golang", + "templates", + "themes", + "development", +] +date = "2014-04-02" +toc = true ++++ + +Hugo uses the excellent [Go][] [html/template][gohtmltemplate] library for +its template engine. It is an extremely lightweight engine that provides a very +small amount of logic. In our experience that it is just the right amount of +logic to be able to create a good static website. If you have used other +template systems from different languages or frameworks you will find a lot of +similarities in Go templates. + +This document is a brief primer on using Go templates. The [Go docs][gohtmltemplate] +provide more details. + +## Introduction to Go Templates + +Go templates provide an extremely simple template language. It adheres to the +belief that only the most basic of logic belongs in the template or view layer. +One consequence of this simplicity is that Go templates parse very quickly. + +A unique characteristic of Go templates is they are content aware. Variables and +content will be sanitized depending on the context of where they are used. More +details can be found in the [Go docs][gohtmltemplate]. + +## Basic Syntax + +Golang templates are HTML files with the addition of variables and +functions. + +**Go variables and functions are accessible within {{ }}** + +Accessing a predefined variable "foo": + + {{ foo }} + +**Parameters are separated using spaces** + +Calling the add function with input of 1, 2: + + {{ add 1 2 }} + +**Methods and fields are accessed via dot notation** + +Accessing the Page Parameter "bar" + + {{ .Params.bar }} + +**Parentheses can be used to group items together** + + {{ if or (isset .Params "alt") (isset .Params "caption") }} Caption {{ end }} + + +## Variables + +Each Go template has a struct (object) made available to it. In hugo each +template is passed either a page or a node struct depending on which type of +page you are rendering. More details are available on the +[variables](/layout/variables) page. + +A variable is accessed by referencing the variable name. + +