Skip to content

Commit 463045d

Browse files
committed
Moved to root for better integration with zeit now
1 parent 269ce59 commit 463045d

29 files changed

+15
-18
lines changed

.forestry/settings.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ sections:
1515
- type: heading
1616
label: Config
1717
- type: document
18-
path: src/data/config.json
18+
path: data/config.json
1919
label: Site Info
20-
upload_dir: src/static
21-
public_path: "/static"
20+
upload_dir: public
21+
public_path: "/"
2222
front_matter_path: ''
2323
use_front_matter_path: false
2424
file_template: ":filename:"
2525
build:
26-
preview_output_directory: src/.next
26+
preview_output_directory: .next
2727
install_dependencies_command: yarn install
2828
preview_docker_image: node:10
2929
mount_path: "/srv"

README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
<a style="padding-right: 16px;" href="https://tinacms.org">
33
<img src="https://app.forestry.io/assets/forestry-logotype-pos-c71a6bd237d9199d0457ba2811553997ff5bab0d2cd0e740686ab26c00d9c240.svg" width="112" height="28">
44
</a>
5-
<a href="https://www.nextjs.org/">
6-
<img src="src/static/nextjs-black-logo.svg" width="80" height="28">
7-
</a>
85
</p>
96
<h1 align="center">
107
Brevifolia
@@ -52,8 +49,8 @@ This will start a dev server, navigate to localhost:3000 to check it out.
5249
- Site-level configuration is stored in `data/config.json`.
5350
- Edit styles within each component or page file within the `<style jsx>` tags.
5451
- Global styles live in the `Meta` component.
52+
- `public/` is where you images live and will get uploaded.
5553
- `src/posts/`contains all your markdown blog posts.
56-
- `src/static/` is where you images live and will get uploaded.
5754
- `src/pages` is where you page components live.
5855
- The blog pages are dynamically generated with a `slug` parameter. See the template in `src/pages/blog/[slug].js`.
5956
- The pages & template are comprised of components from `src/components`.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

next.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = ({
3030
'/': { page : '/'},
3131
};
3232
//get all .md files in the posts dir
33-
const blogs = glob.sync('src/posts/**/*.md');
33+
const blogs = glob.sync('./posts/**/*.md');
3434

3535
//remove path and extension to leave filename only
3636
const blogSlugs = blogs.map(file => file.split('/')[2].replace(/ /g, '-').slice(0, - 3).trim());

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
"version": "0.1.0",
77
"author": "Jacob Ebey",
88
"scripts": {
9-
"dev": "next src",
10-
"build": "next build src",
11-
"start": "next start src",
12-
"export": "next export src",
9+
"dev": "next",
10+
"build": "next build",
11+
"start": "next start",
12+
"export": "next export",
1313
"deploy": "yarn build && yarn export",
14-
"forestry-preview": "next src -p 8080 -H 0.0.0.0"
14+
"forestry-preview": "next -p 8080 -H 0.0.0.0"
1515
},
1616
"dependencies": {
1717
"buffer": "^5.5.0",
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/pages/index.js renamed to pages/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default function HomePage() {
5454
</p>
5555
</Grid.Column>
5656
<Grid.Column floated="right" width={6} textAlign="center">
57-
<Image size="large" src="/static/federation-diagram.svg" style={{ margin: '0 auto 1rem auto' }} />
57+
<Image size="large" src="/federation-diagram.svg" style={{ margin: '0 auto 1rem auto' }} />
5858
<p>
5959
Teams can consume components at runtime instead of as part of their build pipeline
6060
</p>

src/posts/get-started.md renamed to posts/get-started.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ We are going to build out two separate Single Page Applications (SPA) that use M
2121

2222
`Application A` will contain a `SayHelloFromA` component that will be consumed by `Application B` while `Application B` will contain a `SayHelloFromB` component that will be consumed by `ApplicationA`. This looks like:
2323

24-
![](/static/get-started-diagram.svg "Architecture Diagram")
24+
![](/get-started-diagram.svg "Architecture Diagram")
2525

2626
This architecture will allow each SPA to be developed and deployed independantly along with instantly recieving updates from other federated applications with zero deployments.
2727

@@ -412,10 +412,10 @@ ReactDOM.render(
412412

413413
Looking at the network log for `Application A` you will see that we load two files from `Application B`, the `remoteEntry.js` file, then the `977.js` that contains the `SayHelloFromB` component.
414414

415-
![](/static/application-a-network-log.png)
415+
![Application B Network Log](/application-a-network-log.png)
416416

417417
Visiting `Application B` for the first time, you'll notice we have already cached the remoteEntries for both `Application B` and `Application A`.
418418

419-
![](/static/application-b-network-log.png)
419+
![Application B Network Log](/application-b-network-log.png)
420420

421421
**You have just created your first Webpack 5 Federated projects. Now go out and build something awesome!**
File renamed without changes.
File renamed without changes.

src/.DS_Store

-6 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)