Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vjeantet/hugo-theme-docport.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvjeantet <valere.jeantet@gmail.com>2020-08-21 20:24:25 +0300
committervjeantet <valere.jeantet@gmail.com>2020-08-21 20:24:25 +0300
commitb3f9f57d4246c58ab8b6c48379d9159a86c16504 (patch)
tree7ec968e97b62e40040ed531242beb5b51ee5f752
parent9edc0cf1d6e15beaee07c01a663e9faeb4c4b26a (diff)
jump to section
-rw-r--r--assets/sass/layout.scss44
-rw-r--r--assets/sass/main.scss16
-rw-r--r--exampleSite/config.toml2
-rw-r--r--exampleSite/resources/_gen/assets/scss/sass/layout.scss_f300667da4f5b5f84e1a9e0702b2fdde.content36
-rw-r--r--exampleSite/resources/_gen/assets/scss/sass/main.scss_9fd32d87d247ca96761d3cae485087fe.content8
-rw-r--r--i18n/en.toml17
-rw-r--r--i18n/fr.toml17
-rw-r--r--layouts/partials/_next-prev-page.html4
-rw-r--r--layouts/partials/body-article-content.html16
-rw-r--r--layouts/partials/body-article-sidepage.html2
10 files changed, 134 insertions, 28 deletions
diff --git a/assets/sass/layout.scss b/assets/sass/layout.scss
index 004dce3..ed5d4a5 100644
--- a/assets/sass/layout.scss
+++ b/assets/sass/layout.scss
@@ -32,7 +32,7 @@ body {
padding: 0 2rem;
position: fixed;
left: 0; right: 0; top: 0;
- z-index: 1;
+ z-index: 10;
div.burger {
display: none;
}
@@ -46,6 +46,7 @@ body {
align-items: flex-start;
min-height: calc(100vh - 3.5rem);
+
aside {
margin-top: 3.5rem;
position: fixed;
@@ -66,6 +67,27 @@ body {
margin-left: 20em;
width:calc(100% - 20em - 15em - 1.1em);
+ .jump-to-section{
+ display:none;
+ margin-top: 0.5em;
+ margin-left: 0.2em;
+ ul{
+ padding-left: 20px;
+ }
+
+ nav{
+ display: none;
+ position: absolute;
+ z-index: 5;
+ border: 1px solid ;
+ padding: 3px 30px;
+ border-radius: 3px;
+ min-width: 25%;
+ max-width: 50%;
+ box-shadow: 0 5px 8px rgba(0,0,0,.25);
+ }
+ }
+
&.simple{
width:calc(100% - 20em - 1.1em);
}
@@ -104,7 +126,7 @@ body {
body{
header {
div.burger {
- display: inline;
+ /*display: inline;*/
&.full{
display: none ;
}
@@ -113,19 +135,20 @@ body {
article {
aside {
/*transform: translate(100vw,0);*/
- display: none;
+ /*display: none;*/
}
section.page{
- margin-left: 0px;
- width:calc(100% - 15em - 1.1em);
+ /*margin-left: 0px; */
+ width:calc(100% - 1.1em);
&.simple{
width:100%;
}
+ .jump-to-section{display: block;}
}
section.right-menu{
-
+ display: none;
}
}
}
@@ -134,6 +157,12 @@ body {
@media(max-width:930px) {
body{
header {
+ div.burger {
+ display: inline;
+ &.full{
+ display: none ;
+ }
+ }
nav.shortcuts li{
display: none;
@@ -148,7 +177,8 @@ body {
section.page{
width: 100%;
- margin-left: 0px;
+ margin-left: 0px;
+
}
section.right-menu{
diff --git a/assets/sass/main.scss b/assets/sass/main.scss
index 75b4c48..55812a5 100644
--- a/assets/sass/main.scss
+++ b/assets/sass/main.scss
@@ -274,6 +274,22 @@ article section.page {
}
+ div.jump-to-section{
+ font-size: smaller;
+ color:$c_dark2;
+ ul{
+ li a{
+ color:$c_saturate3;
+ }
+ }
+
+ nav{
+ background-color: white;
+ }
+ }
+
+
+
div.chevrons {
&.simple, &.full{
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 247d36b..e3eef02 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -8,7 +8,7 @@ themesdir = "../.."
pygmentsCodeFences = true
pygmentsStyle = "monokai"
-defaultContentLanguage = "en"
+
defaultContentLanguageInSubdir= false
enableMissingTranslationPlaceholders = false
diff --git a/exampleSite/resources/_gen/assets/scss/sass/layout.scss_f300667da4f5b5f84e1a9e0702b2fdde.content b/exampleSite/resources/_gen/assets/scss/sass/layout.scss_f300667da4f5b5f84e1a9e0702b2fdde.content
index 972ebd2..62f5278 100644
--- a/exampleSite/resources/_gen/assets/scss/sass/layout.scss_f300667da4f5b5f84e1a9e0702b2fdde.content
+++ b/exampleSite/resources/_gen/assets/scss/sass/layout.scss_f300667da4f5b5f84e1a9e0702b2fdde.content
@@ -20,7 +20,7 @@ body {
left: 0;
right: 0;
top: 0;
- z-index: 1; }
+ z-index: 10; }
body header div.burger {
display: none; }
body article {
@@ -49,6 +49,22 @@ body {
padding-right: 1.5rem !important;
margin-left: 20em;
width: calc(100% - 20em - 15em - 1.1em); }
+ body article section.page .jump-to-section {
+ display: none;
+ margin-top: 0.5em;
+ margin-left: 0.2em; }
+ body article section.page .jump-to-section ul {
+ padding-left: 20px; }
+ body article section.page .jump-to-section nav {
+ display: none;
+ position: absolute;
+ z-index: 5;
+ border: 1px solid;
+ padding: 3px 30px;
+ border-radius: 3px;
+ min-width: 25%;
+ max-width: 50%;
+ box-shadow: 0 5px 8px rgba(0, 0, 0, 0.25); }
body article section.page.simple {
width: calc(100% - 20em - 1.1em); }
body article section.page.full {
@@ -74,19 +90,27 @@ body {
@media (max-width: 1200px) {
body header div.burger {
- display: inline; }
+ /*display: inline;*/ }
body header div.burger.full {
display: none; }
body article aside {
/*transform: translate(100vw,0);*/
- display: none; }
+ /*display: none;*/ }
body article section.page {
- margin-left: 0px;
- width: calc(100% - 15em - 1.1em); }
+ /*margin-left: 0px; */
+ width: calc(100% - 1.1em); }
body article section.page.simple {
- width: 100%; } }
+ width: 100%; }
+ body article section.page .jump-to-section {
+ display: block; }
+ body article section.right-menu {
+ display: none; } }
@media (max-width: 930px) {
+ body header div.burger {
+ display: inline; }
+ body header div.burger.full {
+ display: none; }
body header nav.shortcuts li {
display: none; }
body article aside {
diff --git a/exampleSite/resources/_gen/assets/scss/sass/main.scss_9fd32d87d247ca96761d3cae485087fe.content b/exampleSite/resources/_gen/assets/scss/sass/main.scss_9fd32d87d247ca96761d3cae485087fe.content
index de0485c..4286365 100644
--- a/exampleSite/resources/_gen/assets/scss/sass/main.scss_9fd32d87d247ca96761d3cae485087fe.content
+++ b/exampleSite/resources/_gen/assets/scss/sass/main.scss_9fd32d87d247ca96761d3cae485087fe.content
@@ -155,6 +155,14 @@ article section.page nav.subpages {
content: "└ ";
color: #965151; }
+article section.page div.jump-to-section {
+ font-size: smaller;
+ color: #333333; }
+ article section.page div.jump-to-section ul li a {
+ color: #a14545; }
+ article section.page div.jump-to-section nav {
+ background-color: white; }
+
article section.page div.chevrons {
margin-top: 3rem;
border-top: 1px solid #e6e6e6;
diff --git a/i18n/en.toml b/i18n/en.toml
index 421502f..35dd8bd 100644
--- a/i18n/en.toml
+++ b/i18n/en.toml
@@ -1,5 +1,3 @@
-[create-header-md]
-other = "Create a content/_layout/header/_index.md to customize this"
[create-footer-md]
other = "Create a content/_layout/footer/_index.md file to customize the footer content !"
@@ -7,9 +5,6 @@ other = "Create a content/_layout/footer/_index.md file to customize the footer
[Search-placeholder]
other = "Type to search..."
-[Clear-History]
-other = "Clear History"
-
[Page]
other = "Page"
@@ -42,3 +37,15 @@ other = "Expand me..."
[last-update-on]
other = "Last update on"
+
+[jump-to-section]
+other= "Jump to Section"
+
+[home]
+other= "Home"
+
+[next-section]
+other= "Next page"
+
+[table-of-contents]
+other= "Table of contents" \ No newline at end of file
diff --git a/i18n/fr.toml b/i18n/fr.toml
index 9dc6e53..3452be7 100644
--- a/i18n/fr.toml
+++ b/i18n/fr.toml
@@ -1,5 +1,3 @@
-[create-header-md]
-other = "Créez un fichier _header.md pour personaliser cet encart"
[create-footer-md]
other = "Créez un fichier footer.md dans le répertoire content pour personaliser ce pied de page"
@@ -7,9 +5,6 @@ other = "Créez un fichier footer.md dans le répertoire content pour personalis
[Search-placeholder]
other = "Rechercher..."
-[Clear-History]
-other = "Supprimer historique"
-
[Page]
other = "Page"
@@ -42,3 +37,15 @@ other = "Déroulez-moi..."
[last-update-on]
other = "Dernière mise à jour le "
+
+[jump-to-section]
+other= "Allez au chapitre..."
+
+[home]
+other= "Accueil"
+
+[next-section]
+other= "Contenu suivant"
+
+[table-of-contents]
+other= "Sommaire" \ No newline at end of file
diff --git a/layouts/partials/_next-prev-page.html b/layouts/partials/_next-prev-page.html
index 9b5ee39..39ab4d0 100644
--- a/layouts/partials/_next-prev-page.html
+++ b/layouts/partials/_next-prev-page.html
@@ -37,7 +37,7 @@
<a class="prev" href="{{.RelPermalink}}" title="{{.Title}}">
<i class="material-icons">arrow_back</i>
<div>
- <p>Previous page :</p>
+ <p>{{T "previous-section"}}</p>
<label>{{.Title}}</label>
</div>
@@ -47,7 +47,7 @@
{{- with ($.Scratch.Get "nextPage") -}}
<a class="next" href="{{.RelPermalink}}" title="{{.Title}}" style="margin-right: 0px;">
<div>
- <p>Next page :</p>
+ <p>{{T "next-section"}}</p>
<label>{{.Title}}</label>
</div>
<i class="material-icons">arrow_forward</i></a>
diff --git a/layouts/partials/body-article-content.html b/layouts/partials/body-article-content.html
index 9df16e3..fd35861 100644
--- a/layouts/partials/body-article-content.html
+++ b/layouts/partials/body-article-content.html
@@ -55,6 +55,20 @@
<h1>{{.Title}}</h1>
{{end}}
<!-- FIN TITRE -->
+
+ <!-- JUMP TO SECTION -->
+ <div class="jump-to-section">
+ <span onclick="$h = $(this);$h.next('nav').slideToggle(100,function () {$h.children('i').attr('class',function () {return $h.next('nav').is(':visible') ? 'material-icons expand_more' : 'material-icons chevron_right';});});">
+ {{ T "jump-to-section"}}
+ <i style=";" class="material-icons chevron_right"></i>
+ </span>
+ {{ .TableOfContents }}
+ </div>
+ <!-- / JUMP TO SECTION -->
+
+
+
+
{{end}}
<div class="content">
{{- with .Content -}}
@@ -82,7 +96,7 @@
{{ if .p1.Parent.IsHome}}
<li class="breadcrumb-item ">
<a class="text-link" href="{{.p1.Site.BaseURL}}">
- Home
+ {{ T "home"}}
</a>
</li>
{{else}}
diff --git a/layouts/partials/body-article-sidepage.html b/layouts/partials/body-article-sidepage.html
index b27afef..e49376d 100644
--- a/layouts/partials/body-article-sidepage.html
+++ b/layouts/partials/body-article-sidepage.html
@@ -2,7 +2,7 @@
<div class="actions">
</div>
<div class="TableOfContents">
- <label>Table of contents</label>
+ <label>{{T "table-of-contents"}}</label>
<nav>
<ul >
<li><a href="{{ .RelPermalink }}">{{.Title}}</a></li>