Compare commits

...
15 Commits
Author SHA1 Message Date
Jimmy Cai 1300e0d714 release: 2.3.0 2021-03-27 23:39:29 +01:00
Jimmy CaiandGitHub 5d004786d6 Merge pull request #174 from totoroot/main
i18n: German translation
2021-03-27 23:35:54 +01:00
Matthias Thym 87fad5fd81 refactor: add missing i18n option 'es' 2021-03-27 14:38:36 +01:00
Matthias Thym 21a5834a2f i18n: German translation 2021-03-27 14:38:36 +01:00
Jimmy CaiandGitHub 3e8490da1d fix: incorrect image & menu path for site hosted in subdir (#168) 2021-03-07 13:13:07 +01:00
Jimmy CaiandGitHub 9befda7310 refactor: add exampleSite menu using FrontMatter (#167) 2021-03-07 13:02:39 +01:00
Jimmy CaiandGitHub d5268a41e0 refactor(article): add default padding (#166)
* refactor(article): add default padding

closes https://github.com/CaiJimmy/hugo-theme-stack/issues/165

* fix(article): video iframe margin

* fix: remove youtube iframe border
2021-03-07 12:51:47 +01:00
Yihui XieandGitHub 38eb9c4eaf fix(article): also define the padding for div under .article-content (#162)
Fixes rstudio/blogdown#591: not only `<p>` but also `<div>` could be the direct child of `.article-content`, so we also need the padding for `<div>`. The `div`s are generated by Pandoc, instead of Hugo's Markdown renderer. I think it will be great to support both ways.
2021-03-06 20:41:46 +01:00
e61bca1dbd i18n: Spanish translation (#155)
Co-authored-by: Jimmy Cai <[email protected]>
2021-02-26 17:43:47 +01:00
Jimmy CaiandGitHub 96db925b06 ci: exclude image cache from artifact 2021-02-17 10:34:08 +01:00
Jimmy CaiandGitHub 0429678d57 fix(scss): remove unnecessary import (#146) 2021-02-17 10:29:40 +01:00
Jimmy Cai cef9fe2549 release: v2.2.0 2021-02-13 16:30:01 +01:00
Jimmy CaiandGitHub 21b42f0b6c feat: add archetypes (#145) 2021-02-13 15:55:56 +01:00
Jimmy CaiandGitHub 79412144d9 fix: disable svg image processing (#144)
* fix: disable svg image processing

closes https://github.com/CaiJimmy/hugo-theme-stack/issues/132

* style: remove extra blank space
2021-02-13 12:57:19 +01:00
79d8c1db38 feat: Tencent video shortcode and remark42 integration (#143)
* 增加remark42的评论系统支持,config中增加对应配置。

* remark42评论系统,语言配置加入到config中,修正切换theme时评论区跟随主题切换。

* - 新增腾讯视频的支持
- 支持通过frontmatter配置在文章中插入音频

* 更新readme

* Delete README.md

* Create README.md

* Remove MetingJS

* fix(shortcode/tencent): switch to HTML5

The old one was showing video using Flash.

* style(comments): clean remark42 integration code

Co-authored-by: wood <[email protected]>
Co-authored-by: Wood <[email protected]>
2021-02-13 11:10:24 +01:00
20 changed files with 260 additions and 61 deletions
+3 -1
View File
@@ -39,4 +39,6 @@ jobs:
# Artifact name # Artifact name
name: resources name: resources
# A file, directory or wildcard pattern that describes what to upload # A file, directory or wildcard pattern that describes what to upload
path: exampleSite/resources path: |
exampleSite/resources
!exampleSite/resources/_gen/images
+7
View File
@@ -0,0 +1,7 @@
---
title: "{{ replace .Name "-" " " | title }}"
image:
style:
background: "#2a9d8f"
color: "#fff"
---
+11 -2
View File
@@ -1,2 +1,11 @@
+++ ---
+++ title: "{{ replace .Name "-" " " | title }}"
description:
date: {{ .Date }}
image:
math:
license:
hidden: false
comments: true
draft: true
---
+5
View File
@@ -0,0 +1,5 @@
---
title: "{{ replace .Name "-" " " | title }}"
description:
image:
---
+34 -14
View File
@@ -1,5 +1,3 @@
@import "variables.scss";
.keep-sidebar { .keep-sidebar {
@media (min-width: $on-phone) and (max-width: $on-tablet) { @media (min-width: $on-phone) and (max-width: $on-tablet) {
--main-top-padding: 50px; --main-top-padding: 50px;
@@ -189,11 +187,11 @@
.article-content { .article-content {
font-family: var(--article-font-family); font-family: var(--article-font-family);
font-size: var(--article-font-size); font-size: var(--article-font-size);
padding: 0 var(--card-padding);
line-height: var(--article-line-height); line-height: var(--article-line-height);
& > p { & > p {
margin: 1.5em 0; margin: 1.5em 0;
padding: 0 var(--card-padding);
} }
h1, h1,
@@ -202,12 +200,12 @@
h4, h4,
h5, h5,
h6 { h6 {
padding: 0 calc(var(--card-padding) - var(--heading-border-size)); margin-left: calc((var(--card-padding)) * -1);
padding-left: calc(var(--card-padding) - var(--heading-border-size));
border-left: var(--heading-border-size) solid var(--accent-color); border-left: var(--heading-border-size) solid var(--accent-color);
} }
figure { figure {
margin: 0 auto;
text-align: center; text-align: center;
figcaption { figcaption {
@@ -218,17 +216,12 @@
blockquote { blockquote {
position: relative; position: relative;
margin: 10px 0; margin: 1.5em 0;
border-left: var(--blockquote-border-size) solid var(--card-separator-color); border-left: var(--blockquote-border-size) solid var(--card-separator-color);
padding: 15px calc(var(--card-padding) - var(--blockquote-border-size)); padding: 15px calc(var(--card-padding) - var(--blockquote-border-size));
background-color: var(--blockquote-background-color); background-color: var(--blockquote-background-color);
} }
& > ul,
& > ol {
margin: 1em var(--card-padding);
}
hr { hr {
width: 100px; width: 100px;
margin: 40px auto; margin: 40px auto;
@@ -251,7 +244,7 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
margin: 20px 0; margin: 1.5em 0;
figure { figure {
margin: 0; margin: 0;
@@ -281,9 +274,7 @@
} }
table { table {
margin: 0 var(--card-padding);
width: 100%; width: 100%;
max-width: calc(100% - var(--card-padding) * 2);
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
margin-bottom: 1.5em; margin-bottom: 1.5em;
@@ -308,4 +299,33 @@
.twitter-tweet { .twitter-tweet {
color: var(--card-text-color-main); color: var(--card-text-color-main);
} }
.video-wrapper {
position: relative;
width: 100%;
height: 0;
padding-bottom: 56.25%;
overflow: hidden;
& > iframe {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
border: 0;
}
}
/// Negative margins
blockquote,
figure,
.gallery,
pre,
.video-wrapper,
.s_video_simple {
margin-left: calc((var(--card-padding)) * -1);
margin-right: calc((var(--card-padding)) * -1);
width: calc(100% + var(--card-padding) * 2);
}
} }
+10 -19
View File
@@ -11,7 +11,7 @@ disqusShortname: hugo-theme-stack
googleAnalytics: googleAnalytics:
# Theme i18n support # Theme i18n support
# Available values: en, fr, id, ja, ko, pt-br, zh-cn # Available values: en, fr, id, ja, ko, pt-br, zh-cn, es, de
DefaultContentLanguage: en DefaultContentLanguage: en
permalinks: permalinks:
@@ -49,11 +49,17 @@ params:
comments: comments:
enabled: true enabled: true
provider: disqus provider: disqus
utterances: utterances:
repo: repo:
issueTerm: pathname issueTerm: pathname
label: label:
remark42:
host:
site:
locale:
widgets: widgets:
enabled: enabled:
- search - search
@@ -93,6 +99,9 @@ params:
content: content:
enabled: true enabled: true
### Custom menu
### See https://docs.stack.jimmycai.com/configuration/custom-menu
### To remove about, archive and search page menu item, remove `menu` field from their FrontMatter
menu: menu:
main: main:
- identifier: home - identifier: home
@@ -101,24 +110,6 @@ menu:
weight: -100 weight: -100
pre: home pre: home
- identifier: about
name: About
url: about
weight: -90
pre: user
- identifier: archives
name: Archives
url: archives
weight: -70
pre: archives
- identifier: search
name: Search
url: search
weight: -60
pre: search
related: related:
includeNewer: true includeNewer: true
threshold: 60 threshold: 60
+15 -9
View File
@@ -1,12 +1,18 @@
+++ ---
title = "About" title: About
description = "Hugo, the world's fastest framework for building websites" description: Hugo, the world's fastest framework for building websites
date = "2019-02-28" date: '2019-02-28'
aliases = ["about-us", "about-hugo", "contact"] aliases:
author = "Hugo Authors" - about-us
license = "CC BY-NC-ND" - about-hugo
lastmod = "2020-10-09" - contact
+++ license: CC BY-NC-ND
lastmod: '2020-10-09'
menu:
main:
weight: -90
pre: user
---
Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows. Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows.
+4
View File
@@ -3,4 +3,8 @@ title: "Archives"
date: 2019-05-28 date: 2019-05-28
layout: "archives" layout: "archives"
slug: "archives" slug: "archives"
menu:
main:
weight: -70
pre: archives
--- ---
+4
View File
@@ -5,4 +5,8 @@ layout: "search"
outputs: outputs:
- html - html
- json - json
menu:
main:
weight: -60
pre: search
--- ---
+53
View File
@@ -0,0 +1,53 @@
toggleMenu:
other: Menü umschalten
darkMode:
other: Dunkler Modus
list:
page:
one: "{{ .Count }} Seite"
other: "{{ .Count }} Seiten"
section:
other: Abschnitt
subsection:
one: Unterabschnitt
other: Unterabschnitte
article:
relatedContents:
other: Verwandte Inhalte
lastUpdatedOn:
other: Zuletzt aktualisiert am
notFound:
title:
other: Seite nicht gefunden
subtitle:
other: Diese Seite existiert nicht.
widget:
archives:
title:
other: Archiv
more:
other: Weitere
tagCloud:
title:
other: Schlagwörter
search:
title:
other: Suche
placeholder:
other: Etwas tippen...
resultTitle:
other: "#PAGES_COUNT pages (#TIME_SECONDS seconds)"
footer:
builtWith:
other: Erstellt mit {{ .Generator }}
designedBy:
other: Theme {{ .Theme }} gestaltet von {{ .DesignedBy }}
+53
View File
@@ -0,0 +1,53 @@
toggleMenu:
other: Toggle Menu
darkMode:
other: Modo oscuro
list:
page:
one: "{{ .Count }} página"
other: "{{ .Count }} páginas"
section:
other: Sección
subsection:
one: Subsección
other: Subsecciones
article:
relatedContents:
other: Contenidos relacionados
lastUpdatedOn:
other: Última vez actualizado
notFound:
title:
other: No Encontrado
subtitle:
other: Esta página no existe
widget:
archives:
title:
other: Archivo
more:
other: Más
tagCloud:
title:
other: Etiquetas
search:
title:
other: Búsqueda
placeholder:
other: Teclea algo...
resultTitle:
other: "#PAGES_COUNT páginas en (#TIME_SECONDS segundos)"
footer:
builtWith:
other: Creado con {{ .Generator }}
designedBy:
other: Tema {{ .Theme }} diseñado por {{ .DesignedBy }}
+2 -2
View File
@@ -1,5 +1,5 @@
{{- $image := .Page.Resources.GetMatch (printf "%s" (.Destination | safeURL)) -}} {{- $image := .Page.Resources.GetMatch (printf "%s" (.Destination | safeURL)) -}}
{{- if $image -}} {{- if and $image (ne (path.Ext .Destination) ".svg") -}}
{{- $alt := .PlainText | safeHTML -}} {{- $alt := .PlainText | safeHTML -}}
<figure style="flex-grow: {{ div (mul $image.Width 100) $image.Height }}; flex-basis: {{ div (mul $image.Width 240) $image.Height }}px"> <figure style="flex-grow: {{ div (mul $image.Width 100) $image.Height }}; flex-basis: {{ div (mul $image.Width 240) $image.Height }}px">
<a href="{{ $image.RelPermalink }}" data-size="{{ $image.Width }}x{{ $image.Height }}"> <a href="{{ $image.RelPermalink }}" data-size="{{ $image.Width }}x{{ $image.Height }}">
@@ -26,5 +26,5 @@
{{ end }} {{ end }}
</figure> </figure>
{{- else -}} {{- else -}}
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}"{{ end }} /> <img src="{{ .Destination | relURL | safeURL }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}"{{ end }} />
{{- end -}} {{- end -}}
@@ -0,0 +1,29 @@
{{- with .Site.Params.comments.remark42 -}}
<div id="remark42"></div>
<script>
var remark_config = {
host: "{{ .host }}",
site_id: '{{ .site }}',
components: ['embed'],
url: "{{ $.Permalink }}",
max_shown_comments: {{ default 15 .max_shown_comments }},
theme: document.body.dataset.scheme,
page_title: '{{ $.Title }}',
locale: '{{ default "en" .locale }}',
show_email_subscription: {{ default true .show_email_subscription }}
};
(function (c) {
for (var i = 0; i < c.length; i++) {
var d = document, s = d.createElement('script');
s.src = remark_config.host + '/web/' + c[i] + '.js';
s.defer = true;
(d.head || d.body).appendChild(s);
}
})(remark_config.components || ['embed']);
window.addEventListener('onColorSchemeChange', (e) => {
window.REMARK42.changeTheme(e.detail);
})
</script>
{{- end -}}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- $ThemeVersion := "2.1.0" -}} {{- $ThemeVersion := "2.3.0" -}}
<footer class="site-footer"> <footer class="site-footer">
<section class="copyright"> <section class="copyright">
&copy; &copy;
+7 -3
View File
@@ -16,10 +16,14 @@
{{ if $pageResourceImage }} {{ if $pageResourceImage }}
<!-- If image is found under page bundle --> <!-- If image is found under page bundle -->
{{ $result = merge $result (dict "permalink" $pageResourceImage.RelPermalink) }} {{ $result = merge $result (dict "permalink" $pageResourceImage.RelPermalink) }}
{{ $result = merge $result (dict "resource" $pageResourceImage) }}
<!-- Disable SVG image processing, not supported by Hugo -->
{{ if ne (path.Ext $imageValue) ".svg" }}
{{ $result = merge $result (dict "resource" $pageResourceImage) }}
{{ end }}
{{ else }} {{ else }}
<!-- Can not find the image under page bundle. Could be a relative linked image --> <!-- Can not find the image under page bundle. Could be a relative linked image -->
{{ $result = merge $result (dict "permalink" $imageValue) }} {{ $result = merge $result (dict "permalink" (relURL $imageValue)) }}
{{ end }} {{ end }}
{{ end }} {{ end }}
@@ -47,7 +51,7 @@
{{ else }} {{ else }}
<!-- External image --> <!-- External image -->
{{ $result = merge $result (dict "permalink" $defaultImageSetting.src) }} {{ $result = merge $result (dict "permalink" (relURL $defaultImageSetting.src)) }}
{{ end }} {{ end }}
{{ end }} {{ end }}
+1 -1
View File
@@ -37,7 +37,7 @@
{{ $active := or (eq $currentPage.Title .Name) (or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .)) }} {{ $active := or (eq $currentPage.Title .Name) (or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .)) }}
<li {{ if $active }} class='current' {{ end }}> <li {{ if $active }} class='current' {{ end }}>
<a href='{{ .URL | relURL }}'> <a href='{{ .URL }}'>
{{ if .Pre }} {{ if .Pre }}
{{ partial "helper/icon" .Pre }} {{ partial "helper/icon" .Pre }}
{{ end }} {{ end }}
+1 -2
View File
@@ -12,13 +12,12 @@
<p>当前视频av或BV号:{{ $vid }},视频分P{{ $videopage }}</p> <p>当前视频av或BV号:{{ $vid }},视频分P{{ $videopage }}</p>
{{ end }} {{ end }}
<div style="position: relative; width: 100%; height: 0; padding-bottom: 56.25%;"> <div class="video-wrapper">
<iframe src="//player.bilibili.com/player.html?{{ $basicQuery | safeURL }}&{{ $videoQuery | safeURL }}" <iframe src="//player.bilibili.com/player.html?{{ $basicQuery | safeURL }}&{{ $videoQuery | safeURL }}"
scrolling="no" scrolling="no"
frameborder="no" frameborder="no"
framespacing="0" framespacing="0"
allowfullscreen="true" allowfullscreen="true"
style="position: absolute; width: 100%; height: 100%; left: 0; top: 0;"
> >
</iframe> </iframe>
</div> </div>
+10
View File
@@ -0,0 +1,10 @@
{{ $vid := .Get 0 }}
<div class="video-wrapper">
<iframe src="http://v.qq.com/txp/iframe/player.html?vid={{ $vid }}&auto=0"
scrolling="no"
frameborder="no"
framespacing="0"
allowfullscreen="true"
>
</iframe>
</div>
+7 -3
View File
@@ -2,8 +2,12 @@
{{- if not $pc.Disable -}} {{- if not $pc.Disable -}}
{{- $ytHost := cond $pc.PrivacyEnhanced "www.youtube-nocookie.com" "www.youtube.com" -}} {{- $ytHost := cond $pc.PrivacyEnhanced "www.youtube-nocookie.com" "www.youtube.com" -}}
{{- $id := .Get "id" | default (.Get 0) -}} {{- $id := .Get "id" | default (.Get 0) -}}
{{- $class := .Get "class" | default (.Get 1) }} <div class="video-wrapper">
<div {{ with $class }}class="{{ . }}"{{ else }}style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"{{ end }}> <iframe loading="lazy"
<iframe loading="lazy" src="https://{{ $ytHost }}/embed/{{ $id }}{{ with .Get "autoplay" }}{{ if eq . "true" }}?autoplay=1{{ end }}{{ end }}" {{ if not $class }}style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" {{ end }}allowfullscreen title="YouTube Video"></iframe> src="https://{{ $ytHost }}/embed/{{ $id }}{{ with .Get "autoplay" }}{{ if eq . "true" }}?autoplay=1{{ end }}{{ end }}"
allowfullscreen
title="YouTube Video"
>
</iframe>
</div> </div>
{{ end -}} {{ end -}}
File diff suppressed because one or more lines are too long