Skip to content
This repository has been archived by the owner on Dec 20, 2021. It is now read-only.

Commit

Permalink
ps author
Browse files Browse the repository at this point in the history
exampleSite
toc
  • Loading branch information
uPagge committed Dec 3, 2020
1 parent cc1ec25 commit 99551a9
Show file tree
Hide file tree
Showing 14 changed files with 106 additions and 19 deletions.
4 changes: 4 additions & 0 deletions assets/css/_custom.scss
Expand Up @@ -396,4 +396,8 @@ footer {
padding: 2rem 0;
}

.page-toc {
margin: 0;
}

@import "_custom_media";
8 changes: 8 additions & 0 deletions assets/css/_custom_media.scss
Expand Up @@ -27,6 +27,14 @@
}

@media only screen and (max-width: 1200px) {
#toc-auto {
display: none;
}

#toc-static {
display: block;
}

.page {
width: 100%;
}
Expand Down
71 changes: 68 additions & 3 deletions assets/js/theme.min.js

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion assets/js/theme.min.js.map

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions exampleSite/assets/css/_custom.scss

This file was deleted.

4 changes: 0 additions & 4 deletions exampleSite/assets/css/_override.scss

This file was deleted.

Expand Up @@ -119,7 +119,6 @@ Example `instagram` input:

The rendered output looks like this:

{{< instagram BWNjjyYFxVx hidecaption >}}

## 5 param

Expand Down
Expand Up @@ -124,7 +124,7 @@ Example `instagram` input:

The rendered output looks like this:

{{< instagram BWNjjyYFxVx hidecaption >}}


## 5 param

Expand Down
Expand Up @@ -120,7 +120,7 @@ Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见

呈现的输出效果如下:

{{< instagram BWNjjyYFxVx hidecaption >}}


## 5 param

Expand Down
8 changes: 8 additions & 0 deletions exampleSite/data/authors/default.json
@@ -0,0 +1,8 @@
{
"name": "Struchkov Mark",
"nickname": "@uPagge",
"bio": "Author Theme",
"avatar": "https://upagge.ru/img/ava.jpg",
"site": "https://uPagge.ru",
"ps": "Статья оказалась полезной? Делай репост &#128070; или <a class=\"donate-link\" href=\"https://www.tinkoff.ru/sl/NSGSK7FgEI\" target=\"_blank\" style=\"border-bottom: dashed 1px;color: #2c678d\"> налей пива</a>"
}
2 changes: 2 additions & 0 deletions layouts/partials/function/content.html
@@ -1,5 +1,6 @@
{{- $content := .Content -}}

{{- if ne "" $content -}}
{{- if .Ruby -}}
{{- $content = partial "function/ruby.html" $content -}}
{{- end -}}
Expand All @@ -15,5 +16,6 @@
{{- $content = partial "function/checkbox.html" $content -}}

{{- $content = partial "function/escape.html" $content -}}
{{- end -}}

{{- return $content -}}
6 changes: 4 additions & 2 deletions layouts/partials/single/footer.html
Expand Up @@ -9,17 +9,19 @@

{{ $author := index .Site.Data.authors (.Params.author | default "default") }}
{{- if $author -}}
<div class="footer-post-author">
<div class="footer-post-author" {{- if not $author.ps -}} style="border-radius: 10px" {{- end -}}>
<div class="author-avatar"><a href="{{ with $author.site }} {{- . | safeHTML -}}{{ end }}" target="_blank"><img alt="" src="{{ with $author.avatar }} {{- . | safeHTML -}}{{ end }}" border="0"></a></div>
<div class="author-info">
<div class="name">{{ $author.name }}</div>
<div class="number-posts">{{ $author.bio }}</span></div>
</div>
</div>
{{- if $author.ps -}}
<div class="footer-donate">
<div>Статья оказалась полезной? Делай репост &#128070; или <a class="donate-link" href="https://www.tinkoff.ru/sl/NSGSK7FgEI" target="_blank" style="border-bottom: dashed 1px;color: #2c678d"> налей пива</a></div>
<div>{{- $author.ps | safeHTML -}}</div>
</div>
{{- end -}}
{{- end -}}

<div class="post-footer" id="post-footer">
<div class="post-info">
Expand Down
2 changes: 1 addition & 1 deletion layouts/posts/single.html
Expand Up @@ -19,7 +19,7 @@ <h2 class="toc-title">{{ T "contents" }}</h2>
</div>
{{- end -}}

<article class="page single">
<article class="{{- if or .Site.Params.page.toc.keepStatic (not .Site.Params.page.toc.enable) -}}page single {{- else -}}page single page-toc{{- end -}}">

{{- /* Featured image */ -}}
{{- $image := $params.featuredimage -}}
Expand Down
2 changes: 1 addition & 1 deletion src/js/theme.js
Expand Up @@ -414,7 +414,7 @@ class Theme {
const $page = document.getElementsByClassName('page')[0];
const rect = $page.getBoundingClientRect();
$toc.style.left = `${rect.left + rect.width + 20}px`;
$toc.style.maxWidth = `${$page.getBoundingClientRect().left - 20}px`;
$toc.style.maxWidth = `${$page.getBoundingClientRect().left - 20 + 314}px`;
$toc.style.visibility = 'visible';
const $tocLinkElements = $tocCore.querySelectorAll('a:first-child');
const $tocLiElements = $tocCore.getElementsByTagName('li');
Expand Down

0 comments on commit 99551a9

Please sign in to comment.