Skip to content

Commit

Permalink
fix: Update blog post template to fix Disqus URL issue
Browse files Browse the repository at this point in the history
  • Loading branch information
roxberry committed Aug 13, 2024
1 parent 50f02a0 commit 54782db
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 59 deletions.
16 changes: 0 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"@fortawesome/free-brands-svg-icons": "^6.6.0",
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@fortawesome/react-fontawesome": "^0.2.2",
"disqus-react": "^1.1.5",
"gatsby": "^5.13.3",
"gatsby-plugin-disqus": "^1.2.6",
"gatsby-plugin-feed": "^5.13.1",
Expand Down
6 changes: 3 additions & 3 deletions src/components/SEO.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from "prop-types"
import { Helmet } from "react-helmet"
import { useStaticQuery, graphql } from "gatsby"

function SEO({ description = '' , lang = 'en', meta = [], image: metaImage, title, pathname }) {
function Seo({ description = '' , lang = 'en', meta = [], image: metaImage, title, pathname }) {
const { site } = useStaticQuery(
graphql`
query {
Expand Down Expand Up @@ -110,7 +110,7 @@ function SEO({ description = '' , lang = 'en', meta = [], image: metaImage, titl
)
}

SEO.propTypes = {
Seo.propTypes = {
description: PropTypes.string,
lang: PropTypes.string,
meta: PropTypes.arrayOf(PropTypes.object),
Expand All @@ -123,4 +123,4 @@ SEO.propTypes = {
pathname: PropTypes.string,
}

export default SEO
export default Seo
4 changes: 2 additions & 2 deletions src/pages/about.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from "react"
import Layout from "../components/Layout"
import SEO from "../components/SEO"
import Seo from "../components/Seo"

const AboutPage = () => {
return (
<Layout>
<SEO title="About Me" />
<Seo title="About Me" />
<section>
<h1 className="sectionTitle">About Me</h1>
<div>
Expand Down
10 changes: 5 additions & 5 deletions src/pages/contact.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from "react"
import Layout from "../components/Layout"
import SEO from "../components/SEO"
import * as contactStyles from "../styles/contact.module.scss"
import Seo from "../components/Seo"
import "../styles/contact.module.scss"

const ContactPage = () => {
return (
<Layout>
<SEO title="Contact Me" />
<Seo title="Contact Me" />
<section className="contactForm">
<h1 className="sectionTitle">Contact Me</h1>
<div>
Expand All @@ -19,7 +19,7 @@ const ContactPage = () => {
id="contactForm"
noValidate
>
<label>Email Address</label>
<label htmlFor="_replyto">Email Address</label>
<input
type="email"
name="_replyto"
Expand All @@ -29,7 +29,7 @@ const ContactPage = () => {
data-validation-required-message="Please enter your email address."
/>
<p></p>
<label>Message</label>
<label htmlFor="body">Message</label>
<textarea
rows="10"
name="body"
Expand Down
24 changes: 12 additions & 12 deletions src/pages/projects.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from "react"
import Layout from "../components/Layout"
import SEO from "../components/SEO"
import Seo from "../components/Seo"
import { StaticImage } from "gatsby-plugin-image"

const ProjectsPage = () => {
return (
<Layout>
<SEO title="Projects" />
<Seo title="Projects" />

<section>
<h1 className="sectionTitle">Projects</h1>
Expand All @@ -21,14 +21,14 @@ const ProjectsPage = () => {
background="#282828"
loading="eager"
layout="constrained"
width="250"
width={250}
/>
</div>
<div className="project-card-wide-text">
<h3>StandOut.PRO</h3>
<span>A digital platform focusing on personal consulting, analytics, and security services for promising youth athletes.</span>
<div className="project-card-link">
<a href="https://standout.pro" target="_blank">Visit the project &gt;</a>
<a href="https://standout.pro" target="_blank" rel="noreferrer">Visit the project &gt;</a>
</div>
</div>
</div>
Expand All @@ -43,14 +43,14 @@ const ProjectsPage = () => {
background="#282828"
loading="eager"
layout="constrained"
width="250"
width={250}
/>
</div>
<div className="project-card-wide-text">
<h3>ShipWrite</h3>
<span>An AI-powered application to assist the creation of high-quality writing for the professional and technical domains.</span>
<div className="project-card-link">
<a href="https:/shipwrite.app" target="_blank">Visit the project &gt;</a>
<a href="https:/shipwrite.app" target="_blank" rel="noreferrer">Visit the project &gt;</a>
</div>
</div>
</div>
Expand All @@ -64,15 +64,15 @@ const ProjectsPage = () => {
background="#282828"
loading="eager"
layout="constrained"
width="250"
width={250}

/>
</div>
<div className="project-card-wide-text">
<h3>UN2 AI</h3>
<span>An ecosystem where artificial intelligence and humanity coexist, rooted in a reciprocal relationship of respect and fairness.</span>
<div className="project-card-link">
<a href="https://un2.ai" target="_blank">Visit the project &gt;</a>
<a href="https://un2.ai" target="_blank" rel="noreferrer">Visit the project &gt;</a>
</div>
</div>
</div>
Expand All @@ -86,14 +86,14 @@ const ProjectsPage = () => {
background="#282828"
loading="eager"
layout="constrained"
width="250"
width={250}
/>
</div>
<div className="project-card-wide-text">
<h3>ACTU8.IO</h3>
<span>An innovation hub and platform that empowers developers in the robotics and Internet of Things (IoT) fields.</span>
<div className="project-card-link">
<a href="https://actu8.io" target="_blank">Visit the project &gt;</a>
<a href="https://actu8.io" target="_blank" rel="noreferrer">Visit the project &gt;</a>
</div>
</div>
</div>
Expand All @@ -107,7 +107,7 @@ const ProjectsPage = () => {
background="#282828"
loading="eager"
layout="constrained"
width="250" />
width={250} />
</div>
<div className="project-card-wide-text">
<h3>Martyr</h3>
Expand All @@ -125,7 +125,7 @@ const ProjectsPage = () => {
background="#282828"
loading="eager"
layout="constrained"
width="250"
width={250}
/>
</div>
<div className="project-card-wide-text">
Expand Down
12 changes: 3 additions & 9 deletions src/templates/blog.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from 'react'
import Layout from '../components/Layout'
import SEO from '../components/SEO'
import Seo from '../components/Seo'
import TagList from "../components/TagList"
import { GatsbyImage } from "gatsby-plugin-image"
import { graphql } from 'gatsby'
// import { DiscussionEmbed } from 'disqus-react'
import { Disqus } from 'gatsby-plugin-disqus';

const Blog = (props) => {
Expand All @@ -15,23 +14,18 @@ const Blog = (props) => {
const seoImage = postImage && postImage.src
? postImage.src.childImageSharp.resize
: null
const disqusShortname = "roxberry";
const disqusConfig = {
identifier: post.id,
title: post.frontmatter.title,
};
const pathName = props.location.pathname


return (

<Layout>
<SEO
<Seo
title={post.frontmatter.title}
description={post.frontmatter.description || post.excerpt}
image={seoImage}
pathname={pathName}>
</SEO>
</Seo>
<section>
<h1 className="postTitle">{post.frontmatter.title}</h1>
<div className="postedInfo">posted on {post.frontmatter.date} | tags: [ <TagList tags= { post.frontmatter.tags } /> ]</div>
Expand Down
17 changes: 8 additions & 9 deletions src/templates/posts.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react"
import Layout from "../components/Layout"
import SEO from "../components/SEO"
import Seo from "../components/Seo"
import Pager from "../components/Pager"
import TagList from "../components/TagList"
import { StaticImage, GatsbyImage } from "gatsby-plugin-image"
Expand All @@ -10,7 +10,6 @@ class BlogIndex extends React.Component {
render() {
const { data } = this.props
const siteTitle = data.site.siteMetadata.title
const posts = data.allMarkdownRemark.edges
const { currentPage, numPages } = this.props.pageContext
const isFirst = currentPage === 1
const isLast = currentPage === numPages
Expand All @@ -30,7 +29,7 @@ class BlogIndex extends React.Component {
}
return (
<Layout location={this.props.location} title={siteTitle}>
<SEO title="Welcome!" />
<Seo title="Welcome!" />
<section>
<h1 className="sectionTitle">Latest Posts</h1>
<div className="flexbox">
Expand Down Expand Up @@ -107,14 +106,14 @@ class BlogIndex extends React.Component {
background="#282828"
loading="eager"
layout="constrained"
width="250"
width={250}
/>
</div>
<div className="project-card-wide-text">
<h3>ShipWrite</h3>
<span>An AI-powered application to assist the creation of high-quality writing for the professional and technical domains.</span>
<div className="project-card-link">
<a href="https://shipwrite.app" target="_blank">Visit the project &gt;</a>
<a href="https://shipwrite.app" target="_blank" rel="noreferrer">Visit the project &gt;</a>
</div>
</div>
</div>
Expand All @@ -128,15 +127,15 @@ class BlogIndex extends React.Component {
background="#282828"
loading="eager"
layout="constrained"
width="250"
width={250}

/>
</div>
<div className="project-card-wide-text">
<h3>UN2 AI</h3>
<span>An ecosystem where artificial intelligence and humanity coexist, rooted in a reciprocal relationship of respect and fairness.</span>
<div className="project-card-link">
<a href="https://un2.ai" target="_blank">Visit the project &gt;</a>
<a href="https://un2.ai" target="_blank" rel="noreferrer">Visit the project &gt;</a>
</div>
</div>
</div>
Expand Down Expand Up @@ -171,7 +170,7 @@ class BlogIndex extends React.Component {
background="#282828"
loading="eager"
layout="constrained"
width="250" />
width={250} />
</div>
<div className="project-card-wide-text">
<h3>Martyr</h3>
Expand All @@ -189,7 +188,7 @@ class BlogIndex extends React.Component {
background="#282828"
loading="eager"
layout="constrained"
width="250"
width={250}
/>
</div>
<div className="project-card-wide-text">
Expand Down
4 changes: 2 additions & 2 deletions src/templates/tags.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react"
import Layout from "../components/Layout"
import SEO from "../components/SEO"
import Seo from "../components/Seo"
import TagList from "../components/TagList"
import PropTypes from "prop-types"

Expand All @@ -17,7 +17,7 @@ const Tags = ({ pageContext, data }) => {

return (
<Layout>
<SEO title={tag} />
<Seo title={tag} />
<section>
<h1><FontAwesomeIcon icon={['fas', 'tags']} />&nbsp;&nbsp;{tagHeader}</h1>
<div className="flexbox">
Expand Down

0 comments on commit 54782db

Please sign in to comment.