Initial work for single pages.

This commit is contained in:
Mateusz Hromada 2018-06-07 14:28:01 +02:00
parent 6747ff4d5f
commit 95f580911c
9 changed files with 252 additions and 4 deletions

BIN
layouts/.index.html.swp Normal file

Binary file not shown.

View File

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="pl">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>
{{ block "title" . }}
{{ .Title}}{{ if ne .Title .Site.Title }} | {{ .Site.Title }}{{ end }}
{{ end }}
</title>
<link rel="stylesheet" href="https://static.wmi.amu.edu.pl/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/labs.css">
</head>
<body>
{{ block "navbar" . }}
{{ partial "navbar" . }}
{{ end }}
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar">
{{ block "sidebar" . }}
{{ partial "sidebar" . }}
{{ end }}
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
{{ block "main" . }}
{{ end }}
</div>
</div>
</div>
<script src="https://static.wmi.amu.edu.pl/jquery/1.12.4/jquery.min.js"></script>
<script src="https://static.wmi.amu.edu.pl/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="/js/fix.js"></script>
</body>
</html>

View File

@ -0,0 +1,13 @@
{{ define "main" }}
{{ .Content }}
{{ if .IsTranslated }}
<h4>{{ i18n "translations" }}</h4>
<ul>
{{ range .Translations }}
<li>
<a href="{{ .RelPermalink }}">{{ .Lang }}: {{ .Title }}</a>
</li>
{{ end }}
</ul>
{{ end }}
{{ end }}

View File

@ -0,0 +1,13 @@
{{ define "main" }}
<h1>{{ .Site.Title }}</h1>
<div class="row">
<div class="col-sm-9">
{{ block "news" . }}
{{ end }}
</div>
<div class="col-sm-3">
{{ .Content }}
</div>
</div>
{{ end }}

View File

@ -0,0 +1,31 @@
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle sidebar-toggle" data-toggle="sidebar">
<span class="sr-only">Toggle sidebar</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">
{{ .Site.Title }}
</a>
</div>
<div class="collapse navbar-collapse">
<form class="navbar-form navbar-right" action="https://szukaj.wmi.amu.edu.pl/search/" method="GET">
<div class="input-group">
<input type="text" class="form-control" name="q" placeholder="Search">
<span class="input-group-btn">
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
</span>
</div>
</form>
</div>
</div>
</div>

View File

@ -0,0 +1,16 @@
{{ $currentPage := . }}
<ul>
{{ range .Site.Menus.main }}
{{ if .HasChildren }}
<li class="item {{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}"><a href="{{ .URL }}">{{ .Name }}</a>
{{ if or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .) }}
<ul>
{{ range .Children }}
<li class="sub-item{{ if $currentPage.IsMenuCurrent "main" . }} active{{ end }}"><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
{{ end }}
</ul>

139
static/css/labs.css Normal file
View File

@ -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;
}

1
static/js/fix.js Normal file
View File

@ -0,0 +1 @@
$(function() { $('table').addClass('table table-striped'); })

View File

@ -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]