This commit is contained in:
@@ -1,10 +1,14 @@
|
|||||||
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
||||||
// If `script` is required but causes type issues, consider fixing the type instead of ignoring.
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import script from "./scripts/_socialshare.inline"
|
import script from "./scripts/_socialshare.inline"
|
||||||
import style from "./styles/_socialshare.scss"
|
import style from "./styles/_socialshare.scss.scss"
|
||||||
|
|
||||||
const SocialShare: QuartzComponent = ({ displayClass, fileData }: QuartzComponentProps) => {
|
const SocialShare: QuartzComponent = ({ displayClass, fileData }: QuartzComponentProps) => {
|
||||||
|
// Extract necessary data from fileData or another source
|
||||||
|
const url = fileData?.url || "";
|
||||||
|
const title = fileData?.title || "";
|
||||||
|
const customExcerpt = fileData?.customExcerpt || "";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="post-share">
|
<div className="post-share">
|
||||||
<div className="share-link">
|
<div className="share-link">
|
||||||
@@ -14,9 +18,9 @@ const SocialShare: QuartzComponent = ({ displayClass, fileData }: QuartzComponen
|
|||||||
onClick={(e) => e.preventDefault()}
|
onClick={(e) => e.preventDefault()}
|
||||||
title="Поделиться в Telegram"
|
title="Поделиться в Telegram"
|
||||||
data-sharer="telegram"
|
data-sharer="telegram"
|
||||||
data-url={`{{url absolute=true}}`}
|
data-url={url}
|
||||||
data-title="{{title}}"
|
data-title={title}
|
||||||
data-caption="{{custom_excerpt}}"
|
data-caption={customExcerpt}
|
||||||
>
|
>
|
||||||
<span className="svg-social-icon icon-telegram"></span>
|
<span className="svg-social-icon icon-telegram"></span>
|
||||||
</a>
|
</a>
|
||||||
@@ -28,22 +32,22 @@ const SocialShare: QuartzComponent = ({ displayClass, fileData }: QuartzComponen
|
|||||||
onClick={(e) => e.preventDefault()}
|
onClick={(e) => e.preventDefault()}
|
||||||
title="Поделиться в Twitter"
|
title="Поделиться в Twitter"
|
||||||
data-sharer="twitter"
|
data-sharer="twitter"
|
||||||
data-url={`{{url absolute=true}}`}
|
data-url={url}
|
||||||
data-title="{{title}}"
|
data-title={title}
|
||||||
>
|
>
|
||||||
<span className="svg-social-icon icon-twitter"></span>
|
<span className="svg-social-icon icon-twitter"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{/* Uncomment and fix other sections as needed */}
|
{/* Uncomment and complete other sections as necessary */}
|
||||||
<div className="share-link">
|
<div className="share-link">
|
||||||
<a
|
<a
|
||||||
className="share-icon share-pocket"
|
className="share-icon share-pocket"
|
||||||
href="#"
|
href="#"
|
||||||
onClick={(e) => e.preventDefault()}
|
onClick={(e) => e.preventDefault()}
|
||||||
title="Поделиться в Pocket"
|
title="Поделиться в Pocket"
|
||||||
data-title="{{title}}"
|
|
||||||
data-sharer="pocket"
|
data-sharer="pocket"
|
||||||
data-url={`{{url absolute=true}}`}
|
data-url={url}
|
||||||
|
data-title={title}
|
||||||
>
|
>
|
||||||
<span className="svg-social-icon icon-pocket"></span>
|
<span className="svg-social-icon icon-pocket"></span>
|
||||||
</a>
|
</a>
|
||||||
@@ -55,8 +59,8 @@ const SocialShare: QuartzComponent = ({ displayClass, fileData }: QuartzComponen
|
|||||||
onClick={(e) => e.preventDefault()}
|
onClick={(e) => e.preventDefault()}
|
||||||
title="Поделиться в Skype"
|
title="Поделиться в Skype"
|
||||||
data-sharer="skype"
|
data-sharer="skype"
|
||||||
data-url={`{{url absolute=true}}`}
|
data-url={url}
|
||||||
data-title="{{title}}"
|
data-title={title}
|
||||||
>
|
>
|
||||||
<span className="svg-social-icon icon-skype"></span>
|
<span className="svg-social-icon icon-skype"></span>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
1
quartz/static/social-sprite-color.svg
Normal file
1
quartz/static/social-sprite-color.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 66 KiB |
1
quartz/static/social-sprite.svg
Normal file
1
quartz/static/social-sprite.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 66 KiB |
Reference in New Issue
Block a user