Skip to content

Commit 66625e0

Browse files
committed
Fix for bookmark card, page hero, spacing on subscribe
1 parent 6ff0b0b commit 66625e0

File tree

12 files changed

+44
-7
lines changed

12 files changed

+44
-7
lines changed

example/gatsby-config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ module.exports = {
101101
siteDescription:
102102
"Lightning fast, secure front-end for your WordPress or Ghost blog, without coding.",
103103
language: "en",
104-
logoUrl: "",
104+
logoUrl: "logo.svg",
105105
iconUrl:
106106
"https://ghost.theasdfghjkl.com/content/images/2020/05/draftbox-colored-icon.png",
107-
coverUrl: "cover.png",
108-
alternateLogoUrl: "",
107+
coverUrl: "cover.jpg",
108+
alternateLogoUrl: "alternateLogo.svg",
109109
themeConfig: {
110110
variables: [
111111
{ varName: "--accent-color", value: "#6166DC" },

gatsby-ghost-novela-theme/src/components/BookmarkCard/BookmarkCard.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const BookmarkCard = (props) => {
1313
rel="norefferer noopener"
1414
>
1515
<BookmarkContent>
16-
<Heading.h3>{props.title}</Heading.h3>
16+
<BookmarkHeading>{props.title}</BookmarkHeading>
1717
<BookmarkDescription>{props.description}</BookmarkDescription>
1818
<BookmarkMeta>
1919
{props.author !== "undefined" && (
@@ -141,4 +141,8 @@ const ThumbnailImage = styled.img`
141141
`};
142142
`;
143143

144+
const BookmarkHeading = styled(Heading.h3)`
145+
font-size: 20px;
146+
`;
147+
144148
export default BookmarkCard;

gatsby-ghost-novela-theme/src/sections/article/Article.Share.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,15 @@ const ArticleShare: React.FC<{}> = () => {
5252
*/
5353
setTimeout(() => {
5454
const article = document.getElementsByTagName("article")[0];
55-
const paragraphOffset = document.getElementsByTagName("p")[0]
56-
.offsetLeft;
55+
let paragraphOffset = 0;
56+
if (
57+
document.getElementsByTagName("p") &&
58+
document.getElementsByTagName("p").length >= 0
59+
) {
60+
paragraphOffset = document.getElementsByTagName("p")[0].offsetLeft;
61+
}
62+
63+
5764

5865
if (!article) return;
5966

gatsby-ghost-novela-theme/src/sections/page/Page.Hero.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const siteSettingsQuery = graphql`
2424

2525
const siteSettings = useStaticQuery(siteSettingsQuery);
2626
const logoUrl = siteSettings.site.siteMetadata.logoUrl;
27-
console.log(logoUrl, 'logoUrl');
2827

2928
const PageHero: React.FC<ArticleHeroProps> = ({ article }) => {
3029
const hasHeroImage =

gatsby-ghost-novela-theme/src/templates/articles.template.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ const ArticlesPage: Template = ({ location, pageContext }) => {
2727
<Paginator {...pageContext} />
2828
</ArticlesPaginator>
2929
</Section>
30+
<SubscriptionMargin show={pageContext.pageCount == 1}>
3031
<Subscription
3132
home="true"
3233
/>
34+
</SubscriptionMargin>
3335
<ArticlesGradient />
3436
</Layout>
3537
);
@@ -58,3 +60,11 @@ const ArticlesPaginator = styled.div<{ show: boolean }>`
5860
justify-content: center;
5961
`};
6062
`;
63+
64+
const SubscriptionMargin = styled.div<{show: boolean}>`
65+
${(p) => p.show && `margin-top: 80px;`}
66+
67+
${mediaqueries.tablet`
68+
margin-top:50px;
69+
`}
70+
`;

gatsby-ghost-novela-theme/src/utils/handlers.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function audio(h, node) {
2121

2222

2323
function figure(h, node) {
24+
2425
if (
2526
node.properties &&
2627
node.properties.className &&
@@ -32,6 +33,14 @@ function figure(h, node) {
3233
url: node.properties.href,
3334
};
3435
visit(node, function(node) {
36+
if (
37+
node.properties &&
38+
node.properties.className &&
39+
node.properties.className.includes("kg-bookmark-container") &&
40+
node.tagName == "a"
41+
) {
42+
boomarkCardData.url = node.properties.href;
43+
}
3544
if (
3645
node.properties &&
3746
node.properties.className &&
Lines changed: 4 additions & 0 deletions
Loading
539 KB
Loading
245 KB
Loading
-5.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)