86 |
87 | )
88 | }
89 | }
90 |
91 | export default BlogPostTemplate
92 |
93 | export const pageQuery = graphql`
94 | query BlogPostBySlug(
95 | $slug: String!
96 | $previousPostSlug: String
97 | $nextPostSlug: String
98 | ) {
99 | contentfulBlogPost(slug: { eq: $slug }) {
100 | slug
101 | title
102 | author {
103 | name
104 | }
105 | publishDate(formatString: "MMMM Do, YYYY")
106 | rawDate: publishDate
107 | heroImage {
108 | gatsbyImage(layout: FULL_WIDTH, placeholder: BLURRED, width: 1280)
109 | resize(height: 630, width: 1200) {
110 | src
111 | }
112 | }
113 | body {
114 | raw
115 |
116 | }
117 | tags
118 | description {
119 | raw
120 | }
121 | }
122 | previous: contentfulBlogPost(slug: { eq: $previousPostSlug }) {
123 | slug
124 | title
125 | }
126 | next: contentfulBlogPost(slug: { eq: $nextPostSlug }) {
127 | slug
128 | title
129 | }
130 | }
131 | `
132 |
--------------------------------------------------------------------------------
/src/templates/blog-post.module.css:
--------------------------------------------------------------------------------
1 | .meta {
2 | font-family: var(--font-serif);
3 | font-size: var(--text-lg);
4 | font-style: italic;
5 | margin: 0 auto 1em;
6 | max-width: var(--size-max-width);
7 | padding-bottom: var(--size-gutter);
8 | padding-left: var(--size-gutter);
9 | position: relative;
10 | top: -1em;
11 | }
12 |
13 | .article {
14 | display: grid;
15 | font-size: var(--text-prose);
16 | gap: var(--space-xl);
17 | letter-spacing: var(--text-prose-tracking);
18 | line-height: var(--loose);
19 | padding: var(--size-gutter) var(--size-gutter) calc(var(--size-gutter) * 2);
20 | }
21 |
22 | .body {
23 | max-width: 48rem;
24 | }
25 |
26 | .article a {
27 | border-bottom: 1.5px solid currentColor;
28 | font-weight: var(--medium);
29 | }
30 |
31 | .article a:hover {
32 | border-bottom-color: transparent;
33 | color: var(--primary);
34 | }
35 |
36 | .article p {
37 | margin-bottom: 1.5em;
38 | margin-top: 0;
39 | }
40 |
41 | .article h1,
42 | .article h2 {
43 | font-size: var(--text-2xl);
44 | margin-top: var(--space-3xl);
45 | }
46 |
47 | .article h3,
48 | .article h4,
49 | .article h5,
50 | .article h6 {
51 | font-size: var(--text-prose);
52 | font-weight: var(--semibold);
53 | margin-bottom: 0.5em;
54 | margin-top: 3em;
55 | }
56 |
57 | .article li {
58 | margin-bottom: 0.5em;
59 | }
60 |
61 | .articleNavigation {
62 | display: flex;
63 | flex-wrap: wrap;
64 | justify-content: space-between;
65 | list-style: none;
66 | padding: 0;
67 | }
68 |
69 | @media (min-width: 768px) {
70 | .container {
71 | max-width: var(--size-max-width);
72 | margin: 0 auto;
73 | }
74 |
75 | .article {
76 | gap: var(--space-xl);
77 | }
78 | }
79 |
80 | @media (min-width: 1024px) {
81 | .article {
82 | gap: var(--space-3xl);
83 | margin: 0 var(--size-gutter) 0 auto;
84 | padding-left: 0;
85 | padding-right: 0;
86 | width: calc(85% - var(--size-gutter));
87 | }
88 |
89 | .article ul {
90 | padding-left: 5px;
91 | }
92 |
93 | .article ol {
94 | padding-left: 5px;
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/static.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": "public/",
3 | "headers": {
4 | "/**.js": {
5 | "Cache-Control": "public, max-age=0, must-revalidate"
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/contentful-labs/starter-gatsby-blog/568f1b417277da135c7054a9ef80bbc166e34610/static/favicon.ico
--------------------------------------------------------------------------------
/static/fonts/Inter-italic.var.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/contentful-labs/starter-gatsby-blog/568f1b417277da135c7054a9ef80bbc166e34610/static/fonts/Inter-italic.var.woff2
--------------------------------------------------------------------------------
/static/fonts/Inter-roman.var.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/contentful-labs/starter-gatsby-blog/568f1b417277da135c7054a9ef80bbc166e34610/static/fonts/Inter-roman.var.woff2
--------------------------------------------------------------------------------
/static/fonts/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016-2020 The Inter Project Authors.
2 | "Inter" is trademark of Rasmus Andersson.
3 | https://github.com/rsms/inter
4 |
5 | This Font Software is licensed under the SIL Open Font License, Version 1.1.
6 | This license is copied below, and is also available with a FAQ at:
7 | http://scripts.sil.org/OFL
8 |
9 | -----------------------------------------------------------
10 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
11 | -----------------------------------------------------------
12 |
13 | PREAMBLE
14 | The goals of the Open Font License (OFL) are to stimulate worldwide
15 | development of collaborative font projects, to support the font creation
16 | efforts of academic and linguistic communities, and to provide a free and
17 | open framework in which fonts may be shared and improved in partnership
18 | with others.
19 |
20 | The OFL allows the licensed fonts to be used, studied, modified and
21 | redistributed freely as long as they are not sold by themselves. The
22 | fonts, including any derivative works, can be bundled, embedded,
23 | redistributed and/or sold with any software provided that any reserved
24 | names are not used by derivative works. The fonts and derivatives,
25 | however, cannot be released under any other type of license. The
26 | requirement for fonts to remain under this license does not apply
27 | to any document created using the fonts or their derivatives.
28 |
29 | DEFINITIONS
30 | "Font Software" refers to the set of files released by the Copyright
31 | Holder(s) under this license and clearly marked as such. This may
32 | include source files, build scripts and documentation.
33 |
34 | "Reserved Font Name" refers to any names specified as such after the
35 | copyright statement(s).
36 |
37 | "Original Version" refers to the collection of Font Software components as
38 | distributed by the Copyright Holder(s).
39 |
40 | "Modified Version" refers to any derivative made by adding to, deleting,
41 | or substituting -- in part or in whole -- any of the components of the
42 | Original Version, by changing formats or by porting the Font Software to a
43 | new environment.
44 |
45 | "Author" refers to any designer, engineer, programmer, technical
46 | writer or other person who contributed to the Font Software.
47 |
48 | PERMISSION AND CONDITIONS
49 | Permission is hereby granted, free of charge, to any person obtaining
50 | a copy of the Font Software, to use, study, copy, merge, embed, modify,
51 | redistribute, and sell modified and unmodified copies of the Font
52 | Software, subject to the following conditions:
53 |
54 | 1) Neither the Font Software nor any of its individual components,
55 | in Original or Modified Versions, may be sold by itself.
56 |
57 | 2) Original or Modified Versions of the Font Software may be bundled,
58 | redistributed and/or sold with any software, provided that each copy
59 | contains the above copyright notice and this license. These can be
60 | included either as stand-alone text files, human-readable headers or
61 | in the appropriate machine-readable metadata fields within text or
62 | binary files as long as those fields can be easily viewed by the user.
63 |
64 | 3) No Modified Version of the Font Software may use the Reserved Font
65 | Name(s) unless explicit written permission is granted by the corresponding
66 | Copyright Holder. This restriction only applies to the primary font name as
67 | presented to the users.
68 |
69 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
70 | Software shall not be used to promote, endorse or advertise any
71 | Modified Version, except to acknowledge the contribution(s) of the
72 | Copyright Holder(s) and the Author(s) or with their explicit written
73 | permission.
74 |
75 | 5) The Font Software, modified or unmodified, in part or in whole,
76 | must be distributed entirely under this license, and must not be
77 | distributed under any other license. The requirement for fonts to
78 | remain under this license does not apply to any document created
79 | using the Font Software.
80 |
81 | TERMINATION
82 | This license becomes null and void if any of the above conditions are
83 | not met.
84 |
85 | DISCLAIMER
86 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
87 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
88 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
89 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
90 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
91 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
92 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
94 | OTHER DEALINGS IN THE FONT SOFTWARE.
95 |
--------------------------------------------------------------------------------
/static/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------