Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0f6f4ec

Browse files
committed
enhanced article styles, and profile features
1 parentbbe5716 commit0f6f4ec

File tree

6 files changed

+164
-16
lines changed

6 files changed

+164
-16
lines changed

‎_config.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
# Menu setting | format = title_name: link_url
2020
menu:
2121
PAGE:/page
22+
# Social media links
23+
socials:
24+
github:"https://github.com/TriDiamond"
25+
twitter:"https://twitter.com/TriDiamond6"
26+
stackoverflow:"https://stackoverflow.com/users/7602324/tridiamond?tab=profile"
2227

2328
# Enable table of content
2429
TOC:true

‎layout/_partial/post/article.ejs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@
9191
<imgsrc="<%- theme.avatar %>"height=300width=300></img>
9292
<p><%-config.author%></p>
9393
<span><%-theme.descriptionOne%></span>
94+
<dl>
95+
<dd><ahref="<%- theme.socials.github %>"target="_blank"><spanclass=" iconfont icon-github"></span></a></dd>
96+
<dd><ahref="<%- theme.socials.twitter %>"target="_blank"><spanclass=" iconfont icon-twitter"></span></a></dd>
97+
<dd><ahref="<%- theme.socials.stackoverflow %>"target="_blank"><spanclass=" iconfont icon-stack-overflow"></span></a></dd>
98+
</dl>
9499
</div>
95100
<ul>
96101
<li><ahref="/"><%-site.posts.length%> <p>文章</p></a></li>

‎layout/_partial/screen.ejs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<% }%>
5656
<divclass="md-content animated fadeIn">
5757
<%if (theme.html_truncate.enable) {%>
58-
<%-htmlTruncate(first.content,theme.html_truncate.coverLength, {
58+
<%-htmlTruncate(first.content,first.preview||theme.html_truncate.coverLength, {
5959
ellipsis:theme.html_truncate.ellipsis,
6060
excludes:theme.html_truncate.excludes,
6161
keepWhitespaces:theme.html_truncate.keepWhitespaces,

‎source/css/dracula.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/* background: #100e17; */
2020
clear: both;
2121
color:#fff;
22-
background:#001628;
22+
background:#100e17;
2323
font-size:16px;
2424
}
2525

‎source/css/obsidian.css‎

Lines changed: 127 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,20 +1332,62 @@ h1.title {
13321332
top:calc(1rem+61px);
13331333
}
13341334

1335+
.article .sidebar .subboxdl {
1336+
position: relative;
1337+
top:0;
1338+
left:0;
1339+
display: grid;
1340+
grid-template-columns:33%33%33%;
1341+
font-weight:900;
1342+
margin-block-start:1.2em;
1343+
margin-block-end:0;
1344+
}
1345+
1346+
.article .sidebar .box .subboxdldd {
1347+
display: block;
1348+
max-width:100%;
1349+
text-align: center;
1350+
margin-inline-start:0;
1351+
line-height:28px;
1352+
transition: all800ms linear;
1353+
}
1354+
1355+
.article .sidebar .box .subboxdldda:hover,
1356+
.article .sidebar .box .subboxdlddaspan:hover,
1357+
.article .sidebar .box .subboxdldd:hover {
1358+
color:#100e17;
1359+
}
1360+
1361+
.article .sidebar .box .subboxdldd:nth-last-of-type(2) {
1362+
padding-top:2px;
1363+
}
1364+
1365+
.article .sidebar .box .subboxdldda,
1366+
.article .sidebar .box .subboxdlddaspan {
1367+
font-size:28px;
1368+
line-height:28px;
1369+
padding-top:0;
1370+
}
1371+
13351372
.article .sidebar .boxul {
13361373
position: relative;
13371374
top:1.2rem;
13381375
right:-1rem;
13391376
display: grid;
13401377
grid-template-columns:100px100px100px;
1341-
font-weight:900px;
1378+
font-weight:900;
13421379
font-size:18px;
13431380
}
13441381

13451382
.article .sidebar .boxulli {
13461383
display: block;
13471384
max-width:100%;
13481385
text-align: center;
1386+
border-right:1px solidrgba(158,158,158,0.16);
1387+
}
1388+
1389+
.article .sidebar .boxulli:last-of-type {
1390+
border-right: none;
13491391
}
13501392

13511393
.article .sidebar .boxullip {
@@ -1474,6 +1516,13 @@ h1.title {
14741516
border: none;
14751517
}
14761518

1519+
.articlep.image-caption {
1520+
color:#9E9E9E;
1521+
width:100%;
1522+
text-align: center;
1523+
padding-top:5px;
1524+
}
1525+
14771526
.article-header-wrapper {
14781527
width:100%;
14791528
height:500px;
@@ -1753,6 +1802,50 @@ h1.title {
17531802
font-family: operator mono ssm a,operator mono ssm b,operator mono,source code pro,Menlo,Consolas,Monaco,monospace;
17541803
}
17551804

1805+
.md-contentp,
1806+
.md-contentpre,
1807+
.md-contentblockquote {
1808+
margin:002em;
1809+
}
1810+
1811+
.md-contenth1,
1812+
.md-contenth2,
1813+
.md-contenth3,
1814+
.md-contenth4 {
1815+
margin-top:1em;
1816+
margin-bottom:0.8em;
1817+
}
1818+
1819+
.md-contentblockquote>p {
1820+
margin:0;
1821+
}
1822+
1823+
.md-contenthr {
1824+
display: block;
1825+
margin-top:30px;
1826+
margin-bottom:20px;
1827+
border:0;
1828+
font-size:28px;
1829+
font-weight:300;
1830+
unicode-bidi: isolate;
1831+
margin-block-start:0.5em;
1832+
margin-block-end:0.5em;
1833+
margin-inline-start: auto;
1834+
margin-inline-end: auto;
1835+
border: none;
1836+
text-align: center;
1837+
color:rgba(102,128,153,1);
1838+
/*border-top: 1px solid rgba(102, 128, 153, 0.1)*/
1839+
}
1840+
1841+
.md-contenthr:before {
1842+
content:"...";
1843+
line-height:1.4;
1844+
font-style: italic;
1845+
text-indent:0.6em;
1846+
letter-spacing:0.6em;
1847+
}
1848+
17561849
#post0 .md-content {
17571850
color:#fff;
17581851
font-size:16px;
@@ -1935,14 +2028,33 @@ h4 a:hover {
19352028
}
19362029

19372030
.contenthr {
1938-
margin-top:21px;
1939-
margin-bottom:21px;
2031+
display: block;
2032+
margin-top:30px;
2033+
margin-bottom:20px;
19402034
border:0;
1941-
border-top:1px solidrgba(102,128,153,0.1)
2035+
font-size:28px;
2036+
font-weight:300;
2037+
unicode-bidi: isolate;
2038+
margin-block-start:0.5em;
2039+
margin-block-end:0.5em;
2040+
margin-inline-start: auto;
2041+
margin-inline-end: auto;
2042+
border: none;
2043+
text-align: center;
2044+
color:rgba(102,128,153,0.6);
2045+
/*border-top: 1px solid rgba(102, 128, 153, 0.1)*/
2046+
}
2047+
2048+
.contenthr:before {
2049+
content:"...";
2050+
line-height:1.4;
2051+
font-style: italic;
2052+
text-indent:0.6em;
2053+
letter-spacing:0.6em;
19422054
}
19432055

19442056
.contentp {
1945-
margin:00.8em;
2057+
margin:002em;
19462058
}
19472059

19482060
.contentul,
@@ -1994,11 +2106,19 @@ h4 a:hover {
19942106
font-size:0.9rem;
19952107
}
19962108

2109+
.contentimg {
2110+
border-radius:8px;
2111+
}
2112+
19972113
code,
19982114
pre {
19992115
font-family:"Source Code Pro", monospace
20002116
}
20012117

2118+
pre {
2119+
margin:2em0;
2120+
}
2121+
20022122
code {
20032123
background:rgba(99,99,99,0.07);
20042124
background:#b2fefa;
@@ -2008,7 +2128,7 @@ code {
20082128
overflow-wrap: break-word;
20092129
word-wrap: break-word;
20102130
padding:.1rem.3rem.2rem;
2011-
border-radius:.2rem;
2131+
border-radius:8px;
20122132
opacity:0.9;
20132133
}
20142134

@@ -2020,7 +2140,7 @@ code {
20202140

20212141
.contentblockquote {
20222142
color:#656565;
2023-
margin:001.1em;
2143+
margin:002em;
20242144
border-left:3px solidvar(--code-gradient-light);
20252145
border-left-width:6px;
20262146
background-color:rgba(119,119,119,0.05);

‎source/js/obsidian.js‎

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Watch the TOC during scroll and fill in active status
3+
*@param {} menuSelector
4+
*@param {*} options
5+
*/
16
functionscrollSpy(menuSelector,options){
27
varmenu=$(menuSelector);
38
if(!menu)
@@ -26,15 +31,27 @@ function scrollSpy(menuSelector, options) {
2631
for(vartarget=menu.find("[href='#"+id+"']");
2732
target.length&&!target.is(menu);
2833
target=target.parent()){
29-
if(target.is("li"))
30-
newActive.push(target[0]);
31-
}
34+
if(target.is("li"))
35+
newActive.push(target[0]);
36+
}
3237
active=$(newActive).addClass(activeClassName).trigger("scrollspy");
3338
lastId=id;
3439
}
3540
});
3641
}
3742

43+
/**
44+
* Buidling the caption html in an aritle
45+
*/
46+
functionbuildImgCaption(){
47+
varimages=$('.content').find('img');
48+
49+
images.each(function(){
50+
varcaption=$(this).attr('alt');
51+
$('.content').find("[alt='"+caption+"']").parent().append('<p class="image-caption">"'+caption+'"</p>');
52+
});
53+
}
54+
3855
varHome=location.href,
3956
Pages=4,
4057
xhr,
@@ -119,19 +136,17 @@ var Obsidian = {
119136
case'push':
120137
history.pushState(state,title,url)
121138
$('#preview').html($(data).filter('#single'));
122-
Obsidian.preview();
123139
break;
124140
case'replace':
125141
history.replaceState(state,title,url)
126142
$('#preview').html($(data).filter('#single'));
127-
Obsidian.preview();
128143
break;
129144
}
130145
document.title=title;
131146
$('#preview').html($(data).filter('#single'))
132147
switch(flag){
133148
case'push':
134-
Obsidian.preview()
149+
Obsidian.preview();
135150
break;
136151
case'replace':
137152
Obsidian.initArticleJs();
@@ -168,6 +183,7 @@ var Obsidian = {
168183
'position':'static',
169184
// 'overflow-y': 'auto'
170185
});
186+
console.log('preivew','initArticleJs')
171187
Obsidian.initArticleJs();
172188
},500);
173189
},0);
@@ -245,7 +261,8 @@ var Obsidian = {
245261
});
246262
Obsidian.setCodeRowWithLang();
247263
Obsidian.tocSpy(200);
248-
initValine()
264+
initValine();
265+
buildImgCaption();
249266
},
250267
setCodeRowWithLang:function(){
251268
// Get the programming type of the current code block
@@ -635,6 +652,7 @@ $(function() {
635652
}
636653
if($('.article').length){
637654
Obsidian.tocSpy(200);
655+
buildImgCaption();
638656
}
639657
initialTyped();
640658
Obsidian.setCodeRowWithLang();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp