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

Commit 49d3871

Browse files
committed
feat: change admonitions -> notice
- Fix syntax highlighting especially light theme looked bad - Change the name of admonitions to notice. Also tidy up the code so there is less repeated code - Updated colours in themes, to be easier to read - Add icon next to views - Move page view into its own partial file Fixes: reorx#31, reorx#27
1 parent 135854c commit 49d3871

File tree

7 files changed

+57
-88
lines changed

7 files changed

+57
-88
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ My own for of PaperModX adds the following;
66

77
- Mermaid Diagram Support
88
- Series posts shown
9-
- Admonitions
9+
- Notice/Admonitions (Highlighted sections)
1010
- Inline Search
1111
- Inspired by Blowfish Theme
1212
- Remove newsletter

assets/css/common/admonition.css renamed to assets/css/common/notice.css

+45-45
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
font-display: swap;
99
}
1010
.iconfont,
11-
.admonition .admonition-title:before,
12-
details.admonition summary:after {
11+
.notice .notice-title:before,
12+
details.notice summary:after {
1313
font-family: "iconfont" !important;
1414
speak: none;
1515
font-style: normal;
@@ -28,7 +28,7 @@ details.admonition summary:after {
2828
-moz-osx-font-smoothing: grayscale;
2929
}
3030

31-
.admonition {
31+
.notice {
3232
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12),
3333
0 3px 1px -2px rgba(0, 0, 0, 0.2);
3434
position: relative;
@@ -38,154 +38,154 @@ details.admonition summary:after {
3838
border-radius: 0.125rem;
3939
overflow: auto;
4040
}
41-
.admonition .admonition-title {
41+
.notice .notice-title {
4242
margin: 0 -0.75rem;
4343
padding: 0.5rem 0.75rem 0.5rem 2.5rem;
4444
border-bottom: 0.1rem solid rgba(68, 138, 255, 0.1);
4545
background-color: rgba(68, 138, 255, 0.1);
4646
font-weight: 700;
4747
}
48-
.admonition .admonition-title:before {
48+
.notice .notice-title:before {
4949
cursor: auto;
5050
position: absolute;
5151
left: 0.75rem;
5252
top: 0.75rem;
5353
}
54-
.admonition.note {
54+
.notice.note {
5555
border-left-color: #448aff;
5656
}
57-
.admonition.note .admonition-title:before {
57+
.notice.note .notice-title:before {
5858
color: #448aff;
5959
content: "\e903";
6060
}
61-
.admonition.abstract {
61+
.notice.abstract {
6262
border-left-color: #00b0ff;
6363
}
64-
.admonition.abstract .admonition-title {
64+
.notice.abstract .notice-title {
6565
background-color: rgba(0, 176, 255, 0.1);
6666
}
67-
.admonition.abstract .admonition-title:before {
67+
.notice.abstract .notice-title:before {
6868
color: #00b0ff;
6969
content: "\e9bb";
7070
}
71-
.admonition.info {
71+
.notice.info {
7272
border-left-color: #00b8d4;
7373
}
74-
.admonition.info .admonition-title {
74+
.notice.info .notice-title {
7575
background-color: rgba(0, 184, 212, 0.1);
7676
}
77-
.admonition.info .admonition-title:before {
77+
.notice.info .notice-title:before {
7878
color: #00b8d4;
7979
content: "\ea0c";
8080
}
81-
.admonition.tip {
81+
.notice.tip {
8282
border-left-color: #00bfa5;
8383
}
84-
.admonition.tip .admonition-title {
84+
.notice.tip {
8585
background-color: rgba(0, 191, 165, 0.1);
8686
}
87-
.admonition.tip .admonition-title:before {
87+
.notice.tip .notice-title:before {
8888
color: #00bfa5;
8989
content: "\e906";
9090
}
91-
.admonition.success {
91+
.notice.success {
9292
border-left-color: #00c853;
9393
}
94-
.admonition.success .admonition-title {
94+
.notice.success {
9595
background-color: rgba(0, 200, 83, 0.1);
9696
}
97-
.admonition.success .admonition-title:before {
97+
.notice.success .notice-title:before {
9898
color: #00c853;
9999
content: "\ea10";
100100
}
101-
.admonition.question {
101+
.notice.question {
102102
border-left-color: #64dd17;
103103
}
104-
.admonition.question .admonition-title {
104+
.notice.question {
105105
background-color: rgba(100, 221, 23, 0.1);
106106
}
107-
.admonition.question .admonition-title:before {
107+
.notice.question .notice-title:before {
108108
color: #64dd17;
109109
content: "\ea09";
110110
}
111-
.admonition.warning {
111+
.notice.warning {
112112
border-left-color: #ff9100;
113113
}
114-
.admonition.warning .admonition-title {
114+
.notice.warning {
115115
background-color: rgba(255, 145, 0, 0.1);
116116
}
117-
.admonition.warning .admonition-title:before {
117+
.notice.warning .notice-title:before {
118118
color: #ff9100;
119119
content: "\ea07";
120120
}
121-
.admonition.failure {
121+
.notice.failure {
122122
border-left-color: #ff5252;
123123
}
124-
.admonition.failure .admonition-title {
124+
.notice.failure {
125125
background-color: rgba(255, 82, 82, 0.1);
126126
}
127-
.admonition.failure .admonition-title:before {
127+
.notice.failure .notice-title:before {
128128
color: #ff5252;
129129
content: "\ea0f";
130130
}
131-
.admonition.danger {
131+
.notice.danger {
132132
border-left-color: #ff1744;
133133
}
134-
.admonition.danger .admonition-title {
134+
.notice.danger {
135135
background-color: rgba(255, 23, 68, 0.1);
136136
}
137-
.admonition.danger .admonition-title:before {
137+
.notice.danger .notice-title:before {
138138
color: #ff1744;
139139
content: "\e905";
140140
}
141-
.admonition.bug {
141+
.notice.bug {
142142
border-left-color: #f50057;
143143
}
144-
.admonition.bug .admonition-title {
144+
.notice.bug {
145145
background-color: rgba(245, 0, 87, 0.1);
146146
}
147-
.admonition.bug .admonition-title:before {
147+
.notice.bug .notice-title:before {
148148
color: #f50057;
149149
content: "\e907";
150150
}
151-
.admonition.example {
151+
.notice.example {
152152
border-left-color: #651fff;
153153
}
154-
.admonition.example .admonition-title {
154+
.notice.example {
155155
background-color: rgba(101, 31, 255, 0.1);
156156
}
157-
.admonition.example .admonition-title:before {
157+
.notice.example .notice-title:before {
158158
color: #651fff;
159159
content: "\e9b9";
160160
}
161-
.admonition.quote {
161+
.notice.quote {
162162
border-left-color: #9e9e9e;
163163
}
164-
.admonition.quote .admonition-title {
164+
.notice.quote {
165165
background-color: rgba(158, 158, 158, 0.1);
166166
}
167-
.admonition.quote .admonition-title:before {
167+
.notice.quote .notice-title:before {
168168
color: #9e9e9e;
169169
content: "\e904";
170170
}
171-
.admonition:last-child {
171+
.notice:last-child {
172172
margin-bottom: 0.75rem;
173173
}
174-
details.admonition summary {
174+
details.notice summary {
175175
display: block;
176176
outline: none;
177177
cursor: pointer;
178178
}
179-
details.admonition summary::-webkit-details-marker {
179+
details.notice summary::-webkit-details-marker {
180180
display: none;
181181
}
182-
details.admonition summary:after {
182+
details.notice summary:after {
183183
position: absolute;
184184
top: 0.75rem;
185185
right: 0.75rem;
186186
color: rgba(0, 0, 0, 0.26);
187187
content: "\e908";
188188
}
189-
details.admonition[open] > summary:after {
189+
details.notice[open] > summary:after {
190190
transform: rotate(180deg);
191191
}

assets/css/core/theme-vars.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
--secondary: rgb(155, 156, 157);
5858
--tertiary: rgb(123, 124, 124);
5959
--tertiary-bg: rgb(65, 66, 68);
60-
--content: rgb(196, 196, 197);
60+
--content: rgb(255, 255, 255);
6161
--code-bg: rgb(55, 56, 62);
6262
--border: rgb(51, 51, 51);
6363
--link-background-color: #5242746d;

layouts/_default/single.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ <h1 class="post-title">
2121
{{- partial "likes.html" . }}
2222
{{- end }}
2323
{{ if and (.Params.ShowPageViews | default (.Site.Params.article.ShowPageViews | default true)) }}
24-
<span class="meta-item">
25-
{{- partial "page_views.html" . -}}</span>
24+
{{- partial "page_views.html" . -}}
2625
{{ end }}
2726

2827
{{ partial "edit_post.html" . }}

layouts/partials/page_views.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
<span id="{{ .File.UniqueID }}" title="{{ i18n "article.page_views" }}">
2-
{{- "🙈" | markdownify | emojify -}}
1+
<span class="meta-item">
2+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-activity"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>
3+
&nbsp;
4+
<span id="{{ .File.UniqueID }}" title="{{ i18n "article.page_views" }}">
5+
</span>
36
</span>
47
<script>
58
var r = new XMLHttpRequest();

layouts/shortcodes/admonition.html

-37
This file was deleted.

layouts/shortcodes/notice.html

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<details class="notice {{ .Get "type" }}" open="{{ .Get "opened" | default true }}">
2+
{{- with .Get "title" }}<summary class="notice-title">{{ . }}</summary>{{ end }}
3+
{{ .Inner | markdownify }}
4+
</details>

0 commit comments

Comments
 (0)