forked from dotnet/AspNetCore.Docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request dotnet#6 from madewithkoji/gatsby-ascii-doc
Gatsby ascii doc
- Loading branch information
Showing
44 changed files
with
17,184 additions
and
442 deletions.
There are no files selected for viewing
This file contains 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,18 @@ | ||
# Logs | ||
logs | ||
*.log | ||
|
||
# Cache | ||
.cache | ||
|
||
# Node | ||
node_modules | ||
|
||
# Build | ||
public | ||
|
||
# IDE specific | ||
.idea/ | ||
.vscode/ | ||
*.sw* | ||
|
This file contains 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,14 @@ | ||
The BSD Zero Clause License (0BSD) | ||
|
||
Copyright (c) 2020 Gatsby Inc. | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. |
This file contains 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,3 +1,7 @@ | ||
# draft-docs | ||
|
||
This repo is a place to draft docs and test doc things. | ||
## Installation & Local Development | ||
|
||
Clone this repo, install nvm, make sure you are using v12.14.1 | ||
|
||
`gatsby develop` |
This file contains 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,28 @@ | ||
/** | ||
* Configure your Gatsby site with this file. | ||
* | ||
* See: https://www.gatsbyjs.org/docs/gatsby-config/ | ||
*/ | ||
|
||
module.exports = { | ||
/* Your site config here */ | ||
plugins: [ | ||
{ | ||
resolve: `gatsby-transformer-asciidoc`, | ||
options: { | ||
safe: 'server', | ||
attributes: { | ||
showtitle: true, | ||
imagesdir: `/images`, | ||
}, | ||
}, | ||
}, | ||
{ | ||
resolve: `gatsby-source-filesystem`, | ||
options: { | ||
name: `pages`, | ||
path: `${__dirname}/src`, | ||
}, | ||
}, | ||
], | ||
} |
This file contains 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,42 @@ | ||
exports.createPages = async ({ actions, graphql, reporter }) => { | ||
const { createPage } = actions | ||
|
||
const articleTemplate = require.resolve(`./src/templates/article.js`) | ||
|
||
const result = await graphql(` | ||
query { | ||
allAsciidoc { | ||
edges { | ||
node { | ||
id | ||
html | ||
document { | ||
title | ||
} | ||
pageAttributes { | ||
slug | ||
} | ||
} | ||
} | ||
} | ||
} | ||
`) | ||
|
||
// Handle errors | ||
if (result.errors) { | ||
reporter.panicOnBuild(`Error while running GraphQL query.`) | ||
return | ||
} | ||
|
||
result.data.allAsciidoc.edges.forEach(({ node }) => { | ||
createPage({ | ||
path: node.pageAttributes.slug, | ||
component: articleTemplate, | ||
context: { | ||
id: node.id, | ||
// additional data can be passed via context | ||
slug: node.pageAttributes.slug, | ||
}, | ||
}) | ||
}) | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.