-
Notifications
You must be signed in to change notification settings - Fork 10
chore: Update scaffold project #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
f240b6f
Initial update for the README.md
colinmurphy e6be458
Setup templates to use multiple queries.
colinmurphy ef4e07d
Tidy up.
colinmurphy e9fbb4c
Major refactor of templates
colinmurphy a768a7a
Refactored archive template with load more functionality. Small bug t…
colinmurphy 904a090
Setup prettier and ran it to prettify the application.
colinmurphy 970d98a
Fixed styling for header on mobile. Moved styles for header, footer e…
colinmurphy 13c61ff
Fixed bug in single post. Added file structure and screenshots to the…
colinmurphy 3a92bd1
Added main query for archive to the multiple queries so Faust could f…
colinmurphy 8114271
Removed inline styling
colinmurphy 8412b93
Small style issue
colinmurphy f4dc672
Updated docs as per @moonmeister suggestion.
colinmurphy 822a674
Update README.md
colinmurphy 2b319c2
Update wp-templates/archive.js
colinmurphy f122abc
Update next.config.js
colinmurphy 9db9d5e
Small snags - Fixed h1, removed package-lock.json
colinmurphy c776234
Removed Faust Query. Fixed menu issue thanks @ahuseyn and @moonmeister
colinmurphy c73ce3a
Update README.md
colinmurphy 5947dfb
Update README.md
colinmurphy 861db77
Update README.md
colinmurphy e214bad
Update README.md
colinmurphy 98011bb
Update README.md
colinmurphy 8294553
Update README.md
colinmurphy 9cd6592
chore: change component filenames to PascalCase
ahuseyn f92a921
Merge pull request #35 from wpengine/change-component-names
colinmurphy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| /node_modules | ||
| /.pnp | ||
| .pnp.js | ||
| package-lock.json | ||
|
|
||
| # testing | ||
| /coverage | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| lts/jod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import Link from "next/link"; | ||
| import Image from "next/image"; | ||
| import styles from "../styles/featured-image.module.css"; | ||
|
|
||
| export function FeaturedImage({ | ||
| post, | ||
| classNames = "h-48 my-9 relative", | ||
| uri = false, | ||
| title = "", | ||
| }) { | ||
| if (!post.featuredImage?.node?.sourceUrl) { | ||
| return ""; | ||
| } | ||
|
|
||
| return ( | ||
| <div className={styles.wrapper + " " + classNames}> | ||
| {typeof uri === "string" && uri.trim() !== "" ? ( | ||
| <Link href={uri} title={title} className={styles.link}> | ||
| <Image | ||
| src={post.featuredImage.node.sourceUrl} | ||
| alt={post.featuredImage.node.altText || post.title} | ||
| fill | ||
| sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw" | ||
| className={styles.image} | ||
| /> | ||
| </Link> | ||
| ) : ( | ||
| <Image | ||
| src={post.featuredImage.node.sourceUrl} | ||
| alt={post.featuredImage.node.altText || post.title} | ||
| fill | ||
| sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw" | ||
| className={styles.image} | ||
| /> | ||
| )} | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import styles from "../styles/footer.module.css"; | ||
|
|
||
| export default function Footer() { | ||
| return ( | ||
| <footer className={styles.footer}> | ||
| Powered by{" "} | ||
| <a href="https://wpengine.com" target="_blank" rel="noopener noreferrer"> | ||
| WP Engine | ||
| </a> | ||
| <span> | ||
| © {new Date().getFullYear()} | ||
| </span> | ||
| </footer> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| import { gql } from "@apollo/client"; | ||
| import Link from "next/link"; | ||
| import style from "../styles/header.module.css"; | ||
|
|
||
| export default function Header({ siteTitle, siteDescription, menuItems }) { | ||
| return ( | ||
| <header className={style.header}> | ||
| <div className={`container ${style.container}`}> | ||
| <Link href="/" className={style.brand}> | ||
| <h2 className={style.siteTitle}>{siteTitle}</h2> | ||
| <p className={style.siteDescription}>{siteDescription}</p> | ||
| </Link> | ||
|
|
||
| <nav className={style.nav}> | ||
| <ul> | ||
| {(Array.isArray(menuItems) ? menuItems : []).map((item) => ( | ||
| <li key={item.id}> | ||
| <Link href={item.uri}>{item.label}</Link> | ||
| </li> | ||
| ))} | ||
| </ul> | ||
| </nav> | ||
| </div> | ||
| </header> | ||
| ); | ||
| } | ||
|
|
||
| Header.fragments = { | ||
| entry: gql` | ||
| fragment HeaderFragment on RootQuery { | ||
| generalSettings { | ||
| title | ||
| description | ||
| } | ||
| primaryMenuItems: menuItems(where: { location: PRIMARY }) { | ||
| nodes { | ||
| id | ||
| uri | ||
| path | ||
| label | ||
| parentId | ||
| cssClasses | ||
| menu { | ||
| node { | ||
| name | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| `, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import Link from "next/link"; | ||
| import { FeaturedImage } from "./FeaturedImage"; | ||
| import styles from "../styles/post-list-item.module.css"; | ||
|
|
||
| export default function PostListItem({ post }) { | ||
| const { title, excerpt, uri, date } = post; | ||
|
|
||
| return ( | ||
| <article className={styles.article}> | ||
| <time className={styles.time} dateTime={post.date}> | ||
| {new Date(date).toLocaleDateString(undefined, { | ||
| year: "numeric", | ||
| month: "long", | ||
| day: "numeric", | ||
| })} | ||
| </time> | ||
|
|
||
| <h2 className={styles.title}> | ||
| <Link href={uri} title={title} className={styles.link}> | ||
| {title} | ||
| </Link> | ||
| </h2> | ||
|
|
||
| {post.author && post.author.node && ( | ||
| <div className={styles.authorRow}> | ||
| <span>by {post.author.node.name}</span> | ||
| </div> | ||
| )} | ||
|
|
||
| <FeaturedImage | ||
| post={post} | ||
| uri={uri} | ||
| title={title} | ||
| classNames="h-48 my-9 relative" | ||
| /> | ||
|
|
||
| <div | ||
| className={styles.excerpt} | ||
| dangerouslySetInnerHTML={{ __html: excerpt }} | ||
| /> | ||
|
|
||
| <Link href={uri} title="Read more" className={styles.readMore}> | ||
| Read more | ||
| </Link> | ||
| </article> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { gql } from "@apollo/client"; | ||
|
|
||
| export const POST_LIST_FRAGMENT = gql` | ||
| fragment PostListFragment on Post { | ||
| id | ||
| title | ||
| uri | ||
| excerpt | ||
| date | ||
| featuredImage { | ||
| node { | ||
| sourceUrl | ||
| altText | ||
| } | ||
| } | ||
| author { | ||
| node { | ||
| name | ||
| avatar { | ||
| url | ||
| } | ||
| } | ||
| } | ||
| } | ||
| `; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,11 @@ | ||
| const { withFaust, getWpHostname } = require('@faustwp/core'); | ||
| const { withFaust } = require("@faustwp/core"); | ||
|
|
||
| /** | ||
| * @type {import('next').NextConfig} | ||
| **/ | ||
| module.exports = withFaust({}); | ||
| module.exports = withFaust({ | ||
| images: { | ||
| domains: ["faustexample.wpengine.com"], | ||
| }, | ||
|
colinmurphy marked this conversation as resolved.
|
||
| trailingSlash: true, | ||
| }); | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.