Giter Site home page Giter Site logo

greglobinski / react-website-themes Goto Github PK

View Code? Open in Web Editor NEW
29.0 6.0 10.0 562 KB

A collection of sets of styled ready-to-use React components to build a website. Built for Gatsby Starter Kit.

License: MIT License

JavaScript 100.00%
gatsby-starter-kit gatsby gatsbyjs react reactjs components themes

react-website-themes's Introduction

greglobinski.com

That's the code of my website (greglobinski.com). My first production-use of the Gatsby-React tandem.

Screenshots

Build with

Starting point

Additional plugins and packages

Setup

  1. Install gatsby-cli (docs)
  2. Clone the repository to your localhost
  3. Install dependencies (yarn install)
  4. Use gatsby-cli to start in development mode (docs)
  5. Have fun.

react-website-themes's People

Contributors

greglobinski avatar jkornblum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

react-website-themes's Issues

Handle external links in menu component

Hey Greg,

I'm looking to handle external links in menu component (like my github/twitter for personal site). Would you accept a PR like the following or prefer a different approach?

<ul>
        {items.map(item => {
          const { label, to, icon: Icon, external, linkProps } = item;

          return (
            <li key={label}>
            {external ? 
                <a href={to} target="_blank">
                    {Icon && <Icon />}
                    <span>{label}</span>
                </a>
            :
                <Link to={to} activeClassName="active" {...linkProps}>
                    {Icon && <Icon />}
                    <span>{label}</span>
                </Link>
            }
            </li>
          );
        })}
</ul>

in menu config you can pass external property like

const menu = [
  { label: 'Home', to: '/', icon: HomeIcon },
  { label: 'Blog', to: '/blog', icon: BlogIcon },
  { label: 'GitHub', to: 'http://github.com/jkornblum', icon: GitHubIcon, external: true },
];

schema.org templates

Hello there,

Can we add schema.org jsonLD template for BlogPosting. I use your blog starter (v1) and i changed Seo.js, created an condition for postSEO and changed original code like below;

If is that possible, i will fork this repo & try to update base SEO.js

const Seo = props => {
  const { data, facebook, postSEO } = props;
  const postTitle = ((data || {}).frontmatter || {}).title;
  const postDescription = ((data || {}).frontmatter || {}).subTitle;
  const postCover = ((data || {}).frontmatter || {}).original;
  const postSlug = ((data || {}).fields || {}).slug;
  const okat = ((data || {}).frontmatter || {}).category;
  const date = ((data || {}).fields || {}).prefix;

  const title = postTitle ? `${postTitle} - ${config.shortSiteTitle}` : config.siteTitle;
  const description = postDescription ? postDescription : config.siteDescription;
  const image = postCover ? postCover.childImageSharp.resize.src : config.siteImage;
  const url = config.siteUrl + config.pathPrefix + postSlug;

  const schemaOrgJSONLD = [
    {
      "@context": "http://schema.org",
      "@type": "WebSite",
      url: config.siteUrl,
      name: config.siteTitle,
      alternateName: config.shortSiteTitle ? config.shortSiteTitle : "",
      description: postSEO ? postDescription : config.siteDescription
    }
  ];

  if (postSEO) {
    schemaOrgJSONLD.push({
      "@context": "http://schema.org",
      "@type": "BlogPosting",
      url: url,
      mainEntityOfPage: url,
      name: title,
      articleBody: data.html,
      alternateName: config.shortSiteTitle ? config.shortSiteTitle : "",
      headline: title,
      author: config.authorName,
      datePublished: date,
      dateModified: date,
      publisher: {
        "@type": "Organization",
        name: config.authorName,
        logo: {
          "@type": "imageObject",
          url: "https://serkanalgur.com" + image
        }
      },
      image: {
        "@type": "ImageObject",
        url: "https://serkanalgur.com" + image
      },
      description
    });
  }

  return (
    <Helmet
      htmlAttributes={{
        lang: config.siteLanguage,
        prefix: "og: http://ogp.me/ns#"
      }}
    >
      {/* General tags */}
      <title>{title}</title>
      <meta name="description" content={description} />
      {/* OpenGraph tags */}
      <meta property="og:url" content={url} />
      <meta property="og:title" content={title} />
      <meta property="og:site_name" content={config.siteTitle} />
      <meta property="og:description" content={description} />
      <meta property="og:locale" content={config.siteLanguage} />
      <meta property="og:image" content={"https://serkanalgur.com" + image} />
      <meta property="og:type" content={postSEO ? "article" : "website"} />
      {postSEO ? (
        <meta property="article:author" content="https://facebook.com/serkan.algur" />
      ) : (
        ""
      )}
      {postSEO ? (
        <meta property="article:publisher" content="https://facebook.com/serkan.algur" />
      ) : (
        ""
      )}
      {postSEO ? <meta property="article:section" content={okat} /> : ""}
      <meta property="fb:app_id" content={facebook.appId} />
      {/* Twitter Card tags */}
      <meta name="twitter:card" content="summary_large_image" />
      <meta
        name="twitter:creator"
        content={config.authorTwitterAccount ? config.authorTwitterAccount : ""}
      />
      <script type="application/ld+json">{JSON.stringify(schemaOrgJSONLD)}</script>
    </Helmet>
  );
};

Seo.propTypes = {
  data: PropTypes.object,
  facebook: PropTypes.object.isRequired,
  postSEO: PropTypes.bool,
  date: PropTypes.any
};

export default Seo;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.