mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-14 02:46:16 +01:00
feat(rss): add rssFullText param for RSS (#301)
This commit is contained in:
parent
5b689bf29b
commit
e3e3bdf9ee
32 changed files with 113 additions and 127 deletions
|
@ -56,7 +56,8 @@
|
|||
@include overflow-wrap(break-word);
|
||||
box-sizing: border-box;
|
||||
top: if($header-normal-mode-desktop, 5rem, 10rem);
|
||||
left: $MAX_LENGTH;
|
||||
left: 0;
|
||||
visibility: hidden;
|
||||
|
||||
@include blur;
|
||||
|
||||
|
|
2
assets/js/theme.min.js
vendored
2
assets/js/theme.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -729,6 +729,9 @@ enableEmoji = true
|
|||
# whether to show link to Raw Markdown content of the content
|
||||
# 是否显示原始 Markdown 文档内容的链接
|
||||
linkToMarkdown = true
|
||||
# whether to show the full text content in RSS
|
||||
# 是否在 RSS 中显示全文内容
|
||||
rssFullText = false
|
||||
# Table of the contents config
|
||||
# 目录配置
|
||||
[params.page.toc]
|
||||
|
|
|
@ -401,6 +401,8 @@ Please open the code block below to view the complete sample configuration :(far
|
|||
fontawesome = true
|
||||
# whether to show link to Raw Markdown content of the content
|
||||
linkToMarkdown = true
|
||||
# {{< version 0.2.4 >}} whether to show the full text content in RSS
|
||||
rssFullText = false
|
||||
# {{< version 0.2.0 >}} Table of the contents config
|
||||
[params.page.toc]
|
||||
# whether to enable the table of the contents
|
||||
|
|
|
@ -406,6 +406,8 @@ Please open the code block below to view the complete sample configuration :(far
|
|||
fontawesome = true
|
||||
# whether to show link to Raw Markdown content of the content
|
||||
linkToMarkdown = true
|
||||
# {{< version 0.2.4 >}} whether to show the full text content in RSS
|
||||
rssFullText = false
|
||||
# {{< version 0.2.0 >}} Table of the contents config
|
||||
[params.page.toc]
|
||||
# whether to enable the table of the contents
|
||||
|
|
|
@ -404,6 +404,8 @@ hugo
|
|||
fontawesome = true
|
||||
# 是否在文章页面显示原始 Markdown 文档链接
|
||||
linkToMarkdown = true
|
||||
# {{< version 0.2.4 >}} 是否在 RSS 中显示全文内容
|
||||
rssFullText = false
|
||||
# {{< version 0.2.0 >}} 目录配置
|
||||
[params.page.toc]
|
||||
# 是否使用目录
|
||||
|
|
|
@ -68,6 +68,7 @@ ruby: true
|
|||
fraction: true
|
||||
fontawesome: true
|
||||
linkToMarkdown: true
|
||||
rssFullText: false
|
||||
|
||||
toc:
|
||||
enable: true
|
||||
|
@ -112,7 +113,8 @@ comment:
|
|||
* **ruby**: {{< version 0.2.0 >}} if `true`, the content will enable the [ruby extended syntax](#ruby).
|
||||
* **fraction**: {{< version 0.2.0 >}} if `true`, the content will enable the [fraction extended syntax](#fraction).
|
||||
* **fontawesome**: {{< version 0.2.0 >}} if `true`, the content will enable the [Font Awesome extended syntax](#fontawesome).
|
||||
* **linkToMarkdown**: if `true`, the footer of the content will show the link to the orignal Markdown file.
|
||||
* **linkToMarkdown**: if `true`, the footer of the content will be shown the link to the orignal Markdown file.
|
||||
* **rssFullText**: {{< version 0.2.4 >}} if `true`, the full text content will be shown in RSS.
|
||||
|
||||
* **toc**: {{< version 0.2.0 changed >}} the same as the `params.page.toc` part in the [site configuration](../theme-documentation-basics#site-configuration).
|
||||
* **code**: {{< version 0.2.0 >}} the same as the `params.page.code` part in the [site configuration](../theme-documentation-basics#site-configuration).
|
||||
|
|
|
@ -73,6 +73,7 @@ ruby: true
|
|||
fraction: true
|
||||
fontawesome: true
|
||||
linkToMarkdown: true
|
||||
rssFullText: false
|
||||
|
||||
toc:
|
||||
enable: true
|
||||
|
@ -117,7 +118,8 @@ comment:
|
|||
* **ruby**: {{< version 0.2.0 >}} if `true`, the content will enable the [ruby extended syntax](#ruby).
|
||||
* **fraction**: {{< version 0.2.0 >}} if `true`, the content will enable the [fraction extended syntax](#fraction).
|
||||
* **fontawesome**: {{< version 0.2.0 >}} if `true`, the content will enable the [Font Awesome extended syntax](#fontawesome).
|
||||
* **linkToMarkdown**: if `true`, the footer of the content will show the link to the orignal Markdown file.
|
||||
* **linkToMarkdown**: if `true`, the footer of the content will be shown the link to the orignal Markdown file.
|
||||
* **rssFullText**: {{< version 0.2.4 >}} if `true`, the full text content will be shown in RSS.
|
||||
|
||||
* **toc**: {{< version 0.2.0 changed >}} the same as the `params.page.toc` part in the [site configuration](../theme-documentation-basics#site-configuration).
|
||||
* **code**: {{< version 0.2.0 >}} the same as the `params.page.code` part in the [site configuration](../theme-documentation-basics#site-configuration).
|
||||
|
|
|
@ -68,6 +68,7 @@ ruby: true
|
|||
fraction: true
|
||||
fontawesome: true
|
||||
linkToMarkdown: true
|
||||
rssFullText: false
|
||||
|
||||
toc:
|
||||
enable: true
|
||||
|
@ -113,6 +114,7 @@ comment:
|
|||
* **fraction**: {{< version 0.2.0 >}} 如果设为 `true`, 这篇文章会使用 [分数扩展语法](#fraction).
|
||||
* **fontawesome**: {{< version 0.2.0 >}} 如果设为 `true`, 这篇文章会使用 [Font Awesome 扩展语法](#fontawesome).
|
||||
* **linkToMarkdown**: 如果设为 `true`, 内容的页脚将显示指向原始 Markdown 文件的链接.
|
||||
* **rssFullText**: {{< version 0.2.4 >}} 如果设为 `true`, 在 RSS 中将会显示全文内容.
|
||||
|
||||
* **toc**: {{< version 0.2.0 changed >}} 和 [网站配置](../theme-documentation-basics#site-configuration) 中的 `params.page.toc` 部分相同.
|
||||
* **code**: {{< version 0.2.0 >}} 和 [网站配置](../theme-documentation-basics#site-configuration) 中的 `params.page.code` 部分相同.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{{- with .Title -}}
|
||||
<figure>
|
||||
{{- partial "plugin/image.html" (dict "src" $.Destination "alt" $.Text "caption" . "linked" true) -}}
|
||||
{{- dict "src" $.Destination "alt" $.Text "caption" . "linked" true | partial "plugin/image.html" -}}
|
||||
<figcaption class="image-caption">
|
||||
{{- . | safeHTML -}}
|
||||
</figcaption>
|
||||
</figure>
|
||||
{{- else -}}
|
||||
{{- partial "plugin/image.html" (dict "src" .Destination "alt" .Text) -}}
|
||||
{{- dict "src" .Destination "alt" .Text | partial "plugin/image.html" -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div class="featured-image-preview">
|
||||
<a href="{{ $.RelPermalink }}">
|
||||
{{- $image := $params.featuredimagepreview | default . -}}
|
||||
{{- partial "plugin/image.html" (dict "src" $image "alt" $.Description "large" true) -}}
|
||||
{{- dict "src" $image "alt" $.Description "large" true | partial "plugin/image.html" -}}
|
||||
</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
|
|
@ -35,30 +35,7 @@
|
|||
{{- end -}}
|
||||
<atom:link href="{{ .Permalink }}" rel="self" type="application/rss+xml" />
|
||||
{{- range where .Site.RegularPages "Type" "posts" | first (.Site.Params.home.rss | default 10) -}}
|
||||
<item>
|
||||
<title>
|
||||
{{- .Title -}}
|
||||
</title>
|
||||
<link>
|
||||
{{- .Permalink -}}
|
||||
</link>
|
||||
<pubDate>
|
||||
{{- .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" -}}
|
||||
</pubDate>
|
||||
<author>
|
||||
{{- .Params.author | default $.Site.Author.name | default (T "author") -}}
|
||||
</author>
|
||||
<guid>
|
||||
{{- .Permalink -}}
|
||||
</guid>
|
||||
<description>
|
||||
{{- with .Summary -}}
|
||||
{{- dict "content" . "ruby" true "fraction" true "fontawesome" true | partial "function/content.html" | plainify -}}
|
||||
{{- else -}}
|
||||
{{- .Description | plainify -}}
|
||||
{{- end -}}
|
||||
</description>
|
||||
</item>
|
||||
{{- dict "page" . "site" .Site | partial "rss/item.html" -}}
|
||||
{{- end -}}
|
||||
</channel>
|
||||
</rss>
|
||||
|
|
|
@ -182,7 +182,7 @@
|
|||
</script>
|
||||
|
||||
{{- /* Polyfill.io */ -}}
|
||||
{{- partial "plugin/script.html" (dict "source" "https://polyfill.io/v3/polyfill.min.js?features=Element.prototype.closest%2CrequestAnimationFrame%2CCustomEvent%2CPromise%2CObject.entries%2CObject.assign%2CObject.values%2Cfetch%2CElement.prototype.after%2CArray.prototype.fill%2CIntersectionObserver%2CArray.from%2CArray.prototype.find%2CMath.sign") -}}
|
||||
{{- dict "source" "https://polyfill.io/v3/polyfill.min.js?features=Element.prototype.closest%2CrequestAnimationFrame%2CCustomEvent%2CPromise%2CObject.entries%2CObject.assign%2CObject.values%2Cfetch%2CElement.prototype.after%2CArray.prototype.fill%2CIntersectionObserver%2CArray.from%2CArray.prototype.find%2CMath.sign" | partial "plugin/script.html" -}}
|
||||
|
||||
{{- range (.Scratch.Get "this").script -}}
|
||||
{{- partial "plugin/script.html" . -}}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<a href="{{ .Site.Home.RelPermalink }}" title="{{ .Site.Title }}">
|
||||
{{- with .Site.Params.header.title -}}
|
||||
{{- with .logo -}}
|
||||
{{- partial "plugin/image.html" (dict "src" . "alt" $.Site.Title "class" "logo") -}}
|
||||
{{- dict "src" . "alt" $.Site.Title "class" "logo" | partial "plugin/image.html" -}}
|
||||
{{- end -}}
|
||||
{{- with .pre -}}
|
||||
<span class="header-title-pre">{{ . | safeHTML }}</span>
|
||||
|
@ -83,7 +83,7 @@
|
|||
<a href="{{ .Site.Home.RelPermalink }}" title="{{ .Site.Title }}">
|
||||
{{- with .Site.Params.header.title -}}
|
||||
{{- with .logo -}}
|
||||
{{- partial "plugin/image.html" (dict "src" . "alt" $.Site.Title "class" "logo") -}}
|
||||
{{- dict "src" . "alt" $.Site.Title "class" "logo" | partial "plugin/image.html" -}}
|
||||
{{- end -}}
|
||||
{{- with .pre -}}
|
||||
<span class="header-title-pre">{{ . | safeHTML }}</span>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
{{- with $avatar -}}
|
||||
<div class="home-avatar">
|
||||
<a href="/posts" title="{{ T `home` }}">
|
||||
{{- partial "plugin/image.html" (dict "src" . "alt" (T "home")) -}}
|
||||
{{- dict "src" . "alt" (T "home") | partial "plugin/image.html" -}}
|
||||
</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
@ -14,7 +14,7 @@
|
|||
{{- with .Site.Params.home.profile.subtitle -}}
|
||||
<h2 class="home-subtitle">
|
||||
{{- if $.Site.Params.home.profile.typeit -}}
|
||||
{{- $id := partial "function/id.html" (dict "content" . "scratch" $.Scratch) -}}
|
||||
{{- $id := dict "content" . "scratch" $.Scratch | partial "function/id.html" -}}
|
||||
<div id="{{ $id }}" class="typeit"></div>
|
||||
{{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
|
||||
{{- else -}}
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
<img
|
||||
class="lazyload{{ with .class }} {{ . }}{{ end }}"
|
||||
src="{{ $loading.RelPermalink }}"
|
||||
data-sizes="auto"
|
||||
data-srcset="{{ $small | relURL }}, {{ .src | relURL }} 1.5x, {{ $large | relURL }} 2x"
|
||||
data-src="{{ .src | relURL }}"
|
||||
data-srcset="{{ $small | relURL }}, {{ .src | relURL }} 1.5x, {{ $large | relURL }} 2x"
|
||||
data-sizes="auto"
|
||||
alt="{{ $alt }}"{{ with .height }} height="{{ . }}"{{ end }}{{ with .width }} width="{{ . }}"{{ end }} />
|
||||
</a>
|
||||
{{- else -}}
|
||||
|
@ -20,9 +20,9 @@
|
|||
<img
|
||||
class="lazyload{{ with .class }} {{ . }}{{ end }}"
|
||||
src="{{ $loading.RelPermalink }}"
|
||||
data-sizes="auto"
|
||||
data-srcset="{{ $small | relURL }}, {{ .src | relURL }} 1.5x, {{ $large | relURL }} 2x"
|
||||
data-src="{{ .src | relURL }}"
|
||||
data-srcset="{{ $small | relURL }}, {{ .src | relURL }} 1.5x, {{ $large | relURL }} 2x"
|
||||
data-sizes="auto"
|
||||
alt="{{ $alt }}"
|
||||
title="{{ .title | default $alt }}"{{ with .height }} height="{{ . }}"{{ end }}{{ with .width }} width="{{ . }}"{{ end }} />
|
||||
{{- end -}}
|
||||
|
|
|
@ -4,196 +4,196 @@
|
|||
{{- /* 001: Twitter */ -}}
|
||||
{{- if $share.Twitter -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Twitter" data-sharer="twitter" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Site.Params.Social.Twitter }} data-via="{{ . }}"{{ end }}{{ with .Params.tags }} data-hashtags="{{ delimit . `,` }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-twitter fa-fw") -}}
|
||||
{{- dict "class" "fab fa-twitter fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 002: Facebook */ -}}
|
||||
{{- if $share.Facebook -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Facebook" data-sharer="facebook" data-url="{{ .Permalink }}"{{ with .Params.tags }} data-hashtag="{{ index . 0 }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-facebook-square fa-fw") -}}
|
||||
{{- dict "class" "fab fa-facebook-square fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 003: Linkedin */ -}}
|
||||
{{- if $share.Linkedin -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Linkedin" data-sharer="linkedin" data-url="{{ .Permalink }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-linkedin fa-fw") -}}
|
||||
{{- dict "class" "fab fa-linkedin fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 004: WhatsApp */ -}}
|
||||
{{- if $share.Whatsapp -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} WhatsApp" data-sharer="whatsapp" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-web>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-whatsapp fa-fw") -}}
|
||||
{{- dict "class" "fab fa-whatsapp fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 005: Viber */ -}}
|
||||
{{- if $share.Viber -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Viber" data-sharer="viber" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-viber fa-fw") -}}
|
||||
{{- dict "class" "fab fa-viber fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 006: Pinterest */ -}}
|
||||
{{- if $share.Pinterest -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Pinterest" data-sharer="pinterest" data-url="{{ .Permalink }}"{{ with .Description }} data-description="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-pinterest fa-fw") -}}
|
||||
{{- dict "class" "fab fa-pinterest fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 007: Tumblr */ -}}
|
||||
{{- if $share.Tumblr -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Tumblr" data-sharer="tumblr" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Description }} data-caption="{{ . }}"{{ end }}{{ with .Params.tags }} data-tags="{{ delimit . `,` }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-tumblr fa-fw") -}}
|
||||
{{- dict "class" "fab fa-tumblr fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 008: Hacker News */ -}}
|
||||
{{- if $share.Hackernews -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Hacker News" data-sharer="hackernews" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-hacker-news fa-fw") -}}
|
||||
{{- dict "class" "fab fa-hacker-news fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 009: Reddit */ -}}
|
||||
{{- if $share.Reddit -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Reddit" data-sharer="reddit" data-url="{{ .Permalink }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-reddit fa-fw") -}}
|
||||
{{- dict "class" "fab fa-reddit fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 010: VK */ -}}
|
||||
{{- if $share.VK -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} VK" data-sharer="vk" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Description }} data-caption="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-vk fa-fw") -}}
|
||||
{{- dict "class" "fab fa-vk fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 011: Buffer */ -}}
|
||||
{{- if $share.Buffer -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Buffer" data-sharer="buffer" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Site.Params.Social.Twitter }} data-via="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-picture="{{ . }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-buffer fa-fw") -}}
|
||||
{{- dict "class" "fab fa-buffer fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 012: Xing */ -}}
|
||||
{{- if $share.Xing -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Xing" data-sharer="xing" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-xing fa-fw") -}}
|
||||
{{- dict "class" "fab fa-xing fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 013: Line */ -}}
|
||||
{{- if $share.Line -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Line" data-sharer="line" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-line fa-fw") -}}
|
||||
{{- dict "class" "fab fa-line fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 014: Instapaper */ -}}
|
||||
{{- if $share.Instapaper -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Instapaper" data-sharer="instapaper" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
|
||||
{{- partial "plugin/icon.html" (dict "simpleicons" "instapaper" "prefix" (.Scratch.Get "cdn" | default dict).simpleIconsPrefix) -}}
|
||||
{{- dict "simpleicons" "instapaper" "prefix" (.Scratch.Get "cdn" | default dict).simpleIconsPrefix | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 015: Pocket */ -}}
|
||||
{{- if $share.Pocket -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Pocket" data-sharer="pocket" data-url="{{ .Permalink }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-get-pocket fa-fw") -}}
|
||||
{{- dict "class" "fab fa-get-pocket fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 016: Digg */ -}}
|
||||
{{- if $share.Digg -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Digg" data-sharer="digg" data-url="{{ .Permalink }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-digg fa-fw") -}}
|
||||
{{- dict "class" "fab fa-digg fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 017: StumbleUpon */ -}}
|
||||
{{- if $share.Stumbleupon -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} StumbleUpon" data-sharer="stumbleupon" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-stumbleupon fa-fw") -}}
|
||||
{{- dict "class" "fab fa-stumbleupon fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 018: Flipboard */ -}}
|
||||
{{- if $share.Flipboard -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Flipboard" data-sharer="flipboard" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-flipboard fa-fw") -}}
|
||||
{{- dict "class" "fab fa-flipboard fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 019: 微博 */ -}}
|
||||
{{- if $share.Weibo -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} 微博" data-sharer="weibo" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}{{ with .Site.Params.Social.Weibo }} data-ralateuid="{{ . }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-weibo fa-fw") -}}
|
||||
{{- dict "class" "fab fa-weibo fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 020: 人人 */ -}}
|
||||
{{- if $share.Renren -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} 人人" data-sharer="renren" data-url="{{ .Permalink }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-renren fa-fw") -}}
|
||||
{{- dict "class" "fab fa-renren fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 021: Myspace */ -}}
|
||||
{{- if $share.Myspace -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Myspace" data-sharer="myspace" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
|
||||
{{- partial "plugin/icon.html" (dict "simpleicons" "myspace" "prefix" (.Scratch.Get "cdn" | default dict).simpleIconsPrefix) -}}
|
||||
{{- dict "simpleicons" "myspace" "prefix" (.Scratch.Get "cdn" | default dict).simpleIconsPrefix | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 022: Blogger */ -}}
|
||||
{{- if $share.Blogger -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Blogger" data-sharer="blogger" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-blogger fa-fw") -}}
|
||||
{{- dict "class" "fab fa-blogger fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 023: 百度 */ -}}
|
||||
{{- if $share.Baidu -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} 百度" data-sharer="baidu" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "simpleicons" "baidu" "prefix" (.Scratch.Get "cdn" | default dict).simpleIconsPrefix) -}}
|
||||
{{- dict "simpleicons" "baidu" "prefix" (.Scratch.Get "cdn" | default dict).simpleIconsPrefix | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 024: OK.RU */ -}}
|
||||
{{- if $share.Odnoklassniki -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} OK.RU" data-sharer="okru" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-odnoklassniki fa-fw") -}}
|
||||
{{- dict "class" "fab fa-odnoklassniki fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 025: Evernote */ -}}
|
||||
{{- if $share.Evernote -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Evernote" data-sharer="evernote" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-evernote fa-fw") -}}
|
||||
{{- dict "class" "fab fa-evernote fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 026: Skype */ -}}
|
||||
{{- if $share.Skype -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Skype" data-sharer="skype" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-skype fa-fw") -}}
|
||||
{{- dict "class" "fab fa-skype fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 027: Trello */ -}}
|
||||
{{- if $share.Trello -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Trello" data-sharer="trello" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-trello fa-fw") -}}
|
||||
{{- dict "class" "fab fa-trello fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 028: Mix */ -}}
|
||||
{{- if $share.Mix -}}
|
||||
<a href="//mix.com/add?url={{ .Permalink }}&description={{ .Title }}" target="_blank" title="{{ T `shareOn` }} Mix">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-mix fa-fw") -}}
|
||||
{{- dict "class" "fab fa-mix fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
36
layouts/partials/rss/item.html
Normal file
36
layouts/partials/rss/item.html
Normal file
|
@ -0,0 +1,36 @@
|
|||
{{- $params := .page.Params | merge .site.Params.page | merge (dict "author" .site.Author.name) -}}
|
||||
<item>
|
||||
<title>
|
||||
{{- .page.Title -}}
|
||||
</title>
|
||||
<link>
|
||||
{{- .page.Permalink -}}
|
||||
</link>
|
||||
<pubDate>
|
||||
{{- .page.Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" -}}
|
||||
</pubDate>
|
||||
<author>
|
||||
{{- .params.author | default (T "author") -}}
|
||||
</author>
|
||||
<guid>
|
||||
{{- .page.Permalink -}}
|
||||
</guid>
|
||||
<description>
|
||||
{{- "<![CDATA[" | safeHTML -}}
|
||||
{{- with $params.featuredimage -}}
|
||||
<div class="featured-image">
|
||||
<img src="{{ . | relURL }}" referrerpolicy="no-referrer">
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- $content := .page.Description -}}
|
||||
{{- if $params.rssFullText -}}
|
||||
{{- $content = dict "content" .page.Content "ruby" $params.ruby "fraction" $params.fraction "fontawesome" $params.fontawesome | partial "function/content.html" -}}
|
||||
{{- else -}}
|
||||
{{- with .page.Summary -}}
|
||||
{{- $content = dict "content" . "ruby" $params.ruby "fraction" $params.fraction "fontawesome" $params.fontawesome | partial "function/content.html" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $content | replaceRE `<figure[^>]*>.*</figure>` "" | replaceRE `<img[^>]*( /)?>` "" | safeHTML -}}
|
||||
{{- "]]>" | safeHTML -}}
|
||||
</description>
|
||||
</item>
|
|
@ -35,30 +35,7 @@
|
|||
{{- end -}}
|
||||
<atom:link href="{{ .Permalink }}" rel="self" type="application/rss+xml" />
|
||||
{{- range .Pages | first (.Site.Params.section.rss | default 10) -}}
|
||||
<item>
|
||||
<title>
|
||||
{{- .Title -}}
|
||||
</title>
|
||||
<link>
|
||||
{{- .Permalink -}}
|
||||
</link>
|
||||
<pubDate>
|
||||
{{- .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" -}}
|
||||
</pubDate>
|
||||
<author>
|
||||
{{- .Params.author | default $.Site.Author.name | default (T "author") -}}
|
||||
</author>
|
||||
<guid>
|
||||
{{- .Permalink -}}
|
||||
</guid>
|
||||
<description>
|
||||
{{- with .Summary -}}
|
||||
{{- dict "content" . "ruby" true "fraction" true "fontawesome" true | partial "function/content.html" | plainify -}}
|
||||
{{- else -}}
|
||||
{{- .Description | plainify -}}
|
||||
{{- end -}}
|
||||
</description>
|
||||
</item>
|
||||
{{- dict "page" . "site" .Site | partial "rss/item.html" -}}
|
||||
{{- end -}}
|
||||
</channel>
|
||||
</rss>
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
{{- /* Featured image */ -}}
|
||||
{{- with $params.featuredimage -}}
|
||||
<div class="featured-image">
|
||||
{{- partial "plugin/image.html" (dict "src" . "alt" $.Description "large" true) -}}
|
||||
{{- dict "src" . "alt" $.Description "large" true | partial "plugin/image.html" -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{- $content := .Inner | transform.Unmarshal | jsonify -}}
|
||||
{{- $id := partial "function/id.html" (dict "content" $content "scratch" .Page.Scratch) -}}
|
||||
{{- $id := dict "content" $content "scratch" .Page.Scratch | partial "function/id.html" -}}
|
||||
{{- $width := cond .IsNamedParams (.Get "width") (.Get 0) | default "100%" -}}
|
||||
{{- $height := cond .IsNamedParams (.Get "height") (.Get 1) | default "30rem" -}}
|
||||
<div class="echarts" id="{{ $id }}" style="width: {{ $width }}; height: {{ $height }};"></div>
|
||||
|
|
|
@ -28,6 +28,6 @@
|
|||
{{- end -}}
|
||||
{{- $darkStyle = $darkStyle | default $lightStyle -}}
|
||||
{{- $options := dict "lng" $lng "lat" $lat "zoom" $zoom "marked" $marked "lightStyle" $lightStyle "darkStyle" $darkStyle "geolocate" $geolocate "navigation" $navigation "scale" $scale "fullscreen" $fullscreen -}}
|
||||
{{- $id := partial "function/id.html" (dict "content" $options "scratch" .Page.Scratch) -}}
|
||||
{{- $id := dict "content" $options "scratch" .Page.Scratch | partial "function/id.html" -}}
|
||||
<div class="mapbox" id="{{ $id }}" style="width: {{ $width }}; height: {{ $height }};"></div>
|
||||
{{- .Page.Scratch.SetInMap "this" "mapbox" true -}}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{{- $id := partial "function/id.html" (dict "content" (trim .Inner "\n") "scratch" .Page.Scratch) -}}
|
||||
{{- $id := dict "content" (trim .Inner "\n") "scratch" .Page.Scratch | partial "function/id.html" -}}
|
||||
<div class="mermaid" id="{{ $id }}"></div>
|
||||
{{- .Page.Scratch.SetInMap "this" "mermaid" true -}}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{- $content := .Inner | .Page.RenderString -}}
|
||||
{{- $id := partial "function/id.html" (dict "content" $content) -}}
|
||||
{{- $id := dict "content" $content | partial "function/id.html" -}}
|
||||
{{- $tag := .Get 1 | default "div" -}}
|
||||
{{- printf `<%s id="%s">%s</%s>` $tag $id $content $tag | safeHTML -}}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
{{- /* trim the newline */ -}}
|
||||
{{- $content = trim $content "\n" -}}
|
||||
{{- $id := partial "function/id.html" (dict "content" $content "scratch" .Page.Scratch) -}}
|
||||
{{- $id := dict "content" $content "scratch" .Page.Scratch | partial "function/id.html" -}}
|
||||
{{- $key := .Get "group" | string | default $id -}}
|
||||
{{- $typeitMap := (.Page.Scratch.Get "this").typeitMap | default dict -}}
|
||||
{{- $group := index $typeitMap $key -}}
|
||||
|
|
|
@ -8,4 +8,6 @@
|
|||
{{- $res := resources.Get "svg/version.template.svg" -}}
|
||||
{{- $res = $res | resources.ExecuteAsTemplate $path (dict "version" $version "label" $label "color" $color) | minify -}}
|
||||
{{- $alt := printf "LoveIt %s | %s" $label $version -}}
|
||||
<a href="{{ $url }}" rel="noopener noreffer" target="_blank">{{ partial "plugin/image.html" (dict "src" $res.RelPermalink "alt" $alt "class" "version") }}</a>
|
||||
<a href="{{ $url }}" rel="noopener noreffer" target="_blank">
|
||||
{{- dict "src" $res.RelPermalink "alt" $alt "class" "version" | partial "plugin/image.html" -}}
|
||||
</a>
|
|
@ -35,30 +35,7 @@
|
|||
{{- end -}}
|
||||
<atom:link href="{{ .Permalink }}" rel="self" type="application/rss+xml" />
|
||||
{{- range .Pages | first (.Site.Params.list.rss | default 10) -}}
|
||||
<item>
|
||||
<title>
|
||||
{{- .Title -}}
|
||||
</title>
|
||||
<link>
|
||||
{{- .Permalink -}}
|
||||
</link>
|
||||
<pubDate>
|
||||
{{- .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" -}}
|
||||
</pubDate>
|
||||
<author>
|
||||
{{- .Params.author | default $.Site.Author.name | default (T "author") -}}
|
||||
</author>
|
||||
<guid>
|
||||
{{- .Permalink -}}
|
||||
</guid>
|
||||
<description>
|
||||
{{- with .Summary -}}
|
||||
{{- dict "content" . "ruby" true "fraction" true "fontawesome" true | partial "function/content.html" | plainify -}}
|
||||
{{- else -}}
|
||||
{{- .Description | plainify -}}
|
||||
{{- end -}}
|
||||
</description>
|
||||
</item>
|
||||
{{- dict "page" . "site" .Site | partial "rss/item.html" -}}
|
||||
{{- end -}}
|
||||
</channel>
|
||||
</rss>
|
||||
|
|
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
|
@ -413,6 +413,7 @@ class Theme {
|
|||
const rect = $page.getBoundingClientRect();
|
||||
$toc.style.left = `${rect.left + rect.width + 20}px`;
|
||||
$toc.style.maxWidth = `${$page.getBoundingClientRect().left - 20}px`;
|
||||
$toc.style.visibility = 'visible';
|
||||
const $tocLinkElements = $tocCore.querySelectorAll('a:first-child');
|
||||
const $tocLiElements = $tocCore.getElementsByTagName('li');
|
||||
const $headerLinkElements = document.getElementsByClassName('headerLink');
|
||||
|
|
Loading…
Reference in a new issue