mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
changed defaults + scroll with offset
This commit is contained in:
parent
f3e1970e59
commit
52e897dcb9
10 changed files with 33 additions and 32 deletions
|
@ -1,12 +1,11 @@
|
|||
- récriture doc -> TODO
|
||||
- créer une section Showcase
|
||||
- Menus déroulants icone -> TODO
|
||||
|
||||
- créer des jolis thèmes de base (avec des noms ou au moins de meilleures couleurs) -> DOING
|
||||
- Thème blue : OK
|
||||
- Thème red: OK
|
||||
- Theme green: OK
|
||||
- Menus déroulants icone -> TODO
|
||||
|
||||
|
||||
- Passer a Wercker -> OK
|
||||
- corriger le multilangue pour la recherche et les autres ressources statiques : OK
|
||||
- Section "MORE" -> OK
|
||||
|
|
|
@ -12,13 +12,7 @@ defaultContentLanguageInSubdir= true
|
|||
editURL = "https://github.com/matcornic/hugo-theme-learn/edit/master/docs/content/"
|
||||
description = "Documentation for Hugo Learn Theme"
|
||||
author = "Mathieu Cornic"
|
||||
disableSearch = false # default to false
|
||||
disableAssetBusting = false # default to false
|
||||
ordersectionsby = "weight" # ordersectionsby = "title"
|
||||
disableInlineCopyToClipBoard = true # default to false
|
||||
showVisitedLinks = true
|
||||
themeVariant = "red"
|
||||
enableShortcutsTitle = true
|
||||
|
||||
[outputs]
|
||||
home = [ "HTML", "RSS", "JSON"]
|
||||
|
@ -38,7 +32,7 @@ weight = 10
|
|||
|
||||
[[Languages.en.menu.shortcuts]]
|
||||
name = "<i class='fa fa-camera'></i> Showcases"
|
||||
url = "/showcase"
|
||||
url = "/en/showcase"
|
||||
weight = 11
|
||||
|
||||
[[Languages.en.menu.shortcuts]]
|
||||
|
@ -49,7 +43,7 @@ weight = 20
|
|||
|
||||
[[Languages.en.menu.shortcuts]]
|
||||
name = "<i class='fa fa-bullhorn'></i> Credits"
|
||||
url = "/credits"
|
||||
url = "/en/credits"
|
||||
weight = 30
|
||||
|
||||
[Languages.fr]
|
||||
|
|
|
@ -17,7 +17,7 @@ other = "Woops. Looks like this page doesn't exist ¯\\_(ツ)_/¯."
|
|||
other = "Go to homepage"
|
||||
|
||||
[Edit-this-page]
|
||||
other = "Edit page"
|
||||
other = "Edit this page"
|
||||
|
||||
[Shortcuts-Title]
|
||||
other = "More"
|
|
@ -5,7 +5,7 @@
|
|||
<meta charset="utf-8"> {{ partial "meta.html" . }} {{ partial "favicon.html" . }} {{ .Scratch.Add "title" "" }}{{ if eq .Site.Data.titles .Title }}{{ .Scratch.Set "title" (index .Site.Data.titles .Title).title }}{{ else }}{{ .Scratch.Set "title" .Title}}{{end}}
|
||||
<title>{{ .Scratch.Get "title" }}</title>
|
||||
|
||||
{{ $assetBusting := not .Site.Params.disableAssetBusting }}
|
||||
{{ $assetBusting := not .Site.Params.disableAssetsBusting }}
|
||||
<link href="{{"css/nucleus.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
|
||||
<link href="{{"css/font-awesome.min.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
|
||||
<link href="{{"css/hybrid.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
|
||||
|
|
|
@ -52,20 +52,20 @@
|
|||
<div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
|
||||
<div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>
|
||||
</div>
|
||||
<script src="{{"js/clipboard.min.js" | relURL}}{{ if not .Site.Params.disableAssetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/perfect-scrollbar.min.js" | relURL}}{{ if not .Site.Params.disableAssetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/perfect-scrollbar.jquery.min.js" | relURL}}{{ if not .Site.Params.disableAssetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/jquery.sticky-kit.min.js" | relURL}}{{ if not .Site.Params.disableAssetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/featherlight.min.js" | relURL}}{{ if not .Site.Params.disableAssetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/html5shiv-printshiv.min.js" | relURL}}{{ if not .Site.Params.disableAssetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/highlight.pack.js" | relURL}}{{ if not .Site.Params.disableAssetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/clipboard.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/perfect-scrollbar.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/perfect-scrollbar.jquery.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/jquery.sticky-kit.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/featherlight.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/html5shiv-printshiv.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/highlight.pack.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<script src="{{"js/modernizr.custom.71422.js" | relURL}}{{ if not .Site.Params.disableAssetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/learn.js" | relURL}}{{ if not .Site.Params.disableAssetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/hugo-learn.js" | relURL}}{{ if not .Site.Params.disableAssetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/modernizr.custom.71422.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/learn.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script src="{{"js/hugo-learn.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
|
||||
<link href="{{"mermaid/mermaid.css" | relURL}}{{ if not .Site.Params.disableAssetBusting }}?{{ now.Unix }}{{ end }}" type="text/css" rel="stylesheet" />
|
||||
<script src="{{"mermaid/mermaid.js" | relURL}}{{ if not .Site.Params.disableAssetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<link href="{{"mermaid/mermaid.css" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" type="text/css" rel="stylesheet" />
|
||||
<script src="{{"mermaid/mermaid.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script>
|
||||
mermaid.initialize({ startOnLoad: true });
|
||||
</script>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
{{ partial "favicon.html" . }}
|
||||
<title>{{ .Title }} :: {{ .Site.Title }}</title>
|
||||
|
||||
{{ $assetBusting := not .Site.Params.disableAssetBusting }}
|
||||
{{ $assetBusting := not .Site.Params.disableAssetsBusting }}
|
||||
<link href="{{"css/nucleus.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
|
||||
<link href="{{"css/font-awesome.min.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
|
||||
<link href="{{"css/hybrid.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
|
||||
|
|
|
@ -25,10 +25,10 @@
|
|||
{{end}}
|
||||
</ul>
|
||||
|
||||
{{ $enableShortcutsTitle := .Site.Params.EnableShortcutsTitle}}
|
||||
{{ $disableShortcutsTitle := .Site.Params.DisableShortcutsTitle}}
|
||||
{{with .Site.Menus.shortcuts}}
|
||||
<section id="shortcuts">
|
||||
<h3>{{ if $enableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}</h3>
|
||||
<h3>{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}</h3>
|
||||
<ul>
|
||||
{{ range sort . "Weight"}}
|
||||
<li class="" role="">
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
<input data-search-input id="search-by" type="text" placeholder="{{T "Search-placeholder"}}">
|
||||
<span data-search-clear=""><i class="fa fa-close"></i></span>
|
||||
</div>
|
||||
<script type="text/javascript" src="{{"js/lunr.min.js" | relURL}}"></script>
|
||||
<script type="text/javascript" src="{{"js/horsey.js" | relURL}}"></script>
|
||||
{{ $assetBusting := not .Site.Params.disableAssetsBusting }}
|
||||
<script type="text/javascript" src="{{"js/lunr.min.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script type="text/javascript" src="{{"js/horsey.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
<script type="text/javascript">
|
||||
{{ if .Site.IsMultiLingual }}
|
||||
var baseurl = "{{.Site.BaseURL}}{{.Site.LanguagePrefix}}";
|
||||
|
@ -12,4 +13,4 @@
|
|||
var baseurl = "{{.Site.BaseURL}}";
|
||||
{{ end }}
|
||||
</script>
|
||||
<script type="text/javascript" src="{{"js/search.js" | relURL}}"></script>
|
||||
<script type="text/javascript" src="{{"js/search.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
|
|
|
@ -59,6 +59,7 @@ a:hover {
|
|||
}
|
||||
pre {
|
||||
position: relative;
|
||||
color: #ffffff;
|
||||
}
|
||||
.bg {
|
||||
background: #fff;
|
||||
|
|
|
@ -164,7 +164,13 @@ jQuery(document).ready(function() {
|
|||
$('[data-search-input]').val(searchValue);
|
||||
$('[data-search-input]').trigger('input');
|
||||
var searchedElem = $('#body-inner').find(':contains(' + searchValue + ')').get(0);
|
||||
searchedElem && searchedElem.scrollIntoView();
|
||||
if (searchedElem) {
|
||||
searchedElem.scrollIntoView(true);
|
||||
var scrolledY = window.scrollY;
|
||||
if(scrolledY){
|
||||
window.scroll(0, scrolledY - 125);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// clipboard
|
||||
|
|
Loading…
Reference in a new issue