Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
chore(partials): refactor partials
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonzq committed Feb 21, 2020
1 parent 611518d commit 4e6fe22
Show file tree
Hide file tree
Showing 27 changed files with 555 additions and 535 deletions.
20 changes: 4 additions & 16 deletions assets/css/_page/_single.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
@import "../_partial/_single/toc";

.content {
h1,
h2,
h3,
h4,
Expand All @@ -66,22 +65,7 @@
.dark-theme & {
font-weight: bolder;
}
}

h2 > a:first-child::before {
content: "#";
margin-right: .3125rem;
color: $single-link-color;

.dark-theme & {
color: $single-link-color-dark;
}
}

h3,
h4,
h5,
h6 {
& > a:first-child::before {
content: "|";
margin-right: .3125rem;
Expand All @@ -93,6 +77,10 @@
}
}

h2 > a:first-child::before {
content: "#";
}

p {
font-size: 1rem;
margin: .5rem 0;
Expand Down
60 changes: 38 additions & 22 deletions assets/css/_partial/_home/_summary.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,31 +59,47 @@
overflow: hidden;
text-overflow: ellipsis;
overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
font-size: 1rem;
display: inline;

&::after {
content: "\A";
white-space: pre;
h2,
h3,
h4,
h5,
h6,
p {
font-size: 1rem;
display: inline;

&::after {
content: "\A";
white-space: pre;
}
}
}

h1,
h2,
h3,
h4,
h5,
h6 {
line-height: 2;
h2,
h3,
h4,
h5,
h6 {
line-height: 2;

&::before {
content: "|";
margin-right: .3125rem;
color: $single-link-color;

.dark-theme & {
color: $single-link-color-dark;
}
}
}

h2 {
font-size: 1.2rem;

&::before {
content: "#";
}
}
}

.post-footer {
Expand Down
4 changes: 4 additions & 0 deletions assets/css/_partial/_single/_admonition.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
font-weight: 700;
}

.admonition-content {
margin: .5rem 0;
}

i.icon {
font-size: 16px;
color: map-get($admonition-color-map, 'note');
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/posts/test.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ comment: false
dev: true
---

## This is a test page
## :(fas fa-rocket): This is a test page

[https://www.aol.com/article/entertainment/2020/02/10/oscars-viewership-hits-new-low-with-236-million-viewers/23923047/](https://www.aol.com/article/entertainment/2020/02/10/oscars-viewership-hits-new-low-with-236-million-viewers/23923047/)

Expand Down
4 changes: 2 additions & 2 deletions i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ other = "Powered by %s"
other = "Theme - "
# === partials/footer.html ===

# === partials/post/share.html ===
# === partials/plugin/share.html ===
[share]
other = "Share on"
# === partials/post/share.html ===
# === partials/plugin/share.html ===

# === posts/single.html ===
[toc]
Expand Down
4 changes: 2 additions & 2 deletions i18n/zh.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ other = "由 %s 强力驱动"
other = "主题 - "
# === partials/footer.html ===

# === partials/post/share.html ===
# === partials/plugin/share.html ===
[share]
other = "分享到"
# === partials/post/share.html ===
# === partials/plugin/share.html ===

# === posts/single.html ===
[toc]
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<figure>
{{- partial "function/image.html" (dict "src" .Destination "alt" .Text "title" .Title ) -}}
{{- partial "plugin/image.html" (dict "src" .Destination "alt" .Text "title" .Title ) -}}
{{- with .Title | default .Text -}}
<figcaption class="image-caption">
{{- . | safeHTML -}}
Expand Down
5 changes: 2 additions & 3 deletions layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}>
{{- .Text | safeHTML -}}
</a>
{{- $options := dict "href" .Destination "title" .Title "content" .Text -}}
{{- partial "plugin/link.html" $options -}}
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1 class="single-title animated pulse faster">

{{- /* Content */ -}}
<div class="content">
{{- partial "function/content.html" .Content -}}
{{- partial "single/content.html" .Content -}}
</div>
</div>
{{- end -}}
4 changes: 2 additions & 2 deletions layouts/_default/summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{- with .Params.featuredImage -}}
<div class="featured-image-preview">
{{- $image := $.Params.featuredImagePreview | default . -}}
{{- partial "function/image.html" (dict "src" $image "alt" "featured image") -}}
{{- partial "plugin/image.html" (dict "src" $image "alt" "featured image") -}}
</div>
{{- end -}}

Expand Down Expand Up @@ -44,7 +44,7 @@ <h1 class="single-title" itemprop="name headline">

{{- /* Summary content */ -}}
<div class="content">
{{- partial "function/content.html" .Summary -}}
{{- partial "single/content.html" .Summary -}}
</div>

{{- /* Footer */ -}}
Expand Down
3 changes: 0 additions & 3 deletions layouts/partials/function/icon-link.html

This file was deleted.

2 changes: 1 addition & 1 deletion layouts/partials/home/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h2 class="home-description">

<div class="home-social-links">
{{- if .Site.Params.home.profile.social -}}
{{- partial "home/social.html" . -}}
{{- partial "plugin/social.html" . -}}
{{- end -}}
</div>
</div>
Loading

0 comments on commit 4e6fe22

Please sign in to comment.