Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/FUNDING.yml3
-rw-r--r--assets/icons/categories.svg9
-rw-r--r--assets/scss/grid.scss33
-rw-r--r--assets/scss/partials/article.scss35
-rw-r--r--assets/scss/partials/base.scss2
-rw-r--r--assets/scss/partials/footer.scss1
-rw-r--r--assets/scss/partials/layout/archives.scss3
-rw-r--r--assets/scss/partials/layout/article.scss33
-rw-r--r--assets/scss/partials/layout/list.scss12
-rw-r--r--assets/scss/partials/layout/search.scss6
-rw-r--r--assets/scss/partials/menu.scss36
-rw-r--r--assets/scss/partials/pagination.scss1
-rw-r--r--assets/scss/partials/sidebar.scss101
-rw-r--r--assets/scss/partials/widgets.scss7
-rw-r--r--assets/scss/style.scss1
-rw-r--r--assets/scss/variables.scss10
-rw-r--r--assets/ts/gallery.ts2
-rw-r--r--config.yaml1
-rw-r--r--exampleSite/config.yaml20
-rw-r--r--exampleSite/content/_index.cn.md8
-rw-r--r--exampleSite/content/_index.md8
-rw-r--r--exampleSite/content/post/chinese-test/index.cn.md (renamed from exampleSite/content/post/chinese-test/index.md)0
-rw-r--r--exampleSite/content/post/placeholder-text/index.ar.md32
-rw-r--r--i18n/ar.yaml70
-rw-r--r--i18n/en.yaml3
-rw-r--r--layouts/_default/archives.html24
-rw-r--r--layouts/_default/baseof.html2
-rw-r--r--layouts/_default/list.html94
-rw-r--r--layouts/page/search.html6
-rw-r--r--layouts/partials/article/components/details.html24
-rw-r--r--layouts/partials/article/components/related-contents.html20
-rw-r--r--layouts/partials/footer/footer.html2
-rw-r--r--layouts/partials/sidebar/left.html48
-rw-r--r--layouts/partials/widget/categories.html16
-rw-r--r--layouts/rss.xml (renamed from layouts/_default/rss.xml)0
35 files changed, 415 insertions, 258 deletions
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index a222d4e..95f0c18 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1 +1,2 @@
-ko_fi: jimmycai \ No newline at end of file
+ko_fi: jimmycai
+github: CaiJimmy
diff --git a/assets/icons/categories.svg b/assets/icons/categories.svg
new file mode 100644
index 0000000..e00ab1d
--- /dev/null
+++ b/assets/icons/categories.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-hash" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
+ <path stroke="none" d="M0 0h24v24H0z"/>
+ <line x1="5" y1="9" x2="19" y2="9" />
+ <line x1="5" y1="15" x2="19" y2="15" />
+ <line x1="11" y1="4" x2="7" y2="20" />
+ <line x1="17" y1="4" x2="13" y2="20" />
+</svg>
+
+
diff --git a/assets/scss/grid.scss b/assets/scss/grid.scss
index a0eddca..84967ef 100644
--- a/assets/scss/grid.scss
+++ b/assets/scss/grid.scss
@@ -11,7 +11,7 @@
/// Display right sidebar when min-width: lg
@include respond(lg) {
- display: block;
+ display: flex;
}
}
@@ -67,24 +67,6 @@
}
}
- &.align-items--flex-start {
- align-items: flex-start;
- }
-
- .grow {
- flex-grow: 1;
- }
-
- .do-not-shrink {
- flex-shrink: 0;
- }
-
- .do-not-overflow {
- min-width: 0;
- flex-shrink: 1;
- max-width: 100%;
- }
-
.full-width {
width: 100%;
}
@@ -94,15 +76,22 @@ main.main {
min-width: 0;
max-width: 100%;
flex-grow: 1;
- padding-top: var(--main-top-padding);
+ display: flex;
+ flex-direction: column;
+ gap: var(--section-separation);
+
+ @include respond(md) {
+ padding-top: var(--main-top-padding);
+ }
}
.main-container {
min-height: 100vh;
align-items: flex-start;
padding: 0 15px;
- column-gap: var(--section-separation);
-
+ gap: var(--section-separation);
+ padding-top: var(--main-top-padding);
+
@include respond(md) {
padding: 0 20px;
}
diff --git a/assets/scss/partials/article.scss b/assets/scss/partials/article.scss
index 0d3efba..f085ff0 100644
--- a/assets/scss/partials/article.scss
+++ b/assets/scss/partials/article.scss
@@ -2,6 +2,7 @@
.article-list {
display: flex;
flex-direction: column;
+ gap: var(--section-separation);
article {
display: flex;
@@ -17,10 +18,6 @@
box-shadow: var(--shadow-l2);
}
- &:not(:last-of-type) {
- margin-bottom: var(--section-separation);
- }
-
.article-image {
img {
width: 100%;
@@ -52,13 +49,13 @@
display: flex;
flex-direction: column;
justify-content: center;
-
padding: var(--card-padding);
+ gap: 15px;
}
.article-title {
font-weight: 600;
- margin: 10px 0;
+ margin: 0;
color: var(--card-text-color-main);
font-size: 2.2rem;
@@ -73,31 +70,31 @@
color: var(--card-text-color-main);
}
}
-
- & + .article-subtitle {
- margin-top: 0;
- }
}
.article-subtitle {
font-weight: normal;
color: var(--card-text-color-secondary);
- margin: 5px 0;
line-height: 1.5;
-
+ margin: 0;
font-size: 1.75rem;
@include respond(xl) {
font-size: 2rem;
}
}
+.article-title-wrapper {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+}
+
.article-time,
.article-translations {
display: flex;
align-items: center;
color: var(--card-text-color-tertiary);
gap: 15px;
- margin-top: 10px;
flex-wrap: wrap;
svg {
@@ -122,6 +119,9 @@
.article-category,
.article-tags {
+ display: flex;
+ gap: 10px;
+
a {
color: var(--accent-color-text);
background-color: var(--accent-color);
@@ -129,8 +129,6 @@
border-radius: var(--tag-border-radius);
display: inline-block;
font-size: 1.4rem;
- margin-right: 10px;
- margin-bottom: 10px;
transition: background-color 0.5s ease;
&:hover {
@@ -151,15 +149,12 @@
--image-size: 60px;
}
- & + .pagination {
- margin-top: var(--section-separation);
- }
-
article {
& > a {
display: flex;
align-items: center;
padding: var(--small-card-padding);
+ gap: 15px;
}
&:not(:last-of-type) {
@@ -169,8 +164,8 @@
.article-details {
flex-grow: 1;
padding: 0;
- padding-right: 15px;
min-height: var(--image-size);
+ gap: 10px;
}
.article-title {
diff --git a/assets/scss/partials/base.scss b/assets/scss/partials/base.scss
index e7aefe6..efb4b8f 100644
--- a/assets/scss/partials/base.scss
+++ b/assets/scss/partials/base.scss
@@ -35,4 +35,4 @@ body {
::-webkit-scrollbar-track {
background-color: transparent;
}
-/**/
+/**/ \ No newline at end of file
diff --git a/assets/scss/partials/footer.scss b/assets/scss/partials/footer.scss
index 1c60dc7..ccb7394 100644
--- a/assets/scss/partials/footer.scss
+++ b/assets/scss/partials/footer.scss
@@ -2,7 +2,6 @@ footer.site-footer {
padding: 20px 0 var(--section-separation) 0;
font-size: 1.4rem;
line-height: 1.75;
- margin-top: var(--section-separation);
&:before {
content: "";
diff --git a/assets/scss/partials/layout/archives.scss b/assets/scss/partials/layout/archives.scss
deleted file mode 100644
index 34e5f62..0000000
--- a/assets/scss/partials/layout/archives.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-.archives-group {
- margin-bottom: var(--section-separation);
-} \ No newline at end of file
diff --git a/assets/scss/partials/layout/article.scss b/assets/scss/partials/layout/article.scss
index 92e1167..36f326a 100644
--- a/assets/scss/partials/layout/article.scss
+++ b/assets/scss/partials/layout/article.scss
@@ -13,10 +13,6 @@
box-shadow: var(--shadow-l1);
overflow: hidden;
- &.main-article {
- margin-bottom: var(--section-separation);
- }
-
.article-header {
.article-image {
img {
@@ -57,11 +53,11 @@
display: flex;
align-items: center;
font-size: 1.4rem;
+ gap: 15px;
svg {
width: 20px;
height: 20px;
- margin-right: 15px;
stroke-width: 1.33;
}
}
@@ -211,10 +207,6 @@
}
}
-.related-contents--wrapper {
- margin-bottom: var(--section-separation);
-}
-
.related-contents {
overflow-x: auto;
padding-bottom: 15px;
@@ -260,9 +252,9 @@
h4,
h5,
h6 {
- 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);
+ margin-inline-start: calc((var(--card-padding)) * -1);
+ padding-inline-start: calc(var(--card-padding) - var(--heading-border-size));
+ border-inline-start: var(--heading-border-size) solid var(--accent-color);
}
figure {
@@ -277,7 +269,7 @@
blockquote {
position: relative;
margin: 1.5em 0;
- border-left: var(--blockquote-border-size) solid var(--card-separator-color);
+ border-inline-start: var(--blockquote-border-size) solid var(--card-separator-color);
padding: 15px calc(var(--card-padding) - var(--blockquote-border-size));
background-color: var(--blockquote-background-color);
}
@@ -305,13 +297,10 @@
flex-direction: row;
justify-content: center;
margin: 1.5em 0;
+ gap: 10px;
figure {
margin: 0;
-
- & + figure {
- margin-left: 10px;
- }
}
}
@@ -324,7 +313,10 @@
line-height: 1.428571429;
word-break: break-all;
padding: var(--card-padding);
-
+ // keep Codeblocks LTR
+ [dir="rtl"] & {
+ direction: ltr;
+ }
code {
color: unset;
border: none;
@@ -343,7 +335,10 @@
opacity: 1;
}
}
-
+ // keep Codeblocks LTR
+ [dir="rtl"] & {
+ direction: ltr;
+ }
pre {
margin: initial;
padding: 0;
diff --git a/assets/scss/partials/layout/list.scss b/assets/scss/partials/layout/list.scss
index 1a0e346..d7815ca 100644
--- a/assets/scss/partials/layout/list.scss
+++ b/assets/scss/partials/layout/list.scss
@@ -3,21 +3,16 @@
background-color: var(--card-background);
padding: var(--small-card-padding);
box-shadow: var(--shadow-l1);
- margin-bottom: var(--section-separation);
display: flex;
align-items: center;
+ gap: 20px;
--separation: 15px;
.section-term {
font-size: 2.2rem;
margin: 0;
- margin-top: calc(var(--separation) / 2);
color: var(--card-text-color-main);
-
- & + .section-description {
- margin-top: var(--separation);
- }
}
.section-description {
@@ -29,7 +24,9 @@
.section-details {
flex-grow: 1;
- margin-right: 20px;
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
}
.section-image {
@@ -49,7 +46,6 @@
}
.subsection-list {
- margin-bottom: var(--section-separation);
overflow-x: auto;
.article-list--tile {
diff --git a/assets/scss/partials/layout/search.scss b/assets/scss/partials/layout/search.scss
index b390a7b..89cdcef 100644
--- a/assets/scss/partials/layout/search.scss
+++ b/assets/scss/partials/layout/search.scss
@@ -1,5 +1,4 @@
.search-form {
- margin-bottom: var(--section-separation);
position: relative;
--button-size: 80px;
@@ -25,7 +24,7 @@
label {
position: absolute;
top: 15px;
- left: 20px;
+ inset-inline-start: 20px;
font-size: 1.4rem;
color: var(--card-text-color-tertiary);
}
@@ -52,7 +51,7 @@
button {
position: absolute;
- right: 0;
+ inset-inline-end: 0;
top: 0;
height: 100%;
width: var(--button-size);
@@ -79,4 +78,5 @@
height: 20px;
}
}
+
} \ No newline at end of file
diff --git a/assets/scss/partials/menu.scss b/assets/scss/partials/menu.scss
index 257eedb..4f29c9f 100644
--- a/assets/scss/partials/menu.scss
+++ b/assets/scss/partials/menu.scss
@@ -101,11 +101,16 @@
background: none;
border: none;
position: absolute;
- right: 30px;
- top: 30px;
+ right: 0;
+ top: 0;
z-index: 2;
cursor: pointer;
+ [dir="rtl"] & {
+ left: 0;
+ right: auto;
+ }
+
@include respond(md) {
display: none;
}
@@ -129,20 +134,22 @@
overflow-y: auto;
flex-grow: 1;
font-size: 1.4rem;
-
background-color: var(--card-background);
- padding: 15px 0;
+
box-shadow: var(--shadow-l1);
display: none;
+ margin: 0 calc(var(--container-padding) * -1);
- margin: 0 -15px;
+ padding: 30px 30px;
+ @include respond(xl) {
+ padding: 15px 0;
+ }
&,
.menu-bottom-section {
- gap: 15px;
+ gap: 30px;
@include respond(xl) {
- margin-top: 30px;
- gap: 20px;
+ gap: 25px;
}
}
@@ -157,26 +164,19 @@
padding: 0;
box-shadow: none;
margin: 0;
- margin-top: var(--sidebar-element-separation);
- }
-
- @include respond(xl) {
- margin-top: 30px;
}
li {
position: relative;
vertical-align: middle;
- padding: 10px 30px;
+ padding: 0;
@include respond(md) {
width: 100%;
- padding: 10px 0;
}
svg {
stroke-width: 1.33;
- margin-right: 40px;
width: 20px;
height: 20px;
@@ -187,6 +187,7 @@
display: inline-flex;
align-items: center;
color: var(--body-text-color);
+ gap: var(--menu-icon-separation);
}
span {
@@ -211,7 +212,8 @@
.social-menu {
list-style: none;
- padding: 0%;
+ padding: 0;
+ margin: 0;
display: flex;
flex-direction: row;
gap: 10px;
diff --git a/assets/scss/partials/pagination.scss b/assets/scss/partials/pagination.scss
index a6c6882..ca46780 100644
--- a/assets/scss/partials/pagination.scss
+++ b/assets/scss/partials/pagination.scss
@@ -5,7 +5,6 @@
border-radius: var(--card-border-radius);
overflow: hidden;
flex-wrap: wrap;
- margin: var(--section-separation) 0;
.page-link {
padding: 16px 32px;
diff --git a/assets/scss/partials/sidebar.scss b/assets/scss/partials/sidebar.scss
index 4d320a8..95310ca 100644
--- a/assets/scss/partials/sidebar.scss
+++ b/assets/scss/partials/sidebar.scss
@@ -11,13 +11,15 @@
flex-direction: column;
flex-shrink: 0;
align-self: stretch;
-
- width: 100%;
- padding: 30px 0 15px 0;
+ gap: var(--sidebar-element-separation);
max-width: none;
+ width: 100%;
+ position: relative;
- --sidebar-avatar-size: 120px;
+ --sidebar-avatar-size: 100px;
--sidebar-element-separation: 20px;
+ --emoji-size: 40px;
+ --emoji-font-size: 20px;
@include respond(md) {
width: auto;
@@ -27,18 +29,49 @@
}
@include respond(2xl) {
- --sidebar-avatar-size: 140px;
+ --sidebar-avatar-size: 120px;
--sidebar-element-separation: 25px;
+ --emoji-size: 40px;
}
&.sticky {
top: 0;
}
+
+ &.compact {
+ --sidebar-avatar-size: 80px;
+ --emoji-size: 30px;
+ --emoji-font-size: 15px;
+
+ header {
+ @include respond(lg) {
+ flex-direction: row;
+ }
+
+ .site-meta {
+ gap: 5px;
+ }
+
+ .site-name {
+ font-size: 1.4rem;
+
+ @include respond(2xl) {
+ font-size: 1.75rem;
+ }
+ }
+
+ .site-description {
+ font-size: 1.4rem;
+ }
+ }
+ }
}
.right-sidebar {
width: 100%;
display: none;
+ flex-direction: column;
+ gap: var(--widget-separation);
&.sticky {
top: 0;
@@ -49,11 +82,12 @@
}
}
-.site-info {
+.sidebar header {
z-index: 1;
transition: box-shadow 0.5s ease;
-
- padding: 15px;
+ display: flex;
+ flex-direction: column;
+ gap: var(--sidebar-element-separation);
@include respond(md) {
padding: 0;
@@ -64,8 +98,7 @@
margin: 0;
width: var(--sidebar-avatar-size);
height: var(--sidebar-avatar-size);
-
- margin-bottom: var(--sidebar-element-separation);
+ flex-shrink: 0;
.site-logo {
width: 100%;
@@ -76,58 +109,44 @@
.emoji {
position: absolute;
- width: 40px;
- height: 40px;
- line-height: 40px;
+ width: var(--emoji-size);
+ height: var(--emoji-size);
+ line-height: var(--emoji-size);
border-radius: 100%;
bottom: 0;
right: 0;
text-align: center;
- font-size: 20px;
+ font-size: var(--emoji-font-size);
background-color: var(--card-background);
box-shadow: var(--shadow-l2);
-
- @include respond(2xl) {
- width: 50px;
- height: 50px;
- line-height: 50px;
- }
}
}
+ .site-meta {
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+ justify-content: center;
+ }
+
.site-name {
color: var(--accent-color);
margin: 0;
- font-size: 1.8rem;
+ font-size: 1.6rem;
@include respond(2xl) {
- font-size: 2rem;
+ font-size: 1.8rem;
}
}
.site-description {
color: var(--body-text-color);
font-weight: normal;
- margin: 10px 0;
- font-size: 1.6rem;
+ margin: 0;
+ font-size: 1.4rem;
@include respond(2xl) {
- font-size: 1.8rem;
- }
- }
-}
-
-.sidebar {
- .widget {
- margin-bottom: var(--section-separation);
-
- &:not(:last-of-type):after {
- content: "";
- width: 100px;
- height: 2px;
- background-color: var(--body-text-color);
- display: block;
- margin-top: var(--section-separation);
+ font-size: 1.6rem;
}
}
}
@@ -153,6 +172,7 @@
display: flex;
align-items: center;
cursor: pointer;
+ gap: var(--menu-icon-separation);
.icon-tabler-toggle-right {
display: none;
@@ -163,6 +183,7 @@
color: var(--body-text-color);
display: inline-flex;
align-content: center;
+ gap: var(--menu-icon-separation);
select {
border: 0;
diff --git a/assets/scss/partials/widgets.scss b/assets/scss/partials/widgets.scss
index 33a02dd..42cfcc2 100644
--- a/assets/scss/partials/widgets.scss
+++ b/assets/scss/partials/widgets.scss
@@ -1,4 +1,7 @@
.widget {
+ display: flex;
+ flex-direction: column;
+
.widget-icon {
svg {
width: 32px;
@@ -14,16 +17,14 @@
.tagCloud-tags {
display: flex;
flex-wrap: wrap;
+ gap: 10px;
a {
background: var(--card-background);
box-shadow: var(--shadow-l1);
border-radius: var(--tag-border-radius);
padding: 8px 20px;
-
color: var(--card-text-color-main);
- margin-bottom: 10px;
- margin-right: 5px;
font-size: 1.4rem;
transition: box-shadow 0.3s ease;
diff --git a/assets/scss/style.scss b/assets/scss/style.scss
index 2f5aac9..43e95a5 100644
--- a/assets/scss/style.scss
+++ b/assets/scss/style.scss
@@ -19,7 +19,6 @@
@import "partials/pagination.scss";
@import "partials/sidebar.scss";
@import "partials/base.scss";
-@import "partials/layout/archives.scss";
@import "partials/layout/article.scss";
@import "partials/layout/list.scss";
@import "partials/layout/404.scss";
diff --git a/assets/scss/variables.scss b/assets/scss/variables.scss
index f7d45b4..afddb80 100644
--- a/assets/scss/variables.scss
+++ b/assets/scss/variables.scss
@@ -5,9 +5,7 @@ $defaultTagColors: #fff, #fff, #fff, #fff, #fff;
* Global style
*/
:root {
- @include respond(md) {
- --main-top-padding: 35px;
- }
+ --main-top-padding: 35px;
@include respond(xl) {
--main-top-padding: 50px;
@@ -159,3 +157,9 @@ $defaultTagColors: #fff, #fff, #fff, #fff, #fff;
--pre-background-color: #272822;
@import "partials/highlight/dark.scss";
}
+
+:root {
+ --menu-icon-separation: 40px;
+ --container-padding: 15px;
+ --widget-separation: var(--section-separation);
+}
diff --git a/assets/ts/gallery.ts b/assets/ts/gallery.ts
index 218658d..9840f1e 100644
--- a/assets/ts/gallery.ts
+++ b/assets/ts/gallery.ts
@@ -61,7 +61,7 @@ class StackGallery {
/// because it can not detect whether image is being wrapped by a link or not
/// and it lead to a invalid HTML construction (<a><figure><img></figure></a>)
- const images = container.querySelectorAll('img');
+ const images = container.querySelectorAll('img.gallery-image');
for (const img of Array.from(images)) {
/// Images are wrapped with figure tag if the paragraph has only images without texts
/// This is done to allow inline images within paragraphs
diff --git a/config.yaml b/config.yaml
index c55a911..93367bb 100644
--- a/config.yaml
+++ b/config.yaml
@@ -19,6 +19,7 @@ params:
lastUpdated: Jan 02, 2006 15:04 MST
sidebar:
+ compact: false
emoji:
subtitle:
avatar:
diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml
index b2fe1d3..84585b4 100644
--- a/exampleSite/config.yaml
+++ b/exampleSite/config.yaml
@@ -13,6 +13,11 @@ languages:
languageName: 中文
title: 演示站点
weight: 2
+ ar:
+ languageName: عربي
+ languagedirection: rtl
+ title: موقع تجريبي
+ weight: 3
# Change it to your Disqus shortname before using
disqusShortname: hugo-theme-stack
@@ -21,7 +26,7 @@ disqusShortname: hugo-theme-stack
googleAnalytics:
# Theme i18n support
-# Available values: en, fr, id, ja, ko, pt-br, zh-cn, zh-tw, es, de, nl, it, th, el, uk
+# Available values: en, fr, id, ja, ko, pt-br, zh-cn, zh-tw, es, de, nl, it, th, el, uk, ar
DefaultContentLanguage: en
# Set hasCJKLanguage to true if DefaultContentLanguage is in [zh-cn ja ko]
@@ -147,6 +152,9 @@ params:
- type: archives
params:
limit: 5
+ - type: categories
+ params:
+ limit: 10
- type: tag-cloud
params:
limit: 10
@@ -184,15 +192,7 @@ params:
### See https://docs.stack.jimmycai.com/configuration/custom-menu.html
### To remove about, archive and search page menu item, remove `menu` field from their FrontMatter
menu:
- main:
- - identifier: home
- name: Home
- url: /
- weight: -100
- params:
- ### For demonstration purpose, the home link will be open in a new tab
- newTab: true
- icon: home
+ main: []
social:
- identifier: github
diff --git a/exampleSite/content/_index.cn.md b/exampleSite/content/_index.cn.md
new file mode 100644
index 0000000..e4b59a8
--- /dev/null
+++ b/exampleSite/content/_index.cn.md
@@ -0,0 +1,8 @@
+---
+menu:
+ main:
+ name: 主页
+ weight: -100
+ params:
+ icon: home
+--- \ No newline at end of file
diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md
new file mode 100644
index 0000000..530dfe8
--- /dev/null
+++ b/exampleSite/content/_index.md
@@ -0,0 +1,8 @@
+---
+menu:
+ main:
+ name: Home
+ weight: -100
+ params:
+ icon: home
+--- \ No newline at end of file
diff --git a/exampleSite/content/post/chinese-test/index.md b/exampleSite/content/post/chinese-test/index.cn.md
index 5249ef8..5249ef8 100644
--- a/exampleSite/content/post/chinese-test/index.md
+++ b/exampleSite/content/post/chinese-test/index.cn.md
diff --git a/exampleSite/content/post/placeholder-text/index.ar.md b/exampleSite/content/post/placeholder-text/index.ar.md
new file mode 100644
index 0000000..b0328f4
--- /dev/null
+++ b/exampleSite/content/post/placeholder-text/index.ar.md
@@ -0,0 +1,32 @@
++++
+author = "Hugo Authors"
+title = "مثال نص"
+date = "2019-03-09"
+description = "هذا النص هو مثال لنص يمكن أن يستبدل في نفس المساحة"
+categories = [
+ "تجربة",
+ "تجربة مع فراغات"
+]
+tags = [
+ "ماركداون",
+ "نص",
+ "وسم مع فراغات"
+]
+image = "matt-le-SJSpo9hQf7s-unsplash.jpg"
++++
+## فقرة 1
+
+هذا النص هو مثال لنص يمكن أن يستبدل في نفس المساحة، لقد تم توليد هذا النص من [مولد النص العربى](https://colorslab.com/textgator/)، حيث يمكنك أن تولد مثل هذا النص أو العديد من النصوص الأخرى إضافة إلى زيادة عدد الحروف التى يولدها التطبيق.
+إذا كنت تحتاج إلى عدد أكبر من الفقرات يتيح لك مولد النص العربى زيادة عدد الفقرات كما تريد، النص لن يبدو مقسما ولا يحوي أخطاء لغوية، مولد النص العربى مفيد لمصممي المواقع على وجه الخصوص، حيث يحتاج العميل فى كثير من الأحيان أن يطلع على صورة حقيقية لتصميم الموقع.
+ومن هنا وجب على المصمم أن يضع نصوصا مؤقتة على التصميم ليظهر للعميل الشكل كاملاً،دور مولد النص العربى أن يوفر على المصمم عناء البحث عن نص بديل لا علاقة له بالموضوع الذى يتحدث عنه التصميم فيظهر بشكل لا يليق.
+هذا النص يمكن أن يتم تركيبه على أي تصميم دون مشكلة فلن يبدو وكأنه نص منسوخ، غير منظم، غير منسق، أو حتى غير مفهوم. لأنه مازال نصاً بديلاً ومؤقتاً.
+
+## فقرة 2
+
+هذا النص هو مثال لنص يمكن أن يستبدل في نفس المساحة، لقد تم توليد هذا النص من [مولد النص العربى](https://colorslab.com/textgator/)، حيث يمكنك أن تولد مثل هذا النص أو العديد من النصوص الأخرى إضافة إلى زيادة عدد الحروف التى يولدها التطبيق.
+إذا كنت تحتاج إلى عدد أكبر من الفقرات يتيح لك مولد النص العربى زيادة عدد الفقرات كما تريد، النص لن يبدو مقسما ولا يحوي أخطاء لغوية، مولد النص العربى مفيد لمصممي المواقع على وجه الخصوص، حيث يحتاج العميل فى كثير من الأحيان أن يطلع على صورة حقيقية لتصميم الموقع.
+ومن هنا وجب على المصمم أن يضع نصوصا مؤقتة على التصميم ليظهر للعميل الشكل كاملاً،دور مولد النص العربى أن يوفر على المصمم عناء البحث عن نص بديل لا علاقة له بالموضوع الذى يتحدث عنه التصميم فيظهر بشكل لا يليق.
+هذا النص يمكن أن يتم تركيبه على أي تصميم دون مشكلة فلن يبدو وكأنه نص منسوخ، غير منظم، غير منسق، أو حتى غير مفهوم. لأنه مازال نصاً بديلاً ومؤقتاً.
+
+## تجربة RTL
+كلمة 1 Text كلمة 2
diff --git a/i18n/ar.yaml b/i18n/ar.yaml
new file mode 100644
index 0000000..dab3c74
--- /dev/null
+++ b/i18n/ar.yaml
@@ -0,0 +1,70 @@
+toggleMenu:
+ other: اخفي القائمة
+
+darkMode:
+ other: الوضع الداكن
+
+list:
+ page:
+ one: "{{ .Count }} صفحه"
+ other: "{{ .Count }} صفحات"
+
+ section:
+ other: قسم
+
+ subsection:
+ one: قسم فرعي
+ other: اقسام فرعية
+
+article:
+ back:
+ other: خلف
+
+ tableOfContents:
+ other: جدول المحتويات
+
+ relatedContents:
+ other: محتوى مشابهه
+
+ lastUpdatedOn:
+ other: التعديل الاخير
+
+ readingTime:
+ one: "قرائة {{ .Count }} دقيقة"
+ other: "قرائة {{ .Count }} دقائق"
+
+notFound:
+ title:
+ other: غير موجود
+
+ subtitle:
+ other: تعذر العثور على الصفحة المطلوبة.
+
+widget:
+ archives:
+ title:
+ other: الارشيفات
+
+ more:
+ other: اكثر
+
+ tagCloud:
+ title:
+ other: وسوم
+
+search:
+ title:
+ other: بحث
+
+ placeholder:
+ other: اكتب...
+
+ resultTitle:
+ other: "#PAGES_COUNT نتيجة (#TIME_SECONDS ثواني)"
+
+footer:
+ builtWith:
+ other: "مبني بستخدام {{ .Generator }}"
+
+ designedBy:
+ other: "قالب {{ .Theme }} مصمم من {{ .DesignedBy }}"
diff --git a/i18n/en.yaml b/i18n/en.yaml
index 0197d89..3d0ed03 100644
--- a/i18n/en.yaml
+++ b/i18n/en.yaml
@@ -51,6 +51,9 @@ widget:
tagCloud:
title:
other: Tags
+ categoriesCloud:
+ title:
+ other: Categories
search:
title:
diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html
index 321aa6d..5d5243c 100644
--- a/layouts/_default/archives.html
+++ b/layouts/_default/archives.html
@@ -1,17 +1,19 @@
{{ define "body-class" }}template-archives{{ end }}
{{ define "main" }}
- {{- $taxonomy := $.Site.GetPage "taxonomyTerm" "categories" -}}
- {{- $terms := $taxonomy.Pages -}}
- {{ if $terms }}
- <h2 class="section-title">{{ $taxonomy.Title }}</h2>
- <div class="subsection-list">
- <div class="article-list--tile">
- {{ range $terms }}
- {{ partial "article-list/tile" (dict "context" . "size" "250x150" "Type" "taxonomy") }}
- {{ end }}
+ <header>
+ {{- $taxonomy := $.Site.GetPage "taxonomyTerm" "categories" -}}
+ {{- $terms := $taxonomy.Pages -}}
+ {{ if $terms }}
+ <h2 class="section-title">{{ $taxonomy.Title }}</h2>
+ <div class="subsection-list">
+ <div class="article-list--tile">
+ {{ range $terms }}
+ {{ partial "article-list/tile" (dict "context" . "size" "250x150" "Type" "taxonomy") }}
+ {{ end }}
+ </div>
</div>
- </div>
- {{ end }}
+ {{ end }}
+ </header>
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index db1903e..98cc815 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="{{ .Site.LanguageCode }}">
+<html lang="{{ .Site.LanguageCode }}" dir="{{ default `ltr` .Language.LanguageDirection }}">
<head>
{{- partial "head/head.html" . -}}
{{- block "head" . -}}{{ end }}
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 49a5c12..9bc618d 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,46 +1,48 @@
{{ define "main" }}
- <h3 class="section-title">
- {{ if eq .Parent (.GetPage "/") }}
- {{ T "list.section" }}
- {{ else }}
- {{ .Parent.Title }}
- {{ end }}
- </h3>
-
- <div class="section-card">
- <div class="section-details">
- <h3 class="section-count">{{ T "list.page" (len .Pages) }}</h3>
- <h1 class="section-term">{{ .Title }}</h1>
- {{ with .Params.description }}
- <h2 class="section-description">{{ . }}</h2>
+ <header>
+ <h3 class="section-title">
+ {{ if eq .Parent (.GetPage "/") }}
+ {{ T "list.section" }}
+ {{ else }}
+ {{ .Parent.Title }}
{{ end }}
- </div>
+ </h3>
- {{- $image := partialCached "helper/image" (dict "Context" . "Type" "section") .RelPermalink "section" -}}
- {{ if $image.exists }}
- <div class="section-image">
- {{ if $image.resource }}
- {{- $Permalink := $image.resource.RelPermalink -}}
- {{- $Width := $image.resource.Width -}}
- {{- $Height := $image.resource.Height -}}
-
- {{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
- {{- $thumbnail := $image.resource.Fill "120x120" -}}
- {{- $Permalink = $thumbnail.RelPermalink -}}
- {{- $Width = $thumbnail.Width -}}
- {{- $Height = $thumbnail.Height -}}
- {{- end -}}
-
- <img src="{{ $Permalink }}"
- width="{{ $Width }}"
- height="{{ $Height }}"
- loading="lazy">
- {{ else }}
- <img src="{{ $image.permalink }}" loading="lazy" />
+ <div class="section-card">
+ <div class="section-details">
+ <h3 class="section-count">{{ T "list.page" (len .Pages) }}</h3>
+ <h1 class="section-term">{{ .Title }}</h1>
+ {{ with .Params.description }}
+ <h2 class="section-description">{{ . }}</h2>
{{ end }}
</div>
- {{ end }}
- </div>
+
+ {{- $image := partialCached "helper/image" (dict "Context" . "Type" "section") .RelPermalink "section" -}}
+ {{ if $image.exists }}
+ <div class="section-image">
+ {{ if $image.resource }}
+ {{- $Permalink := $image.resource.RelPermalink -}}
+ {{- $Width := $image.resource.Width -}}
+ {{- $Height := $image.resource.Height -}}
+
+ {{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
+ {{- $thumbnail := $image.resource.Fill "120x120" -}}
+ {{- $Permalink = $thumbnail.RelPermalink -}}
+ {{- $Width = $thumbnail.Width -}}
+ {{- $Height = $thumbnail.Height -}}
+ {{- end -}}
+
+ <img src="{{ $Permalink }}"
+ width="{{ $Width }}"
+ height="{{ $Height }}"
+ loading="lazy">
+ {{ else }}
+ <img src="{{ $image.permalink }}" loading="lazy" />
+ {{ end }}
+ </div>
+ {{ end }}
+ </div>
+ </header>
{{- $subsections := .Sections -}}
{{- $pages := .Pages | complement $subsections -}}
@@ -53,14 +55,16 @@
{{- end -}}
{{- with $subsections -}}
- <h2 class="section-title">{{ T "list.subsection" (len $subsections) }}</h2>
- <div class="subsection-list">
- <div class="article-list--tile">
- {{ range . }}
- {{ partial "article-list/tile" (dict "context" . "size" "250x150" "Type" "section") }}
- {{ end }}
+ <aside>
+ <h2 class="section-title">{{ T "list.subsection" (len $subsections) }}</h2>
+ <div class="subsection-list">
+ <div class="article-list--tile">
+ {{ range . }}
+ {{ partial "article-list/tile" (dict "context" . "size" "250x150" "Type" "section") }}
+ {{ end }}
+ </div>
</div>
- </div>
+ </aside>
{{- end -}}
{{/* List only pages that are not a subsection */}}
diff --git a/layouts/page/search.html b/layouts/page/search.html
index 935b384..7c424a6 100644
--- a/layouts/page/search.html
+++ b/layouts/page/search.html
@@ -16,8 +16,10 @@
</button>
</form>
-<h3 class="search-result--title section-title"></h3>
-<div class="search-result--list article-list--compact"></div>
+<div class="search-result">
+ <h3 class="search-result--title section-title"></h3>
+ <div class="search-result--list article-list--compact"></div>
+</div>
<script>
window.searchResultTitleTemplate = "{{ T `search.resultTitle` }}"
diff --git a/layouts/partials/article/components/details.html b/layouts/partials/article/components/details.html
index 2ec1241..4cd26e3 100644
--- a/layouts/partials/article/components/details.html
+++ b/layouts/partials/article/components/details.html
@@ -9,17 +9,19 @@
</header>
{{ end }}
- <h2 class="article-title">
- <a href="{{ .RelPermalink }}">
- {{- .Title -}}
- </a>
- </h2>
-
- {{ with .Params.description }}
- <h3 class="article-subtitle">
- {{ . }}
- </h3>
- {{ end }}
+ <div class="article-title-wrapper">
+ <h2 class="article-title">
+ <a href="{{ .RelPermalink }}">
+ {{- .Title -}}
+ </a>
+ </h2>
+
+ {{ with .Params.description }}
+ <h3 class="article-subtitle">
+ {{ . }}
+ </h3>
+ {{ end }}
+ </div>
{{ if or (not .Date.IsZero) (.Site.Params.article.readingTime) }}
<footer class="article-time">
diff --git a/layouts/partials/article/components/related-contents.html b/layouts/partials/article/components/related-contents.html
index 810b8e9..29cfff6 100644
--- a/layouts/partials/article/components/related-contents.html
+++ b/layouts/partials/article/components/related-contents.html
@@ -1,13 +1,13 @@
+{{ $related := (where (.Site.RegularPages.Related .) "Params.hidden" "!=" true) | first 5 }}
+{{ with $related }}
<aside class="related-contents--wrapper">
- {{ $related := (where (.Site.RegularPages.Related .) "Params.hidden" "!=" true) | first 5 }}
- {{ with $related }}
- <h2 class="section-title">{{ T "article.relatedContents" }}</h2>
- <div class="related-contents">
- <div class="flex article-list--tile">
- {{ range . }}
- {{ partial "article-list/tile" (dict "context" . "size" "250x150" "Type" "articleList") }}
- {{ end }}
- </div>
+ <h2 class="section-title">{{ T "article.relatedContents" }}</h2>
+ <div class="related-contents">
+ <div class="flex article-list--tile">
+ {{ range . }}
+ {{ partial "article-list/tile" (dict "context" . "size" "250x150" "Type" "articleList") }}
+ {{ end }}
</div>
- {{ end }}
+ </div>
</aside>
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/footer/footer.html b/layouts/partials/footer/footer.html
index 072465c..86222eb 100644
--- a/layouts/partials/footer/footer.html
+++ b/layouts/partials/footer/footer.html
@@ -1,4 +1,4 @@
-{{- $ThemeVersion := "3.8.0" -}}
+{{- $ThemeVersion := "3.9.0" -}}
<footer class="site-footer">
<section class="copyright">
&copy;
diff --git a/layouts/partials/sidebar/left.html b/layouts/partials/sidebar/left.html
index 35d1c11..f255389 100644
--- a/layouts/partials/sidebar/left.html
+++ b/layouts/partials/sidebar/left.html
@@ -1,11 +1,11 @@
-<aside class="sidebar left-sidebar sticky">
+<aside class="sidebar left-sidebar sticky {{ if .Site.Params.sidebar.compact }}compact{{ end }}">
<button class="hamburger hamburger--spin" type="button" id="toggle-menu" aria-label="{{ T `toggleMenu` }}">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>
- <header class="site-info">
+ <header>
{{ with .Site.Params.sidebar.avatar }}
{{ if (default true .enabled) }}
<figure class="site-avatar">
@@ -31,29 +31,31 @@
{{ end }}
{{ end }}
- <h1 class="site-name"><a href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Title }}</a></h1>
- <h2 class="site-description">{{ .Site.Params.sidebar.subtitle }}</h2>
-
- {{- with .Site.Menus.social -}}
- <ol class="social-menu">
- {{ range . }}
- <li>
- <a
- href='{{ .URL }}'
- {{ if eq (default true .Params.newTab) true }}target="_blank"{{ end }}
- {{ with .Name }}title="{{ . }}"{{ end }}
- >
- {{ $icon := default "link" .Params.Icon }}
- {{ with $icon }}
- {{ partial "helper/icon" . }}
- {{ end }}
- </a>
- </li>
- {{ end }}
- </ol>
- {{- end -}}
+ <div class="site-meta">
+ <h1 class="site-name"><a href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Title }}</a></h1>
+ <h2 class="site-description">{{ .Site.Params.sidebar.subtitle }}</h2>
+ </div>
</header>
+ {{- with .Site.Menus.social -}}
+ <ol class="social-menu">
+ {{ range . }}
+ <li>
+ <a
+ href='{{ .URL }}'
+ {{ if eq (default true .Params.newTab) true }}target="_blank"{{ end }}
+ {{ with .Name }}title="{{ . }}"{{ end }}
+ >
+ {{ $icon := default "link" .Params.Icon }}
+ {{ with $icon }}
+ {{ partial "helper/icon" . }}
+ {{ end }}
+ </a>
+ </li>
+ {{ end }}
+ </ol>
+ {{- end -}}
+
<ol class="menu" id="main-menu">
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
diff --git a/layouts/partials/widget/categories.html b/layouts/partials/widget/categories.html
new file mode 100644
index 0000000..10c8a35
--- /dev/null
+++ b/layouts/partials/widget/categories.html
@@ -0,0 +1,16 @@
+{{- $context := .Context -}}
+{{- $limit := default 10 .Params.limit -}}
+<section class="widget tagCloud">
+ <div class="widget-icon">
+ {{ partial "helper/icon" "categories" }}
+ </div>
+ <h2 class="widget-title section-title">{{ T "widget.categoriesCloud.title" }}</h2>
+
+ <div class="tagCloud-tags">
+ {{ range first $limit $context.Site.Taxonomies.categories.ByCount }}
+ <a href="{{ .Page.RelPermalink }}" class="font_size_{{ .Count }}">
+ {{ .Page.Title }}
+ </a>
+ {{ end }}
+ </div>
+</section>
diff --git a/layouts/_default/rss.xml b/layouts/rss.xml
index e9f3f1a..e9f3f1a 100644
--- a/layouts/_default/rss.xml
+++ b/layouts/rss.xml