orgapp / gatsby-orga Goto Github PK
View Code? Open in Web Editor NEWGatsby starter website with org-mode
License: MIT License
Gatsby starter website with org-mode
License: MIT License
It looks like the root of the links is off by one level. See the Here link under My First Post.
Hi,
I came across an issue where Orga exports #+BEGIN_ASIDE
blocks as <pre>
elements in markup. This was unexpected behaviour and counter to what normal Org mode does.
As per the org mode documentation (chapter 13.9.3: HTML doctypes), they should be exported to HTML <aside>
elements. If HTML5 export isn't enabled, it should be exported to <div class="aside">
I would expect exporting to HTML5 to be a sensible default that could potentially be toggled off if someone still needs to support (very?) old browsers. If that's the case, I doubt they're using Gatsby.
Has this been addressed before?
Thanks.
Hello there. This looked like a neat tool which I was hoping to use. I spotted a problem with the demo site if you click on My First post and then click on "Here", you're taken to a dead link.
I thought I'd try to fix it, but it looks like the learning curve pretty steep. I may be missing steps, but documentation is pretty thin.
I cloned the repository and ran "yarn install && yarn run build" and ran into errors. These errors seem to be fixed by upgrading outdated packages. Should the yarn.lock file be updated in the repository?
After updating I tried to run gatsby serve, which serves up the first page just fine, but the routing for the react-router doesn't seem to work as all the links are dead links. Is this an issue with gatsby itself?
I do a bit better if I run "yarn run develop", but if I descend to the "Here" link and go back and forth between the links the server seems to go unresponsive. Again, this may be an issue with gatsby itself.
I'm mostly writing to find out if you've run into similar issues and how you handled them. I'd love to pitch in, but am trying to avoid chasing my tail too much.
Thanks,
-Doug
Orga doesn't appear to handle links in definition lists, and also does not apply the correct formatting if a link is formatted as source code using the ~
character.
I appreciate that these are two separate issues, but I hope you don't mind me opening them together, as the images show both issues.
~
characters, I expect it to be rendered in a <code>
tag.As a visual, I expected the rendered text to look like this (as rendered by Pandoc and Hakyll):
Notice the definition list 'header', and the two links at the end of the paragraph, Maybe
and Either
<code>
are not, and are instead just surrounded by ~
characters in the rendered HTML output.Here's what Orga and Gatsby renders:
In this image, the header is rendered as the literal link text content in org mode and is not a link. The two links at the end are surrounded by ~
characters and are not in <code>
tags.
This is mentioned in #14, but here's a clearer description of the issue.
It seems that when dealing with org constructs that have multiple levels of formatting, context, or other syntactic value, Orga fails to correctly apply the lower levels. This is based on what Pandoc renders, but I expect the standard Org html export would behave the same way.
It's easier to show with some examples:
Orga fails to add code formatting to links. That is a link that looks like [[https://whatever.com][~some code~]]
should be rendered with the link text in a code block. Instead, it's rendered with the ~
characters. The same goes for /
characters, which indicate the text should be italicized.
Here's the actual org content:
- [[http://learnyouahaskell.com/a-fistful-of-monads][Learn You a Haskell's chapter /A Fistful of Monads/]] and [[http://learnyouahaskell.com/a-fistful-of-monads#getting-our-feet-wet-with-maybe][the section on ~Maybe~]] ::
[[http://learnyouahaskell.com/][Learn You a Haskell]] is a pretty good introduction to Haskell that's available in its entirety from the website. The content in the /Fistful of Monads/ chapter is a bit more advanced and might require reading some of the previous chapters, but both the chapter and the book could be well worth a look.
In an aside block, you should be able to both apply formatting and add nested code blocks. The block in the first image is rendered as a <pre>
tag, but it should be an <aside>
with nested <p>
tags.
Org content:
#+begin_aside
This section has several references to the data type known as ~Maybe~. We have not covered this data type previously in this series, so a short introduction is in order if you're not already familiar with it.
~Maybe~ is used to model data that you may or may not have. It has two data constructors: ~Just~ and ~Nothing~, takes one type parameter, and is in some ways similar to how a lot of other languages have a ~null~ value, though more robust. It is similar to the ~Option~ type in other languages such as Rust, OCaml, and F#.
The data declaration is as follows:
#+begin_src haskell
data Maybe a = Just a | Nothing
deriving (Eq, Ord)
#+end_src
For more information, please see the [[https://wiki.haskell.org/Maybe][Haskell wiki article]].
#+end_aside
In other words, it seems as if any form of nested functionality causes issues.
I added the original org source too, so it should be easier to test and find out what's going wrong.
ReferenceError: regeneratorRuntime is not defined
I'm trying to move my blog from Hugo to Gatsby using orga. So I cloned the repo, installed the packages, built the site, and it works flawlessly. Then I started to move my files (~350) to the site as groups (20 ones each time), build and see if everything looks OK!
Sometimes I get the following error while building:
ERROR #85901 GRAPHQL
There was an error in your GraphQL query:
Cannot read property 'split' of undefined
1 | query BlogPostQuery($id: String!) {
2 | orgContent(id: {eq: $id}) {
> 3 | html
| ^
4 | metadata {
5 | title
6 | date
7 | }
8 | }
9 | }
10 |
File path: /home/tareef/projects/gatsby-orga/src/templates/post.js
Url path: /about_read1
Plugin: none
It doesn't seem that it's about a specific file (about-read
in this case), as the error happens unevenly. Sometimes gatsby clean
solved it but many time doesn't.
What do you suggest to investigate the issue more deeply and found the reason behind it.
Thanks.
An error occured after the steps:
gatsby new my-orga https://github.com/orgapp/gatsby-orga
cd my-orga
gatsby develop
error log:
gatsby new my-orga https://github.com/orgapp/gatsby-orga
info Creating new site from git: https://github.com/orgapp/gatsby-orga.git
Cloning into 'my-orga'...
remote: Enumerating objects: 37, done.
remote: Counting objects: 100% (37/37), done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 235 (delta 10), reused 21 (delta 7), pack-reused 198
Receiving objects: 100% (235/235), 1.04 MiB | 509.00 KiB/s, done.
Resolving deltas: 100% (114/114), done.
success Created starter directory layout
info Installing packages...
yarn install v1.13.0
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "gatsby > [email protected]" has incorrect peer dependency "[email protected]".
warning "gatsby > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
[4/4] Building fresh packages...
Done in 9.99s.
info Initialising git in my-orga
Initialized empty Git repository in /home/zhangsan/my-orga/.git/
info Create initial git commit in my-orga
info
Your new Gatsby site has been successfully bootstrapped. Start developing it by running:
$ cd my-orga
$ gatsby develop
:$ cd my-orga//my-orga$ gatsby develop
:
success open and validate gatsby-configs - 0.026 s
success load plugins - 0.130 s
success onPreInit - 0.013 s
success initialize cache - 0.022 s
success copy gatsby files - 0.027 s
success onPreBootstrap - 0.019 s
ERROR #11321 PLUGIN
"gatsby-node.js" threw an error while running the onCreateNode lifecycle:
Cannot destructure property category
of 'undefined' or 'null'.
TypeError: Cannot destructure property category
of 'undefined' or 'null'.
gatsby-node.js:40 Object.exports.onCreateNode
/home/zhangsan/my-orga/gatsby-node.js:40:47
api-runner-node.js:234 runAPI
[my-orga]/[gatsby]/dist/utils/api-runner-node.js:234:37
api-runner-node.js:347 resolve
[my-orga]/[gatsby]/dist/utils/api-runner-node.js:347:15
debuggability.js:313 Promise._execute
[my-orga]/[bluebird]/js/release/debuggability.js:313:9
promise.js:488 Promise._resolveFromExecutor
[my-orga]/[bluebird]/js/release/promise.js:488:18
promise.js:79 new Promise
[my-orga]/[bluebird]/js/release/promise.js:79:10
api-runner-node.js:346 Promise.mapSeries.plugin
[my-orga]/[gatsby]/dist/utils/api-runner-node.js:346:12
util.js:16 tryCatcher
[my-orga]/[bluebird]/js/release/util.js:16:23
reduce.js:155 Object.gotValue
[my-orga]/[bluebird]/js/release/reduce.js:155:18
reduce.js:144 Object.gotAccum
[my-orga]/[bluebird]/js/release/reduce.js:144:25
util.js:16 Object.tryCatcher
[my-orga]/[bluebird]/js/release/util.js:16:23
promise.js:517 Promise._settlePromiseFromHandler
[my-orga]/[bluebird]/js/release/promise.js:517:31
promise.js:574 Promise._settlePromise
[my-orga]/[bluebird]/js/release/promise.js:574:18
promise.js:619 Promise._settlePromise0
[my-orga]/[bluebird]/js/release/promise.js:619:10
promise.js:699 Promise._settlePromises
[my-orga]/[bluebird]/js/release/promise.js:699:18
async.js:138 _drainQueueStep
[my-orga]/[bluebird]/js/release/async.js:138:12
ERROR #11321 PLUGIN
"gatsby-node.js" threw an error while running the onCreateNode lifecycle:
Cannot destructure property category
of 'undefined' or 'null'.
TypeError: Cannot destructure property category
of 'undefined' or 'null'.
gatsby-node.js:40 Object.exports.onCreateNode
/home/zhangsan/my-orga/gatsby-node.js:40:47
api-runner-node.js:234 runAPI
[my-orga]/[gatsby]/dist/utils/api-runner-node.js:234:37
api-runner-node.js:347 resolve
[my-orga]/[gatsby]/dist/utils/api-runner-node.js:347:15
debuggability.js:313 Promise._execute
[my-orga]/[bluebird]/js/release/debuggability.js:313:9
promise.js:488 Promise._resolveFromExecutor
[my-orga]/[bluebird]/js/release/promise.js:488:18
promise.js:79 new Promise
[my-orga]/[bluebird]/js/release/promise.js:79:10
api-runner-node.js:346 Promise.mapSeries.plugin
[my-orga]/[gatsby]/dist/utils/api-runner-node.js:346:12
util.js:16 tryCatcher
[my-orga]/[bluebird]/js/release/util.js:16:23
reduce.js:155 Object.gotValue
[my-orga]/[bluebird]/js/release/reduce.js:155:18
reduce.js:144 Object.gotAccum
[my-orga]/[bluebird]/js/release/reduce.js:144:25
util.js:16 Object.tryCatcher
[my-orga]/[bluebird]/js/release/util.js:16:23
promise.js:517 Promise._settlePromiseFromHandler
[my-orga]/[bluebird]/js/release/promise.js:517:31
promise.js:574 Promise._settlePromise
[my-orga]/[bluebird]/js/release/promise.js:574:18
promise.js:619 Promise._settlePromise0
[my-orga]/[bluebird]/js/release/promise.js:619:10
promise.js:699 Promise._settlePromises
[my-orga]/[bluebird]/js/release/promise.js:699:18
async.js:138 _drainQueueStep
[my-orga]/[bluebird]/js/release/async.js:138:12
ERROR #11321 PLUGIN
"gatsby-node.js" threw an error while running the onCreateNode lifecycle:
Cannot destructure property category
of 'undefined' or 'null'.
TypeError: Cannot destructure property category
of 'undefined' or 'null'.
gatsby-node.js:40 Object.exports.onCreateNode
/home/zhangsan/my-orga/gatsby-node.js:40:47
api-runner-node.js:234 runAPI
[my-orga]/[gatsby]/dist/utils/api-runner-node.js:234:37
api-runner-node.js:347 resolve
[my-orga]/[gatsby]/dist/utils/api-runner-node.js:347:15
debuggability.js:313 Promise._execute
[my-orga]/[bluebird]/js/release/debuggability.js:313:9
promise.js:488 Promise._resolveFromExecutor
[my-orga]/[bluebird]/js/release/promise.js:488:18
promise.js:79 new Promise
[my-orga]/[bluebird]/js/release/promise.js:79:10
api-runner-node.js:346 Promise.mapSeries.plugin
[my-orga]/[gatsby]/dist/utils/api-runner-node.js:346:12
util.js:16 tryCatcher
[my-orga]/[bluebird]/js/release/util.js:16:23
reduce.js:155 Object.gotValue
[my-orga]/[bluebird]/js/release/reduce.js:155:18
reduce.js:144 Object.gotAccum
[my-orga]/[bluebird]/js/release/reduce.js:144:25
util.js:16 Object.tryCatcher
[my-orga]/[bluebird]/js/release/util.js:16:23
promise.js:517 Promise._settlePromiseFromHandler
[my-orga]/[bluebird]/js/release/promise.js:517:31
promise.js:574 Promise._settlePromise
[my-orga]/[bluebird]/js/release/promise.js:574:18
promise.js:619 Promise._settlePromise0
[my-orga]/[bluebird]/js/release/promise.js:619:10
promise.js:699 Promise._settlePromises
[my-orga]/[bluebird]/js/release/promise.js:699:18
async.js:138 _drainQueueStep
[my-orga]/[bluebird]/js/release/async.js:138:12
success source and transform nodes - 0.267 s
success Add explicit types - 0.017 s
success Add inferred types - 0.097 s
success Processing types - 0.059 s
success building schema - 0.231 s
ERROR #85901 GRAPHQL
There was an error in your GraphQL query:
Cannot query field "fields" on type "OrgContent".
File: gatsby-node.js:8:27
ERROR
Cannot query field "fields" on type "OrgContent".
GraphQLError: Cannot query field "fields" on type "OrgContent".
new Promise
graphql-runner.js:18
[my-orga]/[gatsby]/dist/bootstrap/graphql-runner.js:18:10
gatsby-node.js:8 Object.exports.createPages
/home/zhangsan/my-orga/gatsby-node.js:8:27
api-runner-node.js:234 runAPI
[my-orga]/[gatsby]/dist/utils/api-runner-node.js:234:37
api-runner-node.js:347 resolve
[my-orga]/[gatsby]/dist/utils/api-runner-node.js:347:15
debuggability.js:313 Promise._execute
[my-orga]/[bluebird]/js/release/debuggability.js:313:9
promise.js:488 Promise._resolveFromExecutor
[my-orga]/[bluebird]/js/release/promise.js:488:18
promise.js:79 new Promise
[my-orga]/[bluebird]/js/release/promise.js:79:10
โ createPages
Hi,
Thanks for the work on the package; it's the one thing that made it a viable choice for me to switch over to Gatsby, so I'm very grateful.
I've got a question about code highlighting. In the example, the first JS example is highlighted. The gatsby-config file in this repo also seems to indicate that highlighting should be automatic:
// if you don't want to have server side prism code highlight
// noHighlight: true,
However, it doesn't seem to work for me, so I'm wondering how it's supposed to work? I tried both with and without :exports code
, with rust, toml, and js, but there's no highlighting going on.
I was able to make prismjs work by using the remark plugin as below, though:
{
resolve: `gatsby-transformer-orga`,
options: {
plugins: [
{
resolve: `gatsby-remark-prismjs`,
options: {
aliases: { sh: "bash" },
showLineNumbers: true,
},
},
],
},
},
but the root pre
tags don't have the right class attached, so I need to manually set their background color. It's a hack, but it works.
Any ideas on what should be changed in order to use with gatsby v2?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.