Allow single pages (#35)
* Let users create single sites * Create shortcodes for bulma (sub)titles * Support sidebar in singlepages only * Fix shortcodes according to the bulma doc * Use h5 tag for is-5 class
This commit is contained in:
29
layouts/_default/single.html
Normal file
29
layouts/_default/single.html
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="{{ .Site.LanguageCode }}">
|
||||||
|
<head>
|
||||||
|
{{ partial "meta.html" . }}
|
||||||
|
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
|
||||||
|
{{ partial "css.html" . }}
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- Preloader -->
|
||||||
|
<div id="preloader">
|
||||||
|
<div id="status"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{ block "main" . }}
|
||||||
|
|
||||||
|
{{ partial "single/single.html" . }}
|
||||||
|
|
||||||
|
<!-- Back To Top Button -->
|
||||||
|
<div id="backtotop"><a href="#"></a></div>
|
||||||
|
|
||||||
|
{{ if .Params.sidebar }}
|
||||||
|
{{ partial "single/sidebar.html" . }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ partial "javascript.html" . }}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
{{- $navbar := .Site.Params.navbar }}
|
{{- $navbar := .Site.Params.navbar }}
|
||||||
{{- $sidebarVisible := .Site.Params.sidebar }}
|
{{- $sidebarVisible := .Site.Params.sidebar }}
|
||||||
|
{{ if .Params.sidebar }}
|
||||||
|
{{ $sidebarVisible = .Params.sidebar }}
|
||||||
|
{{ end }}
|
||||||
{{- $navbarLogo := .Site.Params.navbarlogo }}
|
{{- $navbarLogo := .Site.Params.navbarlogo }}
|
||||||
<nav id="navbar-clone" class="navbar is-fresh is-transparent" role="navigation" aria-label="main navigation">
|
<nav id="navbar-clone" class="navbar is-fresh is-transparent" role="navigation" aria-label="main navigation">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
{{- $navbar := .Site.Params.navbar }}
|
{{- $navbar := .Site.Params.navbar }}
|
||||||
{{- $sidebarVisible := .Site.Params.sidebar }}
|
{{- $sidebarVisible := .Site.Params.sidebar }}
|
||||||
|
{{ if .Params.sidebar }}
|
||||||
|
{{ $sidebarVisible = .Params.sidebar }}
|
||||||
|
{{ end }}
|
||||||
{{- $navbarLogo := .Site.Params.navbarlogo }}
|
{{- $navbarLogo := .Site.Params.navbarlogo }}
|
||||||
<nav class="navbar is-fresh is-transparent no-shadow" role="navigation" aria-label="main navigation">
|
<nav class="navbar is-fresh is-transparent no-shadow" role="navigation" aria-label="main navigation">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
12
layouts/partials/single/content.html
Normal file
12
layouts/partials/single/content.html
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<section class="section is-medium">
|
||||||
|
<div class="container">
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column is-centered-tablet-portrait">
|
||||||
|
<h1 class="title section-title">{{ .Title }}</h1>
|
||||||
|
<h5 class="subtitle is-5 is-muted">{{ .Params.Subtitle }}</h5>
|
||||||
|
<div class="divider"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ .Content }}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
20
layouts/partials/single/sidebar.html
Normal file
20
layouts/partials/single/sidebar.html
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{{- $logo := .Params.sidebarlogo }}
|
||||||
|
<div class="sidebar">
|
||||||
|
<div class="sidebar-header">
|
||||||
|
<img src="{{ printf "/images/logos/%s.svg" $logo | relURL }}">
|
||||||
|
<a class="sidebar-close" href="javascript:void(0);">
|
||||||
|
<i data-feather="x"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="inner">
|
||||||
|
<ul class="sidebar-menu">
|
||||||
|
{{ range where .Site.RegularPages "Section" (strings.TrimSuffix "/" .Dir) }}
|
||||||
|
<li>
|
||||||
|
<a href="{{ .URL }}">
|
||||||
|
{{ .Title }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
3
layouts/partials/single/single.html
Normal file
3
layouts/partials/single/single.html
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{{ partial "navbar.html" . }}
|
||||||
|
{{ partial "navbar-clone.html" . }}
|
||||||
|
{{ partial "single/content.html" . }}
|
||||||
1
layouts/shortcodes/subtitle1.html
Normal file
1
layouts/shortcodes/subtitle1.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<h1 class="subtitle is-1">{{ .Get 0 }}</h1>
|
||||||
1
layouts/shortcodes/subtitle2.html
Normal file
1
layouts/shortcodes/subtitle2.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<h2 class="subtitle is-2">{{ .Get 0 }}</h2>
|
||||||
1
layouts/shortcodes/subtitle3.html
Normal file
1
layouts/shortcodes/subtitle3.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<h3 class="subtitle is-3">{{ .Get 0 }}</h3>
|
||||||
1
layouts/shortcodes/subtitle4.html
Normal file
1
layouts/shortcodes/subtitle4.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<h4 class="subtitle is-4">{{ .Get 0 }}</h4>
|
||||||
1
layouts/shortcodes/subtitle5.html
Normal file
1
layouts/shortcodes/subtitle5.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<h5 class="subtitle is-5">{{ .Get 0 }}</h5>
|
||||||
1
layouts/shortcodes/subtitle6.html
Normal file
1
layouts/shortcodes/subtitle6.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<h6 class="subtitle is-6">{{ .Get 0 }}</h6>
|
||||||
1
layouts/shortcodes/title1.html
Normal file
1
layouts/shortcodes/title1.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<h1 class="title is-1">{{ .Get 0 }}</h1>
|
||||||
1
layouts/shortcodes/title2.html
Normal file
1
layouts/shortcodes/title2.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<h2 class="title is-2">{{ .Get 0 }}</h2>
|
||||||
1
layouts/shortcodes/title3.html
Normal file
1
layouts/shortcodes/title3.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<h3 class="title is-3">{{ .Get 0 }}</h3>
|
||||||
1
layouts/shortcodes/title4.html
Normal file
1
layouts/shortcodes/title4.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<h4 class="title is-4">{{ .Get 0 }}</h4>
|
||||||
1
layouts/shortcodes/title5.html
Normal file
1
layouts/shortcodes/title5.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<h5 class="title is-5">{{ .Get 0 }}</h5>
|
||||||
1
layouts/shortcodes/title6.html
Normal file
1
layouts/shortcodes/title6.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<h6 class="title is-6">{{ .Get 0 }}</h6>
|
||||||
Reference in New Issue
Block a user