convert internal markdown links to gatsby links automatically

This commit is contained in:
neri 2021-05-15 22:36:47 +02:00
parent b80faa6f50
commit b7edc4a079
7 changed files with 28 additions and 19 deletions

View File

@ -24,7 +24,7 @@ Wie du deine Änderung veröffentlichst steht in der Sektion Deploy.
## Eine neue Seite erstellen ## Eine neue Seite erstellen
Um eine neue Seite zu erstellen lege eine neue Datei im `src/webpages` Ordner Um eine neue Seite zu erstellen lege eine neue Datei im `src/webpages` Ordner
[hier](https://repos.ctdo.de/neri/ctdo-homepage/src/branch/master/src/webpages) an. [hier](https://repos.ctdo.de/neri/ctdo-homepage/_new/master/src/webpages) an.
Wie die Seite aufgebaut sein muss steht unten in der Sektion Seitenlayout. Wie die Seite aufgebaut sein muss steht unten in der Sektion Seitenlayout.
Wie du deine Änderung veröffentlichst steht in der Sektion Deploy. Wie du deine Änderung veröffentlichst steht in der Sektion Deploy.

View File

@ -33,7 +33,7 @@ module.exports = {
extensions: ['.mdx', '.md'], extensions: ['.mdx', '.md'],
gatsbyRemarkPlugins: [ gatsbyRemarkPlugins: [
{ {
resolve: `gatsby-remark-images`, resolve: 'gatsby-remark-images',
options: { options: {
maxWidth: 1000, maxWidth: 1000,
pathPrefix: '/ctdo', pathPrefix: '/ctdo',
@ -44,6 +44,7 @@ module.exports = {
}, },
'gatsby-plugin-sharp', 'gatsby-plugin-sharp',
'gatsby-plugin-image', 'gatsby-plugin-image',
`gatsby-plugin-react-helmet`, 'gatsby-plugin-react-helmet',
'gatsby-plugin-catch-links',
], ],
} }

View File

@ -17,6 +17,7 @@
"@mdx-js/mdx": "^1.5.1", "@mdx-js/mdx": "^1.5.1",
"@mdx-js/react": "^1.5.1", "@mdx-js/react": "^1.5.1",
"gatsby": "^3.5.0", "gatsby": "^3.5.0",
"gatsby-plugin-catch-links": "^3.5.0",
"gatsby-plugin-image": "^1.5.0", "gatsby-plugin-image": "^1.5.0",
"gatsby-plugin-mdx": "^2.5.0", "gatsby-plugin-mdx": "^2.5.0",
"gatsby-plugin-react-helmet": "^4.5.0", "gatsby-plugin-react-helmet": "^4.5.0",

View File

@ -3,12 +3,12 @@ import { graphql } from 'gatsby'
import Layout from '../components/layout' import Layout from '../components/layout'
import { MDXRenderer } from 'gatsby-plugin-mdx' import { MDXRenderer } from 'gatsby-plugin-mdx'
import { MDXProvider } from '@mdx-js/react' import { MDXProvider } from '@mdx-js/react'
import { Helmet } from "react-helmet" import { Helmet } from 'react-helmet'
const MdLeakH1 = props => <h2 {...props}># {props.children}</h2> const MdLeakH1 = (props) => <h2 {...props}># {props.children}</h2>
const MdLeakH2 = props => <h3 {...props}>## {props.children}</h3> const MdLeakH2 = (props) => <h3 {...props}>## {props.children}</h3>
const MdLeakH3 = props => <h4 {...props}>### {props.children}</h4> const MdLeakH3 = (props) => <h4 {...props}>### {props.children}</h4>
const MdLeakH4 = props => <h5 {...props}>#### {props.children}</h5> const MdLeakH4 = (props) => <h5 {...props}>#### {props.children}</h5>
const components = { const components = {
h1: MdLeakH1, h1: MdLeakH1,
@ -44,7 +44,7 @@ export default function Template({
} }
export const pageQuery = graphql` export const pageQuery = graphql`
query($slug: String!) { query ($slug: String!) {
mdx(fields: { slug: { eq: $slug } }) { mdx(fields: { slug: { eq: $slug } }) {
id id
excerpt(pruneLength: 160) excerpt(pruneLength: 160)

View File

@ -3,15 +3,15 @@ import { graphql } from 'gatsby'
import Layout from '../components/layout' import Layout from '../components/layout'
import { MDXRenderer } from 'gatsby-plugin-mdx' import { MDXRenderer } from 'gatsby-plugin-mdx'
import { MDXProvider } from '@mdx-js/react' import { MDXProvider } from '@mdx-js/react'
import { Helmet } from "react-helmet" import { Helmet } from 'react-helmet'
const ide = const ide =
'https://repos.ctdo.de/neri/ctdo-homepage/_edit/master/src/webpages/' 'https://repos.ctdo.de/neri/ctdo-homepage/_edit/master/src/webpages/'
const MdLeakH1 = props => <h2 {...props}># {props.children}</h2> const MdLeakH1 = (props) => <h2 {...props}># {props.children}</h2>
const MdLeakH2 = props => <h3 {...props}>## {props.children}</h3> const MdLeakH2 = (props) => <h3 {...props}>## {props.children}</h3>
const MdLeakH3 = props => <h4 {...props}>### {props.children}</h4> const MdLeakH3 = (props) => <h4 {...props}>### {props.children}</h4>
const MdLeakH4 = props => <h5 {...props}>#### {props.children}</h5> const MdLeakH4 = (props) => <h5 {...props}>#### {props.children}</h5>
const components = { const components = {
h1: MdLeakH1, h1: MdLeakH1,
@ -48,7 +48,7 @@ export default function Template({
} }
export const pageQuery = graphql` export const pageQuery = graphql`
query($path: String!) { query ($path: String!) {
mdx(frontmatter: { path: { eq: $path } }) { mdx(frontmatter: { path: { eq: $path } }) {
body body
frontmatter { frontmatter {

View File

@ -4,7 +4,6 @@ title: 'home'
edit: 'home.md' edit: 'home.md'
--- ---
import { Link } from "gatsby"
import RoomState from "../components/roomState.js" import RoomState from "../components/roomState.js"
![Raum 2 mit gemütlichen Sofas](../images/header.jpg) ![Raum 2 mit gemütlichen Sofas](../images/header.jpg)
@ -19,14 +18,14 @@ Wir betreiben den Chaostreff aus Spaß an der Sache und um interessierten
Menschen eine Plattform zu bieten, über die man sich austauschen kann. Menschen eine Plattform zu bieten, über die man sich austauschen kann.
Wenn du Lust hast dir das mal anzuschauen, Wenn du Lust hast dir das mal anzuschauen,
dann komm gerne vorbei. <Link to="/treff">zeiten & location</Link> dann komm gerne vorbei. [zeiten & location](/treff)
Egal wer du bist, egal was du machst **bei uns sind alle Menschen willkommen**. Egal wer du bist, egal was du machst **bei uns sind alle Menschen willkommen**.
Leider sind unsere Räume aktuell nicht barrierefrei. Leider sind unsere Räume aktuell nicht barrierefrei.
Falls du Fragen hast schreibe uns an. <Link to="/kontakt">kontakt</Link> Falls du Fragen hast schreibe uns an. [kontakt](/kontakt)
Wenn du mehr über uns wissen möchtest, Wenn du mehr über uns wissen möchtest,
schau hier: <Link to="/about">über uns</Link> schau hier: [über uns](/about)
# Die nächsten Events # Die nächsten Events

View File

@ -5988,6 +5988,14 @@ gatsby-page-utils@^1.5.0:
lodash "^4.17.21" lodash "^4.17.21"
micromatch "^4.0.2" micromatch "^4.0.2"
gatsby-plugin-catch-links@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/gatsby-plugin-catch-links/-/gatsby-plugin-catch-links-3.5.0.tgz#a82a5337b771d7a79fbbb5d9b01b047b0d11d760"
integrity sha512-v0SD1hBRuQgbxZNMJR0X8i0dsaSJgtu09+FK6iQily+GYg8ffiAgT7627LOc7oAEYg5Ab/ZM96+g7m+PqvBIBw==
dependencies:
"@babel/runtime" "^7.12.5"
escape-string-regexp "^1.0.5"
gatsby-plugin-image@^1.5.0: gatsby-plugin-image@^1.5.0:
version "1.5.0" version "1.5.0"
resolved "https://registry.yarnpkg.com/gatsby-plugin-image/-/gatsby-plugin-image-1.5.0.tgz#1b965794b08df2fe70bd8add192f019c5d5535ed" resolved "https://registry.yarnpkg.com/gatsby-plugin-image/-/gatsby-plugin-image-1.5.0.tgz#1b965794b08df2fe70bd8add192f019c5d5535ed"