- Node.js
You can get the site running locally by first cloning this repo:
$ git clone https://github.com/bebatut/galaxy_mentor_network.git
Then install the dependencies:
$ cd galaxy_mentor_network
$ npm install
Then you can build the site in development mode to run it in a local server (at http://localhost:8080) and see your content:
$ npm run develop
This command includes a hot reloader which will update the site automatically each time you edit a file.
Note: the above command can fail with Node.js v17.0.0 with the error:
...
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v17.0.0
As stated in this issue, it can be solved with:
$ export NODE_OPTIONS=--openssl-legacy-provider
-
Create a markdown file in
content
folderTo add an image:
- Add the image to the
content/images
folder - Import it in the Markdown with
![Alternative text](./images/<filename>)
(Gridsome documentation)
- Add the image to the
-
Copy on the top of the file the following:
--- id: <id> title: <Title> ---
-
Replace
<id>
by the filename<Title>
by a title for the page
-
Create a
<Id>.vue
(replace<Id>
by the previous filename) file insrc/pages/
-
Copy on the top of the file the following:
<template> <Layout> <h1 class="page-title">{{ $page.main.title }}</h1> <div class="markdown" v-html="$page.main.content" /> </Layout> </template> <page-query> query { main: insert (path: "/content/<id>/") { id title content fileInfo { path } } } </page-query> <script> export default { metaInfo: { title: "GMN - <Short title>" } } </script>
-
Replace
<id>
by the filename<Short title>
by a short title for the page
-
Create a
<Name>.vue
file insrc/pages/
-
Fill your file following the structure below:
<template> <Layout> <h1>Title</h1> <!-- Add content using HTML and Bootstrap-Vue components (except the ones including images) Bootstrap-Vue doc: https://bootstrap-vue.org/docs/components/ ---!> </Layout> </template> <script> export default { metaInfo: { title: 'Galaxy Mentoring Network' } } </script>
-
To add an image:
- Add the images to
src/images
folder - Import it in the Vue file using ` (Gridsome documentation)
- Add the images to