Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add page resources support #443

Draft
wants to merge 32 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e5961f1
Preparing next release 0.5.0-SNAPSHOT
kakawait Jul 3, 2019
b2a014f
Merge pull request #359 from kakawait/bugfix/cover-image-with-url
kakawait Jul 10, 2019
2b66bab
update generator theme version
kakawait Jul 10, 2019
ff0ad1d
Bump lodash from 4.17.11 to 4.17.14
dependabot[bot] Jul 10, 2019
c83ee0b
Merge pull request #360 from kakawait/dependabot/npm_and_yarn/lodash-…
kakawait Jul 10, 2019
c49c113
Add missing class without language- prefix
kakawait Jul 14, 2019
4da7380
Update config.toml to add missing lang
kakawait Jul 14, 2019
413e781
Merge pull request #361 from kakawait/bugfix/highlighting
kakawait Jul 14, 2019
e2a6367
Update package-lock.json
kakawait Jul 14, 2019
63d08e4
Upgrade index.html to support changes from 0.57
kakawait Aug 15, 2019
ea0c031
Merge pull request #373 from kakawait/bugfix/hugo-0.57
kakawait Aug 15, 2019
e69eb64
Merge branch 'master' into develop
kakawait Aug 30, 2019
1de4252
Correct 2 link constructions
xenlo Nov 14, 2019
2d04cb0
Merge branch 'develop' into master
xenlo Feb 16, 2020
49cd431
Merge pull request #391 from xenlo/master
kakawait Feb 17, 2020
a484469
Revert #293
kakawait Jul 15, 2019
6f2e6eb
Revamp sidebar translation
kakawait Jul 29, 2019
02ca89c
Fixing sidebar swipping and relatives items
kakawait Aug 30, 2019
6ab3c57
Build prod
kakawait Mar 29, 2020
568a3a2
Merge pull request #364 from kakawait/revamp-sidebar-swipping
kakawait Mar 29, 2020
ccd2058
Agonyus showcase
kakawait Mar 29, 2020
3cd93f4
BALLOON a.k.a. Fu-sen.
kakawait Mar 29, 2020
79a79c6
Namshik Kim's blog
kakawait Mar 29, 2020
69802f5
Razvan Avramescu's blog
kakawait Mar 29, 2020
6cbb4e0
Merge pull request #408 from kakawait/showcases
kakawait Mar 29, 2020
6c5c935
Rename post to posts
kakawait Mar 29, 2020
7d37efe
Merge pull request #409 from kakawait/migrate-post-to-posts
kakawait Mar 29, 2020
43667f5
Fix post to posts migration
kakawait Mar 29, 2020
4243bcf
Fix and syntax
kakawait May 29, 2020
c437c05
MOD: initial page resources support
Jul 15, 2020
1e1a7d8
MOD: support thumbnail from gallery too
Jul 16, 2020
4439c4b
MOD: add support in wide-image shortcode
Jul 16, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Please all the credit should be attributed to [original *Hexo* version](https://
## General

- **Authors**: [Louis Barranqueiro (LouisBarranqueiro)](https://github.com/LouisBarranqueiro) and [Thibaud Leprêtre (kakawait)](https://github.com/kakawait)
- **Version**: 0.4.7-BETA (based on Hexo version 1.10.0)
- **Version**: 0.5.0-SNAPSHOT (based on Hexo version 1.10.0)
- **Compatibility**: Hugo v0.53

## Features
Expand Down
2 changes: 1 addition & 1 deletion docs/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ If you want to report a bug or ask a question, [create an issue](https://github.
## General ##

- **Author** : Thibaud Leprêtre
- **Version** : 0.4.7-BETA (based on Hexo version 1.10.0)
- **Version** : 0.5.0-SNAPSHOT (based on Hexo version 1.10.0)
- **Compatibility** : Hugo v0.53

## Requirements ##
Expand Down
2 changes: 1 addition & 1 deletion docs/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ If you want to report a bug or ask a question, [create an issue](https://github.
## General

- **Authors**: [Louis Barranqueiro (LouisBarranqueiro)](https://github.com/LouisBarranqueiro) and [Thibaud Leprêtre (kakawait)](https://github.com/kakawait)
- **Version**: 0.4.7-BETA (based on Hexo version 1.10.0)
- **Version**: 0.5.0-SNAPSHOT (based on Hexo version 1.10.0)
- **Compatibility**: Hugo v0.53

## Features
Expand Down
60 changes: 54 additions & 6 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Tranquilpeak
# Version : 0.4.7-BETA
# Version : 0.5.0-SNAPSHOT
# Author : Thibaud Leprêtre

# I STRONGLY recommend you to use a CDN to speed up loading of pages.
Expand All @@ -23,7 +23,7 @@ paginate = 7
canonifyurls = true

[permalinks]
post = "/:year/:month/:slug/"
posts = "/:year/:month/:slug/"

[taxonomies]
tag = "tags"
Expand Down Expand Up @@ -98,6 +98,10 @@ canonifyurls = true
url = "/index.xml"

[params]
# Syntax highlighter, possible choice between: "highlight.js" and "prism.js"
# You can comment it to disable syntax highlighting
syntaxHighlighter = "highlight.js"

# Customize date format use to render blog post date, categories and other
# You must use date format used by Go Time package https://golang.org/pkg/time/
# Months (not work with short month like "jan", "feb", etc) are translated if translation exists on i18n folders
Expand All @@ -107,10 +111,6 @@ canonifyurls = true
# Global keywords configuration. Following keywords will be add to every pages
# keywords = ["development", "next-gen"]

# Syntax highlighter, possible choice between: "highlight.js" (recommanded) and "prism.js" (experimental)
# You can comment it to disable syntax highlighting
syntaxHighlighter = "highlight.js"

# Hide sidebar on all article page to let article take full width to improve reading, and enjoy wide images and cover images. (true: enable, false: disable)
clearReading = true

Expand Down Expand Up @@ -181,6 +181,54 @@ canonifyurls = true
# they have to be referred from static root. Example
# [[params.customJS]]
# src = "js/myscript.js"
[[params.customJS]]
src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/go.min.js"
integrity = "sha256-LVuWfOU0rWFMCJNl1xb3K2HSWfxtK4IPbqEerP1P83M="
crossorigin = "anonymous"
async = true
defer = true

[[params.customJS]]
src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/less.min.js"
integrity = "sha256-EB4Qe5B8kOTN9/r65YrBPJ3VkDRJa8sSVqqaIakt0gU="
crossorigin = "anonymous"
async = true
defer = true

[[params.customJS]]
src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/puppet.min.js"
integrity = "sha256-LWiDV1Ge/4ULbV/tJh9N8NTILGIbsPEdnGQ24CrjBzo="
crossorigin = "anonymous"
async = true
defer = true

[[params.customJS]]
src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/scss.min.js"
integrity = "sha256-/27cA5aA9DgzXPb747VxVTzwPG/X5tihoKySMSq3bwk="
crossorigin = "anonymous"
async = true
defer = true

[[params.customJS]]
src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/stylus.min.js"
integrity = "sha256-CFwICvPAUcOBI6YRYZMf4OkyePvFtdG7n7Wl9UNZwx0="
crossorigin = "anonymous"
async = true
defer = true

[[params.customJS]]
src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/swift.min.js"
integrity = "sha256-zYofLVsdq2KkS4cVGc6/8gTKb7lPsTLk1vs37g9aYj0="
crossorigin = "anonymous"
async = true
defer = true

[[params.customJS]]
src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/yaml.min.js"
integrity = "sha256-tvm0lHsuUZcOfj/0C9xJTU4OQx5KpUgxUcAXLX5kvwA="
crossorigin = "anonymous"
async = true
defer = true

# Sharing options
# Comment and uncomment to enable or disable sharing options
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Welcome to Tranquilpeak 0.4.7-BETA"
title: "Welcome to Tranquilpeak 0.5.0-SNAPSHOT"
date: 2015-06-15
categories:
- tranquilpeak
Expand Down Expand Up @@ -65,7 +65,7 @@ Please all the credit should be attributed to [original *Hexo* version](https://
## General

- **Authors**: [Louis Barranqueiro (LouisBarranqueiro)](https://github.com/LouisBarranqueiro) and [Thibaud Leprêtre (kakawait)](https://github.com/kakawait)
- **Version**: 0.4.7-BETA (based on Hexo version 1.10.0)
- **Version**: 0.5.0-SNAPSHOT (based on Hexo version 1.10.0)
- **Compatibility**: Hugo v0.53

## Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ If you want to add your site to this showcase, click [here](https://github.com/k

[![Ivan Fadila Putra's blog](https://i.imgur.com/r7tJa2Lm.png)](https://ffadilaputra.github.io/)

## BALLOON a.k.a. Fu-sen's blog
## BALLOON a.k.a. Fu-sen.'s blog

[![BALLOON a.k.a. Fu-sen's blog](https://i.imgur.com/ThaDHyfm.png)](https://balloon.gq/)
[![BALLOON a.k.a. Fu-sen.'s blog](https://i.imgur.com/ThaDHyfm.png)](https://blog.balloon.im/)

## Yue Hao's blog

Expand All @@ -95,3 +95,17 @@ If you want to add your site to this showcase, click [here](https://github.com/k
## Aditya Mangal's blog

[![Aditya Mangal's blog](https://i.imgur.com/FKrnNGlm.png)](https://www.adityamangal.com/)

## Agonyus's blog

[![Agonyus's blog](https://i.imgur.com/P25TDrFm.png)](https://agonyus.com/)

## Namshik Kim's blog

> Data science blog

[![Namshik Kim's blog](https://i.imgur.com/oQ8i7k7m.png)](https://physhik.com/)

## Razvan Avramescu's blog

[![Razvan Avramescu's blog](https://i.imgur.com/vyhMGDFm.png)](https://www.avramescu.net/)
18 changes: 15 additions & 3 deletions layouts/_default/summary.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
{{ if .Site.Params.thumbnailImage }}
{{ if .Params.thumbnailimage }}
{{ .Scratch.Set "thumbnailImage" (.Params.thumbnailimage | absURL) }}
{{ with .Resources.GetMatch ( .Params.thumbnailimage ) }}
{{ $.Scratch.Set "thumbnailImage" (.RelPermalink) }}
{{ else }}
{{ $.Scratch.Set "thumbnailImage" (.Params.thumbnailimage | relURL) }}
{{ end }}
{{ else }}
{{ if or .Params.autothumbnailimage (and .Site.Params.autoThumbnailImage (ne .Params.autothumbnailimage false)) }}
{{ if .Params.gallery }}
{{ range first 1 .Params.gallery }}
{{ range first 1 (split . " ") }}
{{ $.Scratch.Set "thumbnailImage" (. | absURL) }}
{{ with $.Page.Resources.GetMatch ( . ) }}
{{ $.Scratch.Set "thumbnailImage" (.RelPermalink) }}
{{ else }}
{{ $.Scratch.Set "thumbnailImage" (. | relURL) }}
{{ end }}
{{ end }}
{{ end }}
{{ else }}
{{ if .Params.coverimage }}
{{ .Scratch.Set "thumbnailImage" (.Params.coverimage | absURL) }}
{{ with .Resources.GetMatch ( .Params.coverimage ) }}
{{ $.Scratch.Set "thumbnailImage" (.RelPermalink) }}
{{ else }}
{{ $.Scratch.Set "thumbnailImage" (.Params.coverimage | relURL) }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{ if eq .Params.covermeta "out" }}hasCoverMetaOut{{ else }}hasCoverMetaIn{{ end }}
{{ with .Params.coverCaption }}hasCoverCaption{{ end }}">
<section class="postShorten-group main-content-wrap">
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "post") }}
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "posts") }}
{{ range $paginator.Pages }}
{{ .Render "summary" }}
{{ end }}
Expand Down
6 changes: 3 additions & 3 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $.Scratch.Set "isPost" false -}}
{{- if .IsPage -}}
{{- if eq .Type "post" -}}
{{- if eq .Type "posts" -}}
{{- $.Scratch.Set "isPost" true -}}
{{- end -}}
{{- end -}}
Expand Down Expand Up @@ -28,7 +28,7 @@
{{ partial "meta.html" . }}
<title>{{ with .Title }}{{ . }}{{ else }}{{ .Site.Title }}{{ end }}</title>

<link rel="icon" href="{{ with .Site.Params.favicon }}{{ . }}{{ else }}/favicon.png{{ end }}">
<link rel="icon" href="{{ with .Site.Params.favicon }}{{ . | absURL }}{{ else }}/favicon.png{{ end }}">
{{ with .OutputFormats.Get "RSS" }}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ .RelPermalink }}">
{{ end }}
Expand All @@ -45,7 +45,7 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.4/helpers/jquery.fancybox-thumbs.min.css" integrity="sha256-SEa4XYAHihTcEP1f5gARTB2K26Uk8PsndQYHQC1f4jU=" crossorigin="anonymous" />
<!--EXTERNAL STYLES END-->
<!--STYLES-->
<link rel="stylesheet" href="/css/style-twzjdbqhmnnacqs0pwwdzcdbt8yhv8giawvjqjmyfoqnvazl0dalmnhdkvp7.min.css" />
<link rel="stylesheet" href="{{ "css/style-tvdxyfs1kx18wykmq8bosyiv5wlpt23i6jnyiy07iapt2cejsqiwu5dieacr.min.css" | absURL}}" />
<!--STYLES END-->
{{ range .Site.Params.customCSS }}
{{ if isset . "href" }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/meta.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Hugo {{ hugo.Version }} with theme Tranquilpeak 0.4.7-BETA">
<meta name="generator" content="Hugo {{ hugo.Version }} with theme Tranquilpeak 0.5.0-SNAPSHOT">
<meta name="author" content="{{ .Site.Author.name }}">
<meta name="keywords" content="{{ with .Keywords }}{{ delimit . ", " }}{{ end }}{{ if .Site.Params.keywords }}, {{ delimit .Site.Params.keywords ", " }}{{ end }}">
<meta name="description" content="{{ if .Description }}{{ .Description }}{{ else if .IsPage }}{{ .Summary }}{{ else }}{{ .Site.Params.description }}{{ end }}">
Expand Down
9 changes: 7 additions & 2 deletions layouts/partials/post/header-cover.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
<div class="post-header-cover
{{ if .Params.metaalignment }}text-{{ .Params.metaalignment }}{{ else }}text-left{{ end }}
{{ with .Params.coversize }}post-header-cover--{{ . }}{{ end }}"
style="background-image:url('{{ .Params.coverimage | relURL }}')"
data-behavior="{{ $.Scratch.Get "sidebarBehavior" }}">
{{ with .Resources.GetMatch ( .Params.coverimage ) }}
{{ $.Scratch.Set "coverImage" (.RelPermalink) }}
{{ else }}
{{ $.Scratch.Set "coverImage" (.Params.coverimage ) }}
{{ end }}
style="background-image:url('{{ $.Scratch.Get "coverImage" | relURL }}')"
data-behavior="{{ $.Scratch.Get "sidebarBehavior" }}">
{{ if or (eq .Params.covermeta "in") (not .Params.covermeta) }}
{{ partial "post/header.html" . }}
{{ end }}
Expand Down
16 changes: 1 addition & 15 deletions layouts/partials/script.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.7/js/jquery.fancybox.min.js" integrity="sha256-GEAnjcTqVP+vBp3SSc8bEDQqvWAZMiHyUSIorrWwH50=" crossorigin="anonymous"></script>
<!--EXTERNAL SCRIPTS END-->
<!--SCRIPTS-->
<script src="/js/script-pcw6v3xilnxydl1vddzazdverrnn9ctynvnxgwho987mfyqkuylcb1nlt.min.js"></script>
<script src="{{ "js/script-pylp3bsldafwqmyavzhbp4jsdyyo4dvcyroijar25lrdnntzbkhbtfx0n5p.min.js" | absURL}}"></script>
<!--SCRIPTS END-->
{{ range .Site.Params.customJS }}
{{ if isset . "src" }}
Expand All @@ -17,20 +17,6 @@
<script src="{{ . | absURL }}"></script>
{{ end }}
{{ end }}
<script lang="javascript">
window.onload = updateMinWidth;
window.onresize = updateMinWidth;
document.getElementById("sidebar").addEventListener("transitionend", updateMinWidth);
function updateMinWidth() {
var sidebar = document.getElementById("sidebar");
var main = document.getElementById("main");
main.style.minWidth = "";
var w1 = getComputedStyle(main).getPropertyValue("min-width");
var w2 = getComputedStyle(sidebar).getPropertyValue("width");
var w3 = getComputedStyle(sidebar).getPropertyValue("left");
main.style.minWidth = `calc(${w1} - ${w2} - ${w3})`;
}
</script>
{{ if eq .Site.Params.syntaxHighlighter "highlight.js" }}
<script>
$(document).ready(function() {
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="modal-body">
<div class="no-result text-color-light text-center">{{ i18n "global.posts_found.zero" }}</div>
<div class="results">
{{ $posts := (where .Site.RegularPages "Section" "post") }}
{{ $posts := (where .Site.RegularPages "Section" "posts") }}
{{ range first 10 $posts }}
<div class="media">
{{ if .Params.thumbnailImageUrl }}
Expand Down
8 changes: 4 additions & 4 deletions layouts/shortcodes/codeblock.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
{{ end }}
{{ end }}
{{ $trimmedContent := trim .Inner "\n" }}
<figure class="highlight {{ $.Scratch.Get "c-language" }} language-{{ with ($.Scratch.Get "c-language") }}{{ . }}{{ end }}">
<figure class="highlight {{ $.Scratch.Get "c-language" }} language-{{ $.Scratch.Get "c-language" }}">
<figcaption>
{{ if and (($.Scratch.Get "c-url") ($.Scratch.Get "c-title")) }}
{{ if and ($.Scratch.Get "c-url") ($.Scratch.Get "c-title") }}
<span>{{ $.Scratch.Get "c-title" }}</span><a href="{{ ($.Scratch.Get "c-url") | safeURL }}" target="_blank" rel="external">{{ $.Scratch.Get "c-link-text" | default ($.Scratch.Get "c-title") }}</a>
{{ else if $.Scratch.Get "c-title" }}
<span>{{ $.Scratch.Get "c-title" }}</span>
Expand All @@ -33,9 +33,9 @@
<pre>{{ range $index,$value := (split $trimmedContent "\n") }}<span class="line">{{ add $index 1 }}</span><br>{{ end }}</pre>
</td>
<td class="code">
<pre class="code-highlight language-{{ $.Scratch.Get "c-language" }}"><code class="{{ $.Scratch.Get "c-language" }}">{{ $trimmedContent }}</code></pre>
<pre class="code-highlight language-{{ $.Scratch.Get "c-language" }} {{ $.Scratch.Get "c-language" }}"><code class="{{ $.Scratch.Get "c-language" }}">{{ $trimmedContent }}</code></pre>
</td>
</tr>
</tbody>
</table>
</figure>
</figure>
11 changes: 9 additions & 2 deletions layouts/shortcodes/image.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@
{{ end }}
{{ end }}
{{ end }}
{{ $imgSrc := .Get "src" }}
{{ with $.Page.Resources.GetMatch $imgSrc}}
{{ $.Scratch.Set "imgURL" (.RelPermalink) }}
{{ else }}
{{ $.Scratch.Set "imgURL" ($imgSrc) }}
{{ end }}

<div class="figure {{ delimit ($.Scratch.Get "i-classes") " " }}" {{ with (.Get "thumbnailWidth") }}style="width:{{ . }};"{{ end }}>
{{ if eq ($.Scratch.Get "i-fancybox") 1 }}
<a class="fancybox" href="{{ .Get "src" }}"{{ with (.Get "title") }} title="{{ . }}"{{ end }} data-fancybox-group="{{ with (.Get "group") }}{{ . }}{{ end }}">
<a class="fancybox" href="{{ $.Scratch.Get "imgURL" }}"{{ with (.Get "title") }} title="{{ . }}"{{ end }} data-fancybox-group="{{ with (.Get "group") }}{{ . }}{{ end }}">
{{ end }}
<img class="fig-img" src="{{ with (.Get "thumbnail") }}{{ . }}{{ else }}{{ .Get "src" }}{{ end }}" {{ if or (.Get "thumbnail-width") (.Get "thumbnail-height") }}style="{{ with (.Get "thumbnail-width") }}width: {{ . }};{{ end }}{{ with (.Get "thumbnail-height") }}height: {{ . }};{{ end }}"{{ end }}{{ with (.Get "title") }} alt="{{ . }}"{{ end }}>
<img class="fig-img" src="{{ with (.Get "thumbnail") }}{{ . }}{{ else }}{{ $.Scratch.Get "imgURL" }}{{ end }}" {{ if or (.Get "thumbnail-width") (.Get "thumbnail-height") }}style="{{ with (.Get "thumbnail-width") }}width: {{ . }};{{ end }}{{ with (.Get "thumbnail-height") }}height: {{ . }};{{ end }}"{{ end }}{{ with (.Get "title") }} alt="{{ . }}"{{ end }}>
{{ if eq ($.Scratch.Get "i-fancybox") 1 }}
</a>
{{ end }}
Expand Down
10 changes: 5 additions & 5 deletions layouts/shortcodes/tabbed-codeblock.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{ end }}
<figure class="codeblock codeblock--tabbed">
<figcaption>
{{ if and (($.Scratch.Get "tc-url") ($.Scratch.Get "tc-title")) }}
{{ if and ($.Scratch.Get "tc-url") ($.Scratch.Get "tc-title") }}
<span><a href="{{ ($.Scratch.Get "tc-url") | safeURL }}">{{ $.Scratch.Get "tc-title" }}</a></span>
{{ else if $.Scratch.Get "tc-title" }}
<span>{{ $.Scratch.Get "tc-title" }}</span>
Expand All @@ -29,24 +29,24 @@
<li class="tab {{ if eq $index 0 }}active{{ end }}">{{ . }}</li>
{{ end }}
</ul>
</figcaption>
</figcaption>
<div class="tabs-content">
{{ range $index, $value := $.Scratch.Get "tc-content" }}
{{ $trimmedContent := trim $value "\n" }}
<figure class="highlight language-{{ index ($.Scratch.Get "tc-languages") $index }}" style="display: {{ if eq $index 0 }}block{{ else }}none{{ end }};">
<figure class="highlight language-{{ index ($.Scratch.Get "tc-languages") $index }} {{ index ($.Scratch.Get "tc-languages") $index }}" style="display: {{ if eq $index 0 }}block{{ else }}none{{ end }};">
<table>
<tbody>
<tr>
<td class="gutter">
<pre>{{ range $index,$value := (split $trimmedContent "\n") }}<span>{{ add $index 1 }}</span><br>{{ end }}</pre>
</td>
<td class="code">
<pre class="code-highlight language-{{ index ($.Scratch.Get "tc-languages") $index }}"><code class="{{ index ($.Scratch.Get "tc-languages") $index }}">{{ $trimmedContent }}</code></pre>
<pre class="code-highlight language-{{ index ($.Scratch.Get "tc-languages") $index }} {{ index ($.Scratch.Get "tc-languages") $index }}"><code class="{{ index ($.Scratch.Get "tc-languages") $index }}">{{ $trimmedContent }}</code></pre>
</td>
</tr>
</tbody>
</table>
</figure>
{{ end }}
</div>
</figure>
</figure>
10 changes: 8 additions & 2 deletions layouts/shortcodes/wide-image.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{{ $imgSrc := .Get "src" }}
{{ with $.Page.Resources.GetMatch $imgSrc}}
{{ $.Scratch.Set "imgURL" (.RelPermalink) }}
{{ else }}
{{ $.Scratch.Set "imgURL" ($imgSrc) }}
{{ end }}
</div>
<div class="figure figure--fullWidth">
<img class="figure-img" src="{{ .Get "src" }}" {{ with (.Get "title") }}alt="{{ . }}"{{ end }} />{{ with (.Get "title") }}<span class="caption">{{ . }}</span>{{ end }}
<img class="figure-img" src="{{ $.Scratch.Get "imgURL" }}" {{ with (.Get "title") }}alt="{{ . }}"{{ end }} />{{ with (.Get "title") }}<span class="caption">{{ . }}</span>{{ end }}
</div>
<div class="main-content-wrap">
<div class="main-content-wrap">
Loading