From 95f580911ce7e02695bf057a0fe6e737ea907bf5 Mon Sep 17 00:00:00 2001 From: Mateusz Hromada Date: Thu, 7 Jun 2018 14:28:01 +0200 Subject: [PATCH] Initial work for single pages. --- layouts/.index.html.swp | Bin 0 -> 12288 bytes layouts/_default/baseof.html | 35 +++++++++ layouts/_default/single.html | 13 ++++ layouts/index.html | 13 ++++ layouts/partials/navbar.html | 31 ++++++++ layouts/partials/sidebar.html | 16 ++++ static/css/labs.css | 139 ++++++++++++++++++++++++++++++++++ static/js/fix.js | 1 + theme.toml | 8 +- 9 files changed, 252 insertions(+), 4 deletions(-) create mode 100644 layouts/.index.html.swp create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/partials/navbar.html create mode 100644 layouts/partials/sidebar.html create mode 100644 static/css/labs.css create mode 100644 static/js/fix.js diff --git a/layouts/.index.html.swp b/layouts/.index.html.swp new file mode 100644 index 0000000000000000000000000000000000000000..84ae042b65df9041a43be75a3217fd81611711ee GIT binary patch literal 12288 zcmeI%y-ve05C`z18$B7Xo!q>v&CWZzQyGk4is({yE=OI{l1H?P< z08B80IMW~@MCl6XZ|UOZY~Lk6sYBKF(%#0VSn-#L#}v`s#Qc8cVTx|2iLyfKNV;u=>3w87^_F|!?bs@RC$@>=a?OCV#OX*K#99e2m9h3*pEn1&csKw6 literal 0 HcmV?d00001 diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..f16c2d2 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,35 @@ + + + + + + + {{ block "title" . }} + {{ .Title}}{{ if ne .Title .Site.Title }} | {{ .Site.Title }}{{ end }} + {{ end }} + + + + + + {{ block "navbar" . }} + {{ partial "navbar" . }} + {{ end }} +
+
+ +
+ {{ block "main" . }} + {{ end }} +
+
+
+ + + + + diff --git a/layouts/_default/single.html b/layouts/_default/single.html index e69de29..6420ccf 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -0,0 +1,13 @@ +{{ define "main" }} +{{ .Content }} +{{ if .IsTranslated }} +

{{ i18n "translations" }}

+ +{{ end }} +{{ end }} diff --git a/layouts/index.html b/layouts/index.html index e69de29..9a20a10 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -0,0 +1,13 @@ +{{ define "main" }} +

{{ .Site.Title }}

+
+
+ {{ block "news" . }} + {{ end }} +
+
+ {{ .Content }} +
+
+ +{{ end }} diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html new file mode 100644 index 0000000..0ffcae3 --- /dev/null +++ b/layouts/partials/navbar.html @@ -0,0 +1,31 @@ + diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html new file mode 100644 index 0000000..048389f --- /dev/null +++ b/layouts/partials/sidebar.html @@ -0,0 +1,16 @@ +{{ $currentPage := . }} +
    + {{ range .Site.Menus.main }} + {{ if .HasChildren }} +
  • {{ .Name }} + {{ if or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .) }} + + {{ end }} +
  • + {{ end }} + {{ end }} +
diff --git a/static/css/labs.css b/static/css/labs.css new file mode 100644 index 0000000..982495d --- /dev/null +++ b/static/css/labs.css @@ -0,0 +1,139 @@ +BODY { + padding-top: 50px; +} + +.sidebar-toggle { + float: left; + margin-left: 15px; +} + +.sidebar { + display: none; + position: fixed; + top: 51px; + bottom: 0; + left: 0; + z-index: 1050; + padding: 20px; + overflow-x: hidden; + overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ + background-color: #f8f8f8; + border-right: 1px solid #eee; +} +.sidebar.active { + display: block; +} +@media (min-width: 768px) { + .sidebar { + display: block; + } +} + +.sidebar ul { + list-style-type: none; + padding: 0; + background-color: #f8f8f8; +} + +.sidebar > ul { + margin-right: -21px; /* 20px padding + 1px border */ + margin-bottom: 20px; + margin-left: -20px; +} + +.sidebar a { + display: block; + padding: 10px 20px; + text-decoration: none; + color: #777; +} + +.sidebar .sub-item > a{ + padding-left: 40px; +} + +.sidebar .active > a { + color: #fff; + background-color: #428bca; +} + +.sidebar a:hover { + color: #555; + background-color: #eee; +} + +.main { + padding: 20px; +} +@media (min-width: 768px) { + .main { + padding-right: 40px; + padding-left: 40px; + } +} +.main .page-header { + margin-top: 0; +} + +.property-name { + font-weight: bold; +} +.bs-callout { + padding: 20px; + margin: 20px 0; + border: 1px solid #eee; + border-left-width: 5px; + border-radius: 3px; +} +.bs-callout:first-child { + margin-top: 0; +} +.bs-callout h4 { + margin-top: 0; + margin-bottom: 5px; +} +.bs-callout p:last-child { + margin-bottom: 0; +} +.bs-callout code { + border-radius: 3px; +} +.bs-callout+.bs-callout { + margin-top: -5px; +} +.bs-callout-default { + border-left-color: #777; +} +.bs-callout-default h4 { + color: #777; +} +.bs-callout-primary { + border-left-color: #428bca; +} +.bs-callout-primary h4 { + color: #428bca; +} +.bs-callout-success { + border-left-color: #5cb85c; +} +.bs-callout-success h4 { + color: #5cb85c; +} +.bs-callout-danger { + border-left-color: #d9534f; +} +.bs-callout-danger h4 { + color: #d9534f; +} +.bs-callout-warning { + border-left-color: #f0ad4e; +} +.bs-callout-warning h4 { + color: #f0ad4e; +} +.bs-callout-info { + border-left-color: #5bc0de; +} +.bs-callout-info h4 { + color: #5bc0de; +} diff --git a/static/js/fix.js b/static/js/fix.js new file mode 100644 index 0000000..0984977 --- /dev/null +++ b/static/js/fix.js @@ -0,0 +1 @@ +$(function() { $('table').addClass('table table-striped'); }) diff --git a/theme.toml b/theme.toml index 8f02ee7..d6b50c8 100644 --- a/theme.toml +++ b/theme.toml @@ -3,16 +3,16 @@ name = "Hugo Labs" license = "MIT" -licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE.md" +licenselink = "https://git.wmi.amu.edu.pl/labs/hugo-labs/raw/master/LICENSE" description = "" -homepage = "http://example.com/" +homepage = "https://laboratoria.wmi.amu.edu.pl" tags = [] features = [] min_version = "0.38" [author] - name = "" - homepage = "" + name = "Mateusz Hromada" + homepage = "https://blog.ruanda.pl" # If porting an existing theme [original]