15 | }
16 |
17 | export default function App({ Component, pageProps }) {
18 | return (
19 |
20 |
21 |
22 |
23 |
24 | )
25 | }
26 |
--------------------------------------------------------------------------------
/pages/excalidrawn.md:
--------------------------------------------------------------------------------
1 | # Excalidrawn
2 |
3 | ## PNG Drawing
4 | 
5 | ```markdown
6 | 
7 | ```
8 |
9 | ## SVG Drawing
10 | 
11 | ```markdown
12 | 
13 | ```
14 |
15 | Created using [Excalidraw](https://excalidraw.com/)
16 |
17 |
--------------------------------------------------------------------------------
/pages/inbox.md:
--------------------------------------------------------------------------------
1 | # Inbox
2 |
3 | - Here you can write disorganised notes to be categorised later
4 | - Bullet points are useful, but it could be free form text as well
5 | - Sometimes it's better to just get things off your mind quickly, rather than stop to think where it belongs
6 | - But don't let this list get too long
7 | - Move information to more specific documents and link to them.
8 | - This helps you navigate between documents quickly
9 | - For example, you can `Cmd`+`Click` this: [[todo]]
10 | - Some notes don't end up making sense the next day
11 | - That's ok, you can just delete them!
12 | - You can always find them in your git history, if you really need it!
13 |
14 |
15 |
16 | [//begin]: # "Autogenerated link references for markdown compatibility"
17 | [todo]: todo "Todo"
18 | [//end]: # "Autogenerated link references"
--------------------------------------------------------------------------------
/pages/index.md:
--------------------------------------------------------------------------------
1 | # Foamy NextJS
2 |
3 | ## Foam
4 | - [[readme]]
5 | - [[inbox]]
6 | - [[todo]]
7 | - For up-to-date tips, see [Foam Recipes](https://foambubble.github.io/foam/recipes/recipes)
8 |
9 | ## NextJS
10 | - [Learn NextJS](https://nextjs.org/learn/basics/create-nextjs-app)
11 | - [NextJS Examples](https://github.com/vercel/next.js/tree/canary/examples)
12 |
13 | ### Examples
14 | - [[syntax-highlighting]]
15 | - image in markdown [[excalidrawn]]
16 | - [[next-image-component-example]]
17 | - [[note]] in subfolder using remark footnotes
18 | - [[jsx-component-in-mdx-example]]
19 |
20 |
21 |
22 | [//begin]: # "Autogenerated link references for markdown compatibility"
23 | [readme]: readme "Foam"
24 | [inbox]: inbox "Inbox"
25 | [todo]: todo "Todo"
26 | [syntax-highlighting]: notes/syntax-highlighting "Syntax Highlighting"
27 | [excalidrawn]: excalidrawn "Excalidrawn"
28 | [next-image-component-example]: next-image-component-example "Next Image Component Example"
29 | [note]: notes/note "Note"
30 | [jsx-component-in-mdx-example]: jsx-component-in-mdx-example "JSX Component in Mdx Example"
31 | [//end]: # "Autogenerated link references"
--------------------------------------------------------------------------------
/pages/jsx-component-in-mdx-example.md:
--------------------------------------------------------------------------------
1 | import Button from '../components/button.js'
2 |
3 | # JSX Component in Mdx Example
4 |
5 | Look, a button! 👇
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/pages/next-image-component-example.md:
--------------------------------------------------------------------------------
1 | # Next Image Component Example
2 |
3 | ## Markdown image syntax
4 | - Uses default options for `next/image` component.
5 | - `next/image` requires absolute paths for src
6 | - width and height is required
7 | - I set default dimensions, so `next/image` component won't throw an error, but it will distort your images if you don't provide image dimensions in the query string
8 | ```markdown
9 | 
10 | ```
11 | **NOTE:** Markdown image syntax does not accept any other props in the query string.
12 |
13 |
14 | ## Custom JSX in MDX tag
15 | Example using `next/image` component via custom JSX in MDX tag ``
16 |
17 |
18 |
19 | ```jsx
20 |
21 | ```
22 | Following props are accepted and its defaults in ``
23 | ```js
24 | let {
25 | src,
26 | alt,
27 | width = 600,
28 | height = 460,
29 | layout = 'intrinsic' } = props
30 | ```
31 |
32 | **NOTE:** I decided not to support `layout='fill'` option because it's overly complicated for use in markdown content. I recommend importing `next/image` component and work with it directly since it requires wrapping a div container and tinkering with its style.
33 |
34 | If you don't want your images to be aligned center, you can change CSS styling for `.nextImageWrapper` in global.css
35 |
36 | If you want to customize your MDX components, you can find this code in `_app.js`
37 | ```js
38 | import Image from '../components/Image'
39 |
40 | const mdComponents = {
41 | a: props => ,
42 | code: CodeBlock,
43 | img: (props) =>
,
44 | Image: (props) =>
45 | }
46 | ```
47 |
--------------------------------------------------------------------------------
/pages/notes/note.md:
--------------------------------------------------------------------------------
1 | # Note
2 |
3 | A note in subfolder
4 |
5 | `remark-numbered-footnote-labels` is a quality plugin[^quality]!
6 |
7 | I'm baby distillery squid cloud bread thundercats enamel pin mixtape scenester, poke raw denim. Tumblr stumptown hashtag beard. +1 vinyl master cleanse raclette shaman, hot chicken etsy pork belly forage chillwave you probably haven't heard of them salvia. Gastropub irony kickstarter PBR&B tofu salvia.[^hipsum]
8 |
9 |
10 | [^quality]: If you do not find it so, please file a GitHub issue or pull request!
11 | [^hipsum]: [Hipsum](https://hipsum.co/)
12 |
--------------------------------------------------------------------------------
/pages/notes/syntax-highlighting.md:
--------------------------------------------------------------------------------
1 | # Syntax Highlighting
2 |
3 | Using the MDXProvider
4 | ```javascript
5 | // src/App.js
6 | import React from 'react'
7 | import {MDXProvider} from '@mdx-js/react'
8 | const components = {
9 | pre: props => ,
10 | code: props =>
11 | }
12 | export default props => (
13 |
14 |
15 |
16 | )
17 | ```
18 |
19 | Source -> [MDXJS](https://mdxjs.com/guides/syntax-highlighting)
--------------------------------------------------------------------------------
/pages/readme.md:
--------------------------------------------------------------------------------
1 | # Foam
2 |
3 | 👋 Welcome to your new Foam Workspace!
4 |
5 | ## Getting started
6 |
7 | This documentation assumes that you have a GitHub account and have [Visual Studio Code](https://code.visualstudio.com/) installed on your Linux/MacOS/Windows machine.
8 |
9 | 1. If you haven't yet, browse over to the main [Foam documentation workspace](https://foambubble.github.io/foam) to get an idea of what Foam is and how to use it.
10 | 2. Press "Use this template" button at [foam-template](https://github.com/foambubble/foam-template/generate) (that's this repository!) to fork it to your own GitHub account. If you want to keep your thoughts to yourself, remember to set the repository private.
11 | 3. [Clone the repository to your local machine](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) and open it in VS Code.
12 |
13 | *Open the repository as a folder using the `File > Open...` menu item. In VS Code, "open workspace" refers to [multi-root workspaces](https://code.visualstudio.com/docs/editor/multi-root-workspaces).*
14 |
15 | 4. When prompted to install recommended extensions, click **Install all** (or **Show Recommendations** if you want to review and install them one by one)
16 |
17 | After setting up the repository, open [.vscode/settings.json](.vscode/settings.json) and edit, add or remove any settings you'd like for your Foam workspace.
18 |
19 | To learn more about how to use **Foam**, read the [Recipes](https://foambubble.github.io/foam/recipes) bubbles of the Foam documentation workspace.
20 |
21 |
22 | ## Using Foam
23 |
24 | We've created a few Bubbles (markdown documents) to get you started.
25 |
26 | - [[inbox]] - a place to write down quick notes to be categorised later
27 | - [[foam-tips]] - tips to get the most out of your Foam workspace
28 | - [[todo]] - a place to keep track of things to do
29 |
30 | ## Note on `[[wiki-links]]`
31 |
32 | ⚠️ Until [foambubble/foam#16](https://github.com/foambubble/foam/issues/16) is resolved, `[[wiki-links]]` links (like the links above) won't work in the GitHub Markdown preview (i.e. this Readme on github.com).
33 |
34 | They should work as expected in VS Code, and in rendered GitHub Pages.
35 |
36 | If GitHub preview (or general 100% support with all Markdown tools) is a requirement, for the time being you can use the standard `[description](page.md)` syntax.
37 |
38 |
39 |
40 |
41 |
42 | [//begin]: # "Autogenerated link references for markdown compatibility"
43 | [inbox]: inbox "Inbox"
44 | [todo]: todo "Todo"
45 | [//end]: # "Autogenerated link references"
--------------------------------------------------------------------------------
/pages/todo.md:
--------------------------------------------------------------------------------
1 | # Todo
2 |
3 | - [x] This is an example of a todo list item that's complete
4 | - [x] Todo lists are useful for keeping organised and focused
5 | - [ ] This one is not completed yet
6 | - [ ] You can mark it completed by pressing `Option`+`C` (or `Alt`+`C`) when your cursor is on this line
7 | - [ ] You can also select multiple lines and mark them all at once!
8 | - [ ] When you press enter at the end of a line, it adds a new todo item on the next line
9 | - [ ] This, and more is provided by the [Markdown All in One](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one) plugin by [Yu Zhang](https://github.com/yzhang-gh)
10 |
--------------------------------------------------------------------------------
/public/images/excalidrawn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yenly/foamy-nextjs/3f6a1fc9d931a6852c26df102631a942a7c7aba9/public/images/excalidrawn.png
--------------------------------------------------------------------------------
/public/images/excalidrawn.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/siteconfig.js:
--------------------------------------------------------------------------------
1 | export default {
2 | "title": "Foamy NextJS",
3 | "description": "Digital Garden built with Foam and NextJS with MDX",
4 | "author": "Yenly Ma"
5 | }
--------------------------------------------------------------------------------
/styles/global.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | /* begin gridlover perfect fourth scale */
6 | html, .root {
7 | font-size: 18px;
8 | line-height: 27px;
9 | }
10 | body {
11 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu,
12 | Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
13 | font-size: 1rem;
14 | line-height: 1.5rem;
15 | }
16 | h1, .h1 {
17 | font-size: 2.3888889rem;
18 | line-height: 3rem;
19 | margin-top: 1.5rem;
20 | margin-bottom: 3rem;
21 | }
22 | h2, .h2 {
23 | font-size: 1.7777778rem;
24 | line-height: 3rem;
25 | margin-top: 1.5rem;
26 | margin-bottom: 1.5rem;
27 | }
28 | h3, .h3 {
29 | font-size: 1.3333333rem;
30 | line-height: 1.5rem;
31 | margin-top: 1.5rem;
32 | margin-bottom: 0rem;
33 | }
34 | h4, .h4 {
35 | font-size: 1rem;
36 | line-height: 1.5rem;
37 | margin-top: 1.5rem;
38 | margin-bottom: 0rem;
39 | }
40 | h5, .h5 {
41 | font-size: 1rem;
42 | line-height: 1.5rem;
43 | margin-top: 1.5rem;
44 | margin-bottom: 0rem;
45 | }
46 | p, ul, ol, pre, table, blockquote {
47 | margin-top: 0rem;
48 | margin-bottom: 1.5rem;
49 | }
50 | ul ul, ol ol, ul ol, ol ul {
51 | margin-top: 0rem;
52 | margin-bottom: 0rem;
53 | }
54 |
55 | /* Let's make sure all's aligned */
56 | hr, .hr {
57 | border: 1px solid;
58 | margin: -1px 0;
59 | }
60 | a, b, i, strong, em, small, code {
61 | line-height: 0;
62 | }
63 | sub, sup {
64 | line-height: 0;
65 | position: relative;
66 | vertical-align: baseline;
67 | }
68 | sup {
69 | top: -0.5em;
70 | }
71 | sub {
72 | bottom: -0.25em;
73 | }
74 | /* end gridlover perfect fourth scale */
75 |
76 | .container {
77 | max-width: 680px;
78 | margin: auto;
79 | }
80 |
81 | .contains-task-list {
82 | list-style-type: none;
83 | }
84 |
85 | .task-list-item input {
86 | margin-left: -20px;
87 | }
88 |
89 | pre {
90 | font-size: 0.80rem;
91 | }
92 |
93 | a {
94 | color: #0070f3;
95 | text-decoration: none;
96 | }
97 |
98 | a:hover {
99 | text-decoration: underline;
100 | }
101 |
102 | /* img {
103 | max-width: 100%;
104 | display: block;
105 | } */
106 |
107 | .nextImageWrapper {
108 | text-align: center;
109 | }
110 |
111 | .footnotes {
112 | font-size: 0.8rem;
113 | line-height: 1.25rem;
114 | }
--------------------------------------------------------------------------------
/styles/prism-theme-night-owl.css:
--------------------------------------------------------------------------------
1 | code[class*="language-"],
2 | pre[class*="language-"] {
3 | color: #d6deeb;
4 | font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
5 | text-align: left;
6 | white-space: pre;
7 | word-spacing: normal;
8 | word-break: normal;
9 | word-wrap: normal;
10 | line-height: 1.5;
11 |
12 | -moz-tab-size: 4;
13 | -o-tab-size: 4;
14 | tab-size: 4;
15 |
16 | -webkit-hyphens: none;
17 | -moz-hyphens: none;
18 | -ms-hyphens: none;
19 | hyphens: none;
20 | }
21 |
22 | pre[class*="language-"]::-moz-selection,
23 | pre[class*="language-"] ::-moz-selection,
24 | code[class*="language-"]::-moz-selection,
25 | code[class*="language-"] ::-moz-selection {
26 | text-shadow: none;
27 | background: rgba(29, 59, 83, 0.99);
28 | }
29 |
30 | pre[class*="language-"]::selection,
31 | pre[class*="language-"] ::selection,
32 | code[class*="language-"]::selection,
33 | code[class*="language-"] ::selection {
34 | text-shadow: none;
35 | background: rgba(29, 59, 83, 0.99);
36 | }
37 |
38 | @media print {
39 | code[class*="language-"],
40 | pre[class*="language-"] {
41 | text-shadow: none;
42 | }
43 | }
44 |
45 | /* Code blocks */
46 | pre[class*="language-"] {
47 | padding: 1em;
48 | margin: 0.5em 0;
49 | overflow: auto;
50 | }
51 |
52 | :not(pre) > code[class*="language-"],
53 | pre[class*="language-"] {
54 | color: white;
55 | background: #011627;
56 | }
57 |
58 | :not(pre) > code[class*="language-"] {
59 | padding: 0.1em;
60 | border-radius: 0.3em;
61 | white-space: normal;
62 | }
63 |
64 | .token.comment,
65 | .token.prolog,
66 | .token.cdata {
67 | color: rgb(99, 119, 119);
68 | font-style: italic;
69 | }
70 |
71 | .token.punctuation {
72 | color: rgb(199, 146, 234);
73 | }
74 |
75 | .namespace {
76 | color: rgb(178, 204, 214);
77 | }
78 |
79 | .token.deleted {
80 | color: rgba(239, 83, 80, 0.56);
81 | font-style: italic;
82 | }
83 |
84 | .token.symbol,
85 | .token.property {
86 | color: rgb(128, 203, 196);
87 | }
88 |
89 | .token.tag,
90 | .token.operator,
91 | .token.keyword {
92 | color: rgb(127, 219, 202);
93 | }
94 |
95 | .token.boolean {
96 | color: rgb(255, 88, 116);
97 | }
98 |
99 | .token.number {
100 | color: rgb(247, 140, 108);
101 | }
102 |
103 | .token.constant,
104 | .token.function,
105 | .token.builtin,
106 | .token.char {
107 | color: rgb(130, 170, 255);
108 | }
109 |
110 | .token.selector,
111 | .token.doctype {
112 | color: rgb(199, 146, 234);
113 | font-style: italic;
114 | }
115 |
116 | .token.attr-name,
117 | .token.inserted {
118 | color: rgb(173, 219, 103);
119 | font-style: italic;
120 | }
121 |
122 | .token.string,
123 | .token.url,
124 | .token.entity,
125 | .language-css .token.string,
126 | .style .token.string {
127 | color: rgb(173, 219, 103);
128 | }
129 |
130 | .token.class-name,
131 | .token.atrule,
132 | .token.attr-value {
133 | color: rgb(255, 203, 139);
134 | }
135 |
136 | .token.regex,
137 | .token.important,
138 | .token.variable {
139 | color: rgb(214, 222, 235);
140 | }
141 |
142 | .token.important,
143 | .token.bold {
144 | font-weight: bold;
145 | }
146 |
147 | .token.italic {
148 | font-style: italic;
149 | }
150 |
--------------------------------------------------------------------------------