add code highlighting and bookmark shortcode

master
David Kebler 2017-04-03 11:39:23 -07:00
parent a41d9cf8ff
commit 63289cbc53
12 changed files with 56 additions and 23 deletions

View File

@ -4,6 +4,8 @@
<link href="https://cdn.jsdelivr.net/lightgallery/1.3.9/css/lg-transitions.min.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/lightgallery/1.3.9/css/lg-transitions.min.css" rel="stylesheet">
<!-- Modal--> <!-- Modal-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.8.0/jquery.modal.min.css" type="text/css" media="screen" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.8.0/jquery.modal.min.css" type="text/css" media="screen" />
<!-- highlights -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/styles/default.min.css">
<!-- Site Base CSS --> <!-- Site Base CSS -->
<link href="/css/base.css" rel="stylesheet"> <link href="/css/base.css" rel="stylesheet">

View File

@ -3,6 +3,9 @@
<!-- base font --> <!-- base font -->
<link href="//fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css"> <link href="//fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css">
<!-- monospaced for code -->
<link href="//fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css">
<!-- Configurable Fonts --> <!-- Configurable Fonts -->
{{ with .Site.Params }} {{ with .Site.Params }}

View File

@ -5,6 +5,8 @@
<script src="https://cdn.jsdelivr.net/g/lightgallery,lg-autoplay,lg-pager,lg-thumbnail,lg-video"></script> <script src="https://cdn.jsdelivr.net/g/lightgallery,lg-autoplay,lg-pager,lg-thumbnail,lg-video"></script>
<!-- modal --> <!-- modal -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.8.0/jquery.modal.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.8.0/jquery.modal.min.js"></script>
<!-- highlights -->
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/highlight.min.js"></script>
<!-- LOCAL --> <!-- LOCAL -->

View File

@ -11,7 +11,7 @@
{{ if ne .Params.navbar false }} {{ if ne .Params.navbar false }}
{{ if ne .Params.hidden true }} {{ if ne .Params.hidden true }}
<li class="nav-bar__menu-item"> <li class="nav-bar__menu-item">
<a href="#{{ .File.BaseFileName }}"> <a href="#nav-{{ .File.BaseFileName }}">
{{ .Params.link_text | default .Title }} {{ .Params.link_text | default .Title }}
</a> </a>
</li> </li>

View File

@ -1,7 +1,7 @@
<!-- Renders Section Based on Content --> <!-- Renders Section Based on Content -->
{{ $parity := "odd" }} {{ range $i, $e := .Data.Pages }} {{ $parity := "odd" }} {{ range $i, $e := .Data.Pages }}
{{ if ne .Params.hidden true }} {{ if ne .Params.hidden true }}
<section id="{{ .File.BaseFileName }}" class="section section--{{ .File.BaseFileName }} section--{{ if modBool $i 2 }}odd{{ else }}even{{ end }}"> <section id="nav-{{ .File.BaseFileName }}" class="section section--{{ .File.BaseFileName }} section--{{ if modBool $i 2 }}odd{{ else }}even{{ end }}">
<div class="section__container"> <div class="section__container">
<div class="section__headline section__headline--{{ .File.BaseFileName }}"> <div class="section__headline section__headline--{{ .File.BaseFileName }}">
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>

View File

@ -0,0 +1,6 @@
{{ $numOfParams := ( len .Params ) }}
{{ if eq $numOfParams 1 }} <span name="{{ .Get 0 }}">{{ .Get 0 }}</span> {{ end }}
{{ if eq $numOfParams 2 }} <span name="{{ .Get 0 }}">{{ .Get 1 }}</span> {{ end }}
{{ if eq $numOfParams 3 }}
<span name="{{ .Get 0 }}" {{ if (.Get 2) "hide" }}class="invisible"{{ end }}>{{ .Get 1 }}</span>
{{ end }}

View File

@ -1,4 +1,4 @@
<!-- parameter map url --> <!-- Used for embedding iframes from sites like youtube and google -->
{{ if .IsNamedParams }} {{ if .IsNamedParams }}
<div class="box box--{{ .Get "type" }}"> <div class="box box--{{ .Get "type" }}">
{{ with .Get "title" }} {{ with .Get "title" }}

View File

@ -1,10 +0,0 @@
<div class="list">
<ul>
{{ range .Params }}
<li>
{{ . }}
</li>
{{ end }}
</ul>
</div>

View File

@ -1,6 +1,6 @@
{{ range .Site.Params.social }} {{ range .Site.Params.social }}
<li> <li>
<a href="{{ .url }}" class="btn btn-default btn-lg"> <a href="{{ .url }}" class="btn btn--round btn--large">
<i class="fa fa-{{ .icon }} fa-fw"></i> <i class="fa fa-{{ .icon }} fa-fw"></i>
<span class="network-name">{{ .title }}</span> <span class="network-name">{{ .title }}</span>
</a> </a>

View File

@ -174,10 +174,6 @@ hr {
justify-content: flex-start; justify-content: flex-start;
} }
.hide {
visibility: hidden;
}
.text-center p { .text-center p {
text-align: center; text-align: center;
} }
@ -189,3 +185,19 @@ hr {
.text-right p { .text-right p {
text-align: right; text-align: right;
} }
/* keeps in the DOM but moves from the page */
.invisible {
position: absolute;
left: -999em;
}
/*keeps in the same location and maintains it's layout space even though hidden*/
.hide {
visibility: hidden;
}
/*completely removes from DOM */
.remove {
display: none;
}

View File

@ -104,6 +104,7 @@
flex-flow: wrap; flex-flow: wrap;
align-content: center; align-content: center;
justify-content: center; justify-content: center;
padding-bottom: 0.5em;
} }
.box--column { .box--column {
@ -146,6 +147,11 @@
font-size: 3rem; font-size: 3rem;
} }
.btn--circle {
border-radius: 50%;
padding: 0.5em;
}
.box--avatar > img, .box--avatar > img,
img.avatar { img.avatar {
object-fit: cover; object-fit: cover;
@ -169,7 +175,6 @@ img.avatar {
} }
.box__caption { .box__caption {
padding-bottom: .75em;
text-transform: capitalize; text-transform: capitalize;
font-style: italic; font-style: italic;
} }
@ -213,12 +218,25 @@ font-style: italic;
code { code {
font-size: 0.8em; font-size: 0.8em;
background-color: grey; font-family: Inconsolata;
background-color: dimgrey;
border-radius: 0.2em; border-radius: 0.2em;
color: white; color: white;
padding-left: 0.2em; padding-left: 0.2em;
padding-right: 0.2em; padding-right: 0.2em;
padding-top: 0.05em; padding-top: 0.05em;
padding-bottom: 0.05em; padding-bottom: 0.05em;
}
code.hljs {
font-size: .75em;
border-radius: 0.2em;
background-color: dimgrey;
color: white;
padding: 1em;
margin-bottom: 0.7em;
width: inherit;
max-width: 90vw;
border-width: 10px;
border-color: blue;
} }

View File

@ -5,7 +5,7 @@ $(document).ready(function () {
heroResize(); heroResize();
itemResize('iframe'); itemResize('iframe');
typeResize(); // for section content typeResize(); // for section content
hljs.initHighlightingOnLoad();
// resize elements on change // resize elements on change
$(window).resize(function () { $(window).resize(function () {
heroResize(); heroResize();
@ -13,4 +13,4 @@ $(document).ready(function () {
typeResize(); typeResize();
}); });
}); });;