Skip to content

Commit a72ca19

Browse files
committed
Add logo image to OpenGraph metadata and enhance dark mode styles for share buttons
1 parent b027c59 commit a72ca19

File tree

3 files changed

+61
-2
lines changed

3 files changed

+61
-2
lines changed

_config.icarus.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ head:
4848
url:
4949
# Page cover (og:image) (optional)
5050
# You should leave this blank for most of the time
51-
image:
51+
image: /img/logo.svg
5252
# Site name (og:site_name) (optional)
5353
# You should leave this blank for most of the time
5454
site_name:
@@ -93,7 +93,7 @@ head:
9393
publisher_logo:
9494
# Page images (optional)
9595
# You should leave this blank for most of the time
96-
image:
96+
image: /img/logo.svg
9797
# Additional HTML meta tags in an array
9898
meta:
9999
# Meta tag specified in <attribute>=<value> style

themes/icarus/include/style/dark-mode.styl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,20 @@ html, body, .card, .navbar-main, .footer, a, .content, .title, p, h1, h2, h3, h4
284284
display: flex !important
285285
justify-content: center !important
286286
align-items: center !important
287+
min-height: 32px
288+
margin-top: 1rem
289+
290+
/* Show placeholders before script loads */
291+
a
292+
display: inline-block
293+
width: 32px
294+
height: 32px
295+
margin: 0 4px
296+
background-color: #0166ff
297+
border-radius: 4px
298+
299+
&:hover
300+
opacity: 0.8
287301

288302
/* Post card separator line - lighter gray */
289303
.card-content hr,
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* AddToAny share buttons JSX component without defer.
3+
* @module view/share/addtoany
4+
*/
5+
const { Component, Fragment } = require('inferno');
6+
const { cacheComponent } = require('hexo-component-inferno/lib/util/cache');
7+
8+
/**
9+
* AddToAny share buttons JSX component.
10+
*
11+
* @see https://www.addtoany.com/buttons/
12+
* @example
13+
* <AddToAny />
14+
*/
15+
class AddToAny extends Component {
16+
render() {
17+
return <Fragment>
18+
<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
19+
<a class="a2a_dd" target="_blank" rel="noopener" href="https://www.addtoany.com/share"></a>
20+
<a class="a2a_button_facebook"></a>
21+
<a class="a2a_button_twitter"></a>
22+
<a class="a2a_button_telegram"></a>
23+
<a class="a2a_button_whatsapp"></a>
24+
<a class="a2a_button_reddit"></a>
25+
</div>
26+
<script src="https://static.addtoany.com/menu/page.js"></script>
27+
</Fragment>;
28+
}
29+
}
30+
31+
/**
32+
* Cacheable AddToAny share buttons JSX component.
33+
* <p>
34+
* This class is supposed to be used in combination with the <code>locals</code> hexo filter
35+
* ({@link module:hexo/filter/locals}).
36+
*
37+
* @see module:util/cache.cacheComponent
38+
* @example
39+
* <AddToAny.Cacheable />
40+
*/
41+
AddToAny.Cacheable = cacheComponent(AddToAny, 'share.addtoany', (props) => {
42+
return {};
43+
});
44+
45+
module.exports = AddToAny;

0 commit comments

Comments
 (0)