Browse Source

many changes

- add comix diary
- update 404
- fix page title and meta tags (SEO)
- fix favicon
- finish projects page
mrkvon 1 year ago
parent
commit
2f914be717

+ 3
- 1
content/pages/404.md View File

@@ -1 +1,3 @@
1
-# 404
1
+<div class="center">
2
+  404: Page Not Found
3
+</div>

+ 0
- 10
content/pages/projects.md View File

@@ -1,10 +0,0 @@
1
-## active
2
-
3
-- [mistoskoly.cz](https://mistoskoly.cz)
4
-- [math livegraph](https://math.livegraph.org)
5
-
6
-## incubated, paused
7
-
8
-- [ditup](https://ditup.org)
9
-
10
-## past

+ 11
- 0
content/pages/projects/comix-diary.mdx View File

@@ -0,0 +1,11 @@
1
+# Comix Diary
2
+
3
+<>
4
+{[...Array(26).keys()].slice(1).map(i => (
5
+  <img
6
+    key={i}
7
+    src={`/files/comix-diary/${('0' + i).slice(0, 2)}.png`}
8
+    alt={`image ${i}`}
9
+  />
10
+))}
11
+</>

+ 16
- 0
content/pages/projects/index.md View File

@@ -0,0 +1,16 @@
1
+## active
2
+
3
+- [mistoskoly.cz](https://mistoskoly.cz)
4
+- [math livegraph](https://math.livegraph.org)
5
+
6
+## incubated, paused
7
+
8
+- [ditup](https://ditup.org)
9
+
10
+## past
11
+
12
+- [helping with Trustroots](https://trustroots.org)
13
+- [influenced](https://influenced.livegraph.org)
14
+- temporary [nomadbase in Lisbon](https://lisbon.nomadbase.org) (winter 2015 - 2016)
15
+- [comix diary](/projects/comix-diary)
16
+- some graphics for [MultiRacer](https://franticware.com/multiracer)

+ 6
- 10
gatsby-config.js View File

@@ -1,10 +1,6 @@
1 1
 module.exports = {
2 2
   siteMetadata: {
3
-    title: `Gatsby Default Starter`,
4
-    description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`,
5
-    author: `@gatsbyjs`,
6
-    titleTemplate: "",
7
-    twitterUsername: "",
3
+    description: "mrkvon homepage",
8 4
     url: "https://mrkvon.org",
9 5
     image: "",
10 6
   },
@@ -44,13 +40,13 @@ module.exports = {
44 40
     {
45 41
       resolve: `gatsby-plugin-manifest`,
46 42
       options: {
47
-        name: `gatsby-starter-default`,
48
-        short_name: `starter`,
43
+        name: `mrkvon.org :: mrkvon homepage`,
44
+        short_name: `mrkvon.org`,
49 45
         start_url: `/`,
50
-        background_color: `#663399`,
51
-        theme_color: `#663399`,
46
+        background_color: `##81c0c5`,
47
+        theme_color: `#81c0c5`,
52 48
         display: `minimal-ui`,
53
-        icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
49
+        icon: `src/images/favicon.png`, // This path is relative to the root of the site.
54 50
       },
55 51
     }, // this (optional) plugin enables Progressive Web App + Offline functionality
56 52
     // To learn more, visit: https://gatsby.dev/offline

+ 8
- 18
src/components/page-layout.js View File

@@ -7,30 +7,20 @@
7 7
 
8 8
 import React from "react"
9 9
 import PropTypes from "prop-types"
10
-// import { useStaticQuery, graphql } from "gatsby"
11
-
12 10
 import Header from "./header"
11
+import SEO from "./seo"
13 12
 import "../styles/reset.css"
14 13
 import "./layout.css"
15 14
 
16 15
 const Layout = ({ children, location }) => {
17
-  /*
18
-  const data = useStaticQuery(graphql`
19
-    query SiteTitleQuery {
20
-      site {
21
-        siteMetadata {
22
-          title
23
-        }
24
-      }
25
-    }
26
-  `)
27
-  */
28
-
29 16
   return (
30
-    <div id="wrapper">
31
-      <Header location={location} />
32
-      <main id="page">{children}</main>
33
-    </div>
17
+    <>
18
+      <SEO />
19
+      <div id="wrapper">
20
+        <Header location={location} />
21
+        <main id="page">{children}</main>
22
+      </div>
23
+    </>
34 24
   )
35 25
 }
36 26
 

+ 51
- 38
src/components/seo.js View File

@@ -1,28 +1,49 @@
1 1
 import React from "react"
2
-import PropTypes from "prop-types"
2
+// import PropTypes from "prop-types"
3 3
 import { Helmet } from "react-helmet"
4 4
 import { useLocation } from "@reach/router"
5 5
 import { useStaticQuery, graphql } from "gatsby"
6
-const SEO = ({ title, description, image, article }) => {
7
-  const { pathname } = useLocation()
8
-  const { site } = useStaticQuery(query)
6
+const SEO = () => {
9 7
   const {
10
-    defaultTitle,
11
-    titleTemplate,
12
-    defaultDescription,
13
-    siteUrl,
14
-    defaultImage,
15
-    twitterUsername,
16
-  } = site.siteMetadata
17
-  const seo = {
18
-    title: title || defaultTitle,
19
-    description: description || defaultDescription,
20
-    image: `${siteUrl}${image || defaultImage}`,
21
-    url: `${siteUrl}${pathname}`,
8
+    allPostsYaml: { edges },
9
+  } = useStaticQuery(query)
10
+  const { pathname: location } = useLocation()
11
+
12
+  let snippets = location.split("/").filter(a => !!a)
13
+
14
+  if (snippets[0] === "blog") {
15
+    const posts = edges.map(({ node }) => node)
16
+    const post = posts.find(({ url }) => url === snippets[1])
17
+
18
+    if (post) {
19
+      snippets = ["blog", post.title]
20
+    }
22 21
   }
22
+
23
+  const title = [...snippets.reverse(), "mrkvon"].join(" :: ")
24
+  const description =
25
+    "one more human has a homepage: freedom, sharing, coding, music"
26
+
23 27
   return (
24
-    <Helmet title={seo.title} titleTemplate={titleTemplate}>
25
-      <meta name="description" content={seo.description} />
28
+    <Helmet title={title}>
29
+      <meta name="description" content="mrkvon homepage" />
30
+      <meta name="viewport" content="width=device-width, initial-scale=1.0" />
31
+      <meta property="og:type" content="website" />
32
+      <meta property="og:title" content={title} />
33
+      <meta property="og:url" content="https://mrkvon.org" />
34
+      <meta
35
+        property="og:description"
36
+        content="one more human has a homepage: freedom, sharing, coding, music"
37
+      />
38
+      <meta name="twitter:title" content={title} />}
39
+      <meta name="twitter:description" content={description} />
40
+      <link
41
+        rel="meta"
42
+        type="text/turtle"
43
+        title="FOAF"
44
+        href="https://data.mrkvon.org/foaf.ttl"
45
+      />
46
+      {/*
26 47
       <meta name="image" content={seo.image} />
27 48
       {seo.url && <meta property="og:url" content={seo.url} />}
28 49
       {(article ? true : null) && <meta property="og:type" content="article" />}
@@ -39,33 +60,25 @@ const SEO = ({ title, description, image, article }) => {
39 60
       {seo.description && (
40 61
         <meta name="twitter:description" content={seo.description} />
41 62
       )}
42
-      {seo.image && <meta name="twitter:image" content={seo.image} />}
63
+      {seo.image && <meta name="twitter:image" content={seo.image} />*/}
43 64
     </Helmet>
44 65
   )
45 66
 }
46 67
 export default SEO
47
-SEO.propTypes = {
48
-  title: PropTypes.string,
49
-  description: PropTypes.string,
50
-  image: PropTypes.string,
51
-  article: PropTypes.bool,
52
-}
53
-SEO.defaultProps = {
54
-  title: null,
55
-  description: null,
56
-  image: null,
57
-  article: false,
58
-}
68
+
59 69
 const query = graphql`
60
-  query SEO {
70
+  query SEOQuery {
61 71
     site {
62 72
       siteMetadata {
63
-        defaultTitle: title
64
-        titleTemplate
65
-        defaultDescription: description
66
-        siteUrl: url
67
-        defaultImage: image
68
-        twitterUsername
73
+        url
74
+      }
75
+    }
76
+    allPostsYaml {
77
+      edges {
78
+        node {
79
+          title
80
+          url
81
+        }
69 82
       }
70 83
     }
71 84
   }

BIN
src/images/favicon.png View File


BIN
src/images/gatsby-astronaut.png View File


BIN
src/images/gatsby-icon.png View File


BIN
static/files/comix-diary/01.png View File


BIN
static/files/comix-diary/02.png View File


BIN
static/files/comix-diary/03.png View File


BIN
static/files/comix-diary/04.png View File


BIN
static/files/comix-diary/05.png View File


BIN
static/files/comix-diary/06.png View File


BIN
static/files/comix-diary/07.png View File


BIN
static/files/comix-diary/08.png View File


BIN
static/files/comix-diary/09.png View File


BIN
static/files/comix-diary/10.png View File


BIN
static/files/comix-diary/11.png View File


BIN
static/files/comix-diary/12.png View File


BIN
static/files/comix-diary/13.png View File


BIN
static/files/comix-diary/14.png View File


BIN
static/files/comix-diary/15.png View File


BIN
static/files/comix-diary/16.png View File


BIN
static/files/comix-diary/17.png View File


BIN
static/files/comix-diary/18.png View File


BIN
static/files/comix-diary/19.png View File


BIN
static/files/comix-diary/20.png View File


BIN
static/files/comix-diary/21.png View File


BIN
static/files/comix-diary/22.png View File


BIN
static/files/comix-diary/23.png View File


BIN
static/files/comix-diary/24.png View File


BIN
static/files/comix-diary/25.png View File