diff options
author | Felix Boerner <ich@felix-boerner.de> | 2018-05-26 16:41:32 +0300 |
---|---|---|
committer | Felix Boerner <ich@felix-boerner.de> | 2018-05-26 16:41:32 +0300 |
commit | 3b690067c30f90e4ae11e5ced6739389b6147c5d (patch) | |
tree | 94bc3896285b3ed5dc072e1a7cb7435eaf4df29b | |
parent | 544a5a4bb7aef4589770faacdd15d6caa58bd615 (diff) |
feat: add possibility to create pages
-rw-r--r-- | README.md | 49 | ||||
-rw-r--r-- | exampleSite/config.toml | 6 | ||||
-rw-r--r-- | exampleSite/content/_index.md | 6 | ||||
-rw-r--r-- | exampleSite/content/ipsum-in.md | 5 | ||||
-rw-r--r-- | exampleSite/content/luctus-urna.md | 5 | ||||
-rw-r--r-- | exampleSite/content/purus-sem.md | 5 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 46 | ||||
-rw-r--r-- | layouts/_default/list.html | 3 | ||||
-rw-r--r-- | layouts/_default/single.html | 3 | ||||
-rw-r--r-- | layouts/index.html | 53 | ||||
-rw-r--r-- | layouts/partials/bio.html | 4 | ||||
-rw-r--r-- | layouts/partials/intro.html | 4 |
12 files changed, 119 insertions, 70 deletions
@@ -27,6 +27,43 @@ After installing the Split theme successfully it requires a just a few more step Take a look inside the [`exampleSite`](//github.com/escalate/hugo-split-theme/tree/master/exampleSite) folder of this theme. You'll find a file called [`config.toml`](//github.com/escalate/hugo-split-theme/blob/master/exampleSite/config.toml). To use it, copy the [`config.toml`](//github.com/escalate/hugo-split-theme/blob/master/exampleSite/config.toml) in the root folder of your Hugo site. Feel free to customize this theme as you like. +### Add content + +#### Homepage + +Add a file named `_index.md` inside content directory to create your homepage. Use TOML configuration elements to set `title` and `tagline` of your page. Simple write your content in markdown style. + + + $ hugo new content/_index.md + + +```toml ++++ +title = "Jenny Jones" +tagline = "Designer. Stylist. Nomad." ++++ + +Donec at libero id lectus porta dapibus eu in nibh. Cras id mauris sapien. Fusce viverra [luctus urna]({{< ref "luctus-urna.md" >}}) ac rutrum. Duis semper elit eu mi facilisis eleifend. Donec semper, [ipsum in]({{< ref "ipsum-in.md" >}}) malesuada congue, [purus sem]({{< ref "purus-sem.md" >}}) ullamcorper massa, sit amet lacinia nibh enim sed massa. +``` + + +#### Additional pages + +You can create additional pages as usual inside content directory. + + + $ hugo new content/luctus-urna.md + + +```toml ++++ +title = "luctus urna" ++++ + +Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. +``` + + ### Use an image Set `enable` to `true`. Add your image to the `static` folder and change `file` to the location of your image accordingly. By default the image position is centered, however you can specify your own by supplying `position` with a valid CSS position. @@ -82,18 +119,6 @@ Get the ID of the YouTube video and add it to `youtubeId`. Make sure you delete Set `mute` to `true` if you want the video to play muted and `false` if you want the sound. The video is coded to autoplay and loop. If you want to change that the code can be found in [`layouts/partials/video.html`](//github.com/escalate/hugo-split-theme/tree/master/layouts/partials/video.html). -### Add content - -`name`, `tagline` and `bio` corresponds to their respective text in the content section. Use markdown in `bio` to add any links. - -```toml -[params.content] - name = "Jenny Jones" - tagline = "Designer. Stylist. Nomad." - bio = "Donec at libero id lectus porta dapibus eu in nibh. Cras id mauris sapien. Fusce viverra [luctus urna](#) ac rutrum. Duis semper elit eu mi facilisis eleifend. Donec semper, [ipsum in](#) malesuada congue, [purus sem](#) ullamcorper massa, sit amet lacinia nibh enim sed massa." -``` - - ### Add links You can have up to 3 column lists in the links section. `heading` is the list heading text. For the text links `text` is the link text and `url` is the link url. Follow the same snippet structure to add more links to a list. If you only want 1 or 2 lists, just remove the link list snippet you don't want. diff --git a/exampleSite/config.toml b/exampleSite/config.toml index a7a2513..8d0cca7 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -22,12 +22,6 @@ copyright = "©2018 Your Name" # Favicon favicon = "favicon.ico" - # Section - Content - [params.content] - name = "Jenny Jones" - tagline = "Designer. Stylist. Nomad." - bio = "Donec at libero id lectus porta dapibus eu in nibh. Cras id mauris sapien. Fusce viverra [luctus urna](#) ac rutrum. Duis semper elit eu mi facilisis eleifend. Donec semper, [ipsum in](#) malesuada congue, [purus sem](#) ullamcorper massa, sit amet lacinia nibh enim sed massa." - # Section - Visual [params.visual] diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md new file mode 100644 index 0000000..aabe3b3 --- /dev/null +++ b/exampleSite/content/_index.md @@ -0,0 +1,6 @@ ++++ +title = "Jenny Jones" +tagline = "Designer. Stylist. Nomad." ++++ + +Donec at libero id lectus porta dapibus eu in nibh. Cras id mauris sapien. Fusce viverra [luctus urna]({{< ref "luctus-urna.md" >}}) ac rutrum. Duis semper elit eu mi facilisis eleifend. Donec semper, [ipsum in]({{< ref "ipsum-in.md" >}}) malesuada congue, [purus sem]({{< ref "purus-sem.md" >}}) ullamcorper massa, sit amet lacinia nibh enim sed massa. diff --git a/exampleSite/content/ipsum-in.md b/exampleSite/content/ipsum-in.md new file mode 100644 index 0000000..300fa9a --- /dev/null +++ b/exampleSite/content/ipsum-in.md @@ -0,0 +1,5 @@ ++++ +title = "ipsum in" ++++ + +Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam, nisi quis porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis orci. diff --git a/exampleSite/content/luctus-urna.md b/exampleSite/content/luctus-urna.md new file mode 100644 index 0000000..95c6c86 --- /dev/null +++ b/exampleSite/content/luctus-urna.md @@ -0,0 +1,5 @@ ++++ +title = "luctus urna" ++++ + +Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. diff --git a/exampleSite/content/purus-sem.md b/exampleSite/content/purus-sem.md new file mode 100644 index 0000000..fb71313 --- /dev/null +++ b/exampleSite/content/purus-sem.md @@ -0,0 +1,5 @@ ++++ +title = "purus sem" ++++ + +Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..b734a0c --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,46 @@ +<!DOCTYPE html> +<html lang="{{ default .Site.LanguageCode "en-US" }}"> + +<head> + {{ partial "head" . }} +</head> + +<body id="fullsingle" class="page-template-page-fullsingle-split"> + + <div class="fs-split"> + + <!-- Image --> + {{ if .Site.Params.visual.image.enable }} + + <div class="split-image"> + + </div> + + <!-- Video --> + {{ else if .Site.Params.visual.video.enable }} + + {{ partial "video" . }} + + {{ end }} + + <!-- Content Side --> + <div class="split-content"> + <div class="split-content-vertically-center"> + <!-- Intro --> + {{ partial "intro" . }} + + <!-- Main --> + {{ block "main" . }} + <!-- Bio --> + {{ partial "bio" . }} + {{ end }} + + <!-- Footer --> + {{ partial "footer" . }} + </div> + </div> + + </div> + +</body> +</html> diff --git a/layouts/_default/list.html b/layouts/_default/list.html index e69de29..c897030 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -0,0 +1,3 @@ +{{ define "main" }} + +{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index e69de29..c897030 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -0,0 +1,3 @@ +{{ define "main" }} + +{{ end }} diff --git a/layouts/index.html b/layouts/index.html index 9a23946..2112abb 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,48 +1,7 @@ -<!DOCTYPE html> -<html lang="{{ default .Site.LanguageCode "en-US" }}"> +{{ define "main" }} + <!-- Bio --> + {{ partial "bio" . }} -<head> - {{ partial "head" . }} -</head> - -<body id="fullsingle" class="page-template-page-fullsingle-split"> - - <div class="fs-split"> - - <!-- Image --> - {{ if .Site.Params.visual.image.enable }} - - <div class="split-image"> - - </div> - - <!-- Video --> - {{ else if .Site.Params.visual.video.enable }} - - {{ partial "video" . }} - - {{ end }} - - <!-- Content Side --> - <div class="split-content"> - <div class="split-content-vertically-center"> - - <!-- Intro --> - {{ partial "intro" . }} - - <!-- Bio --> - {{ partial "bio" . }} - - <!-- Links --> - {{ partial "links" . }} - - <!-- Footer --> - {{ partial "footer" . }} - - </div> - </div> - - </div> - -</body> -</html> + <!-- Links --> + {{ partial "links" . }} +{{ end }} diff --git a/layouts/partials/bio.html b/layouts/partials/bio.html index e39e137..4ec2df3 100644 --- a/layouts/partials/bio.html +++ b/layouts/partials/bio.html @@ -1,5 +1,3 @@ -{{ if .Site.Params.content.bio }} <div class="split-bio"> - <p>{{ .Site.Params.content.bio | markdownify }}</p> + {{ .Content }} </div> -{{ end }} diff --git a/layouts/partials/intro.html b/layouts/partials/intro.html index dd15556..9d64ca9 100644 --- a/layouts/partials/intro.html +++ b/layouts/partials/intro.html @@ -1,4 +1,4 @@ <div class="split-intro"> - <h1>{{ .Site.Params.content.name }}</h1> - <span class="tagline">{{ .Site.Params.content.tagline }}</span> + {{ with .Title }}<h1>{{ . }}</h1>{{ end }} + {{ with .Params.tagline }}<span class="tagline">{{ . }}</span>{{ end }} </div> |