Allow to show full content on list

This commit is contained in:
panr 2019-03-31 19:18:08 +02:00
parent bca791fe8c
commit 50e36736c6
14 changed files with 1807 additions and 1128 deletions

View File

@ -1,5 +1,11 @@
{
"parser": "babylon",
"parser": "babel",
"printWidth": 100,
"trailingComma": "all"
"trailingComma": "all",
"overrides": [{
"files": ".html",
"options": {
"parser": "html"
}
}]
}

View File

@ -1,43 +1,52 @@
{{ define "main" }}
<div class="posts">
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
{{ $paginator := .Paginate (where .Data.Pages "Type" $contentTypeName) }}
<div class="posts">
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
{{ $paginator := .Paginate (where .Data.Pages "Type" $contentTypeName) }}
{{ range $paginator.Pages }}
<div class="post on-list">
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
<div class="post-meta">
<span class="post-date">
{{ .Date.Format "2006-01-02" }}
</span>
{{ with .Params.Author }}<span class="post-author">:: {{ . }}</span>{{ end }}
</div>
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" . )) | absURL }}">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }}
{{ with .Params.Cover }}
<img src="{{ . | absURL }}" class="post-cover" />
{{ end }}
<div class="post-content">
{{ with .Description }}
{{ . | markdownify }}
{{ else }}
{{ if .Truncated }}
{{ .Summary | markdownify }}
{{ end }}
{{ end }}
</div>
<div><a class="read-more button" href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a></div>
{{ range $paginator.Pages }}
<div class="post on-list">
<h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
<div class="post-meta">
<span class="post-date">
{{ .Date.Format "2006-01-02" }}
</span>
{{ with .Params.Author }}<span class="post-author">::
{{ . }}</span>{{ end }}
</div>
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" . )) | absURL }}">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }}
{{ with .Params.Cover }}
<img src="{{ . | absURL }}" class="post-cover" />
{{ end }}
<div class="post-content">
{{ if .Params.showFullContent }}
{{ .Content | markdownify }}
{{ else if .Description }}
{{ .Description | markdownify }}
{{ else }}
{{ if .Truncated }}
{{ .Summary | markdownify }}
{{ end }}
{{ end }}
</div>
{{ if not .Params.showFullContent }}
<div>
<a class="read-more button" href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a>
</div>
{{ end }}
{{ partial "pagination.html" . }}
</div>
{{ end }}
{{ partial "pagination.html" . }}
</div>
{{ end }}

View File

@ -20,6 +20,12 @@
<img src="{{ . | absURL }}" class="post-cover" />
{{ end }}
{{ if .Params.Toc }}
<div class="table-of-contents">
{{ .TableOfContents }}
</div>
{{ end }}
<div class="post-content">
{{ .Content }}
</div>

View File

@ -16,9 +16,11 @@
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.2.2",
"@babel/parser": "^7.4.2",
"@babel/plugin-transform-runtime": "^7.2.0",
"@babel/preset-env": "^7.3.1",
"@babel/preset-stage-2": "^7.0.0",
"angular-html-parser": "^1.2.0",
"babel-eslint": "^8.2.1",
"babel-loader": "^8.0.5",
"browserslist": "^4.0.1",

View File

@ -51,3 +51,51 @@ code.language-html {
.token.namespace {
opacity: .7;
}
pre[data-line] {
position: relative;
padding: 1em 0 1em 3em;
}
.line-highlight {
position: absolute;
left: 0;
right: 0;
padding: inherit 0;
margin-top: 1em;
/* Same as .prisms padding-top */
background: hsla(24, 20%, 50%, .08);
background: linear-gradient(to right, hsla(24, 20%, 50%, .1) 70%, hsla(24, 20%, 50%, 0));
pointer-events: none;
line-height: inherit;
white-space: pre;
}
.line-highlight:before,
.line-highlight[data-end]:after {
content: attr(data-start);
position: absolute;
top: .4em;
left: .6em;
min-width: 1em;
padding: 0 .5em;
background-color: hsla(24, 20%, 50%, .4);
color: hsl(24, 20%, 95%);
font: bold 65%/1.5 sans-serif;
text-align: center;
vertical-align: .3em;
border-radius: 999px;
text-shadow: none;
box-shadow: 0 1px white;
}
.line-highlight[data-end]:after {
content: attr(data-end);
top: auto;
bottom: .4em;
}
.line-numbers .line-highlight:before,
.line-numbers .line-highlight:after {
content: none;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -91,10 +91,9 @@
!*** ./source/js/main.js ***!
\***************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, exports) {
"use strict";
eval("// Add your script here\n\n\n//# sourceURL=webpack:///./source/js/main.js?");
eval("// Add your script here\n\n//# sourceURL=webpack:///./source/js/main.js?");
/***/ }),
@ -103,10 +102,9 @@ eval("// Add your script here\n\n\n//# sourceURL=webpack:///./source/js/main.js?
!*** ./source/js/menu.js ***!
\***************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, exports) {
"use strict";
eval("\n\nvar container = document.querySelector(\".container\");\nvar menu = document.querySelector(\".menu\");\nvar mobileMenuTrigger = document.querySelector(\".menu-trigger\");\nvar desktopMenu = document.querySelector(\".menu__inner--desktop\");\nvar desktopMenuTrigger = document.querySelector(\".menu__sub-inner-more-trigger\");\nvar menuMore = document.querySelector(\".menu__sub-inner-more\");\nvar mobileQuery = getComputedStyle(document.body).getPropertyValue(\"--phoneWidth\");\n\nvar isMobile = function isMobile() {\n return window.matchMedia(mobileQuery).matches;\n};\n\nvar handleMenuClasses = function handleMenuClasses() {\n mobileMenuTrigger && mobileMenuTrigger.classList.toggle(\"hidden\", !isMobile());\n menu && menu.classList.toggle(\"hidden\", isMobile());\n menuMore && menuMore.classList.toggle(\"hidden\", !isMobile());\n}; // Common\n\n\nmenu && menu.addEventListener(\"click\", function (e) {\n return e.stopPropagation();\n});\nmenuMore && menuMore.addEventListener(\"click\", function (e) {\n return e.stopPropagation();\n});\nhandleMenuClasses();\ndocument.body.addEventListener(\"click\", function () {\n if (!isMobile() && menuMore && !menuMore.classList.contains(\"hidden\")) {\n menuMore.classList.add(\"hidden\");\n } else if (isMobile() && !menu.classList.contains(\"hidden\")) {\n menu.classList.add(\"hidden\");\n }\n});\nwindow.addEventListener(\"resize\", handleMenuClasses); // Mobile menu\n\nmobileMenuTrigger && mobileMenuTrigger.addEventListener(\"click\", function (e) {\n e.stopPropagation();\n menu && menu.classList.toggle(\"hidden\");\n}); // Desktop menu\n\ndesktopMenuTrigger && desktopMenuTrigger.addEventListener(\"click\", function (e) {\n e.stopPropagation();\n menuMore && menuMore.classList.toggle(\"hidden\");\n\n if (menuMore.getBoundingClientRect().right > container.getBoundingClientRect().right) {\n menuMore.style.left = \"auto\";\n menuMore.style.right = 0;\n }\n});\n\n//# sourceURL=webpack:///./source/js/menu.js?");
eval("var container = document.querySelector(\".container\");\nvar menu = document.querySelector(\".menu\");\nvar mobileMenuTrigger = document.querySelector(\".menu-trigger\");\nvar desktopMenu = document.querySelector(\".menu__inner--desktop\");\nvar desktopMenuTrigger = document.querySelector(\".menu__sub-inner-more-trigger\");\nvar menuMore = document.querySelector(\".menu__sub-inner-more\");\nvar mobileQuery = getComputedStyle(document.body).getPropertyValue(\"--phoneWidth\");\n\nvar isMobile = function isMobile() {\n return window.matchMedia(mobileQuery).matches;\n};\n\nvar handleMenuClasses = function handleMenuClasses() {\n mobileMenuTrigger && mobileMenuTrigger.classList.toggle(\"hidden\", !isMobile());\n menu && menu.classList.toggle(\"hidden\", isMobile());\n menuMore && menuMore.classList.toggle(\"hidden\", !isMobile());\n}; // Common\n\n\nmenu && menu.addEventListener(\"click\", function (e) {\n return e.stopPropagation();\n});\nmenuMore && menuMore.addEventListener(\"click\", function (e) {\n return e.stopPropagation();\n});\nhandleMenuClasses();\ndocument.body.addEventListener(\"click\", function () {\n if (!isMobile() && menuMore && !menuMore.classList.contains(\"hidden\")) {\n menuMore.classList.add(\"hidden\");\n } else if (isMobile() && !menu.classList.contains(\"hidden\")) {\n menu.classList.add(\"hidden\");\n }\n});\nwindow.addEventListener(\"resize\", handleMenuClasses); // Mobile menu\n\nmobileMenuTrigger && mobileMenuTrigger.addEventListener(\"click\", function (e) {\n e.stopPropagation();\n menu && menu.classList.toggle(\"hidden\");\n}); // Desktop menu\n\ndesktopMenuTrigger && desktopMenuTrigger.addEventListener(\"click\", function (e) {\n e.stopPropagation();\n menuMore && menuMore.classList.toggle(\"hidden\");\n\n if (menuMore.getBoundingClientRect().right > container.getBoundingClientRect().right) {\n menuMore.style.left = \"auto\";\n menuMore.style.right = 0;\n }\n});\n\n//# sourceURL=webpack:///./source/js/menu.js?");
/***/ }),

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2638
yarn.lock

File diff suppressed because it is too large Load Diff