Skip to content

Commit

Permalink
Merge pull request mathieudutour#31 from binnyva/revert-29-main
Browse files Browse the repository at this point in the history
Revert "Feat: Syntax highlighting and MermaidJs"
  • Loading branch information
binnyva authored Jul 25, 2021
2 parents d9c464c + d015842 commit 2d01165
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 451 deletions.
49 changes: 0 additions & 49 deletions _notes/Features.md

This file was deleted.

11 changes: 5 additions & 6 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import "bootstrap/dist/css/bootstrap.min.css" // This inclues the entire library in every file. Is there a way to include it using <link> instead? :TODO:
import "./src/styles/common.css"
import "jquery/dist/jquery.min.js"
import "popper.js/dist/popper.min"
import "bootstrap/dist/js/bootstrap.min.js"
import "prismjs/themes/prism-okaidia.css"
import 'bootstrap/dist/css/bootstrap.min.css' // This inclues the entire library in every file. Is there a way to include it using <link> instead? :TODO:
import './src/styles/common.css'
import 'jquery/dist/jquery.min.js'
import 'popper.js/dist/popper.min'
import 'bootstrap/dist/js/bootstrap.min.js'
21 changes: 9 additions & 12 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ module.exports = {
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
"gatsby-remark-mermaid",
"gatsby-remark-prismjs",
{
resolve: `gatsby-remark-wiki-links`,
options: {
Expand All @@ -64,23 +62,22 @@ module.exports = {
},
},

{
// https://www.gatsbyjs.com/plugins/gatsby-plugin-local-search
resolve: "gatsby-plugin-local-search",
{ // https://www.gatsbyjs.com/plugins/gatsby-plugin-local-search
resolve: 'gatsby-plugin-local-search',
options: {
// A unique name for the search index. This should be descriptive of
// what the index contains. This is required.
name: "notes_index",
name: 'notes_index',

// Set the search engine to create the index. This is required.
// The following engines are supported: flexsearch, lunr
engine: "flexsearch",
engine: 'flexsearch',

// Provide options to the engine. This is optional and only recommended
// for advanced users.
//
// Note: Only the flexsearch engine supports options.
engineOptions: "speed",
engineOptions: 'speed',

// GraphQL query used to fetch all data for the search index. This is
// required.
Expand All @@ -104,24 +101,24 @@ module.exports = {

// Field used as the reference value for each document.
// Default: 'id'.
ref: "id",
ref: 'id',

// List of keys to index. The values of the keys are taken from the
// normalizer function below.
// Default: all fields
index: ["title", "body", "tags"],
index: ['title', 'body', 'tags'],

// List of keys to store and make available in your UI. The values of
// the keys are taken from the normalizer function below.
// Default: all fields
store: ["id", "slug", "title"],
store: ['id', 'slug', 'title'],

// Function used to map the result from the GraphQL query. This should
// return an array of items to index in the form of flat objects
// containing properties to index. The objects must contain the `ref`
// field above (default: 'id'). This is required.
normalizer: ({ data }) =>
data.allMarkdownRemark.nodes.map(node => ({
data.allMarkdownRemark.nodes.map((node) => ({
id: node.id,
slug: node.fields.slug,
title: node.fields.title,
Expand Down
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,11 @@
"gatsby-plugin-local-search": "^2.0.1",
"gatsby-plugin-react-helmet": "^3.11.0-next.0",
"gatsby-remark-double-brackets-link": "^0.1.8",
"gatsby-remark-mermaid": "^2.1.0",
"gatsby-remark-prismjs": "^5.7.0",
"gatsby-source-filesystem": "^2.11.1",
"gatsby-transformer-remark": "^2.16.1",
"gray-matter": "^4.0.2",
"jquery": "^3.6.0",
"popper.js": "^1.16.1",
"prismjs": "^1.24.1",
"puppeteer": "^10.1.0",
"react": "^16.12.0",
"react-bootstrap": "^1.5.2",
"react-d3-graph": "^2.6.0",
Expand Down
96 changes: 45 additions & 51 deletions src/pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,61 +7,55 @@ import NoteList from "../components/note-list"

export default function Home() {
const data = useStaticQuery(graphql`
query HomeQuery {
homeNote: markdownRemark(fields: { slug: { eq: "/home" } }) {
html
fields {
title
date
}
frontmatter {
tags
}
}
notes: allMarkdownRemark(
limit: 5
sort: { fields: fields___date, order: DESC }
) {
edges {
node {
excerpt
fields {
slug
title
date
}
frontmatter {
tags
}
}
}
}
}
`)
query HomeQuery {
homeNote: markdownRemark(fields: { slug: { eq: "/home" } }) {
html
fields {
title
date
}
frontmatter {
tags
}
}
notes: allMarkdownRemark(limit: 5, sort: {fields: fields___date, order: DESC}) {
edges {
node {
excerpt
fields {
slug
title
date
}
frontmatter {
tags
}
}
}
}
}
`)

return data.homeNote ? (
<Layout title={data.homeNote.fields.title}>
<div className="note-area">
<h1 className="note-title">{data.homeNote.fields.title}</h1>
<div
className="note-content"
dangerouslySetInnerHTML={{ __html: data.homeNote.html }}
></div>
</div>
</Layout>
) : (
<Layout title="Home">
<h1>{siteConfig.siteMetadata.title}</h1>
<p className="lead">{siteConfig.siteMetadata.description}</p>
<Layout title={data.homeNote.fields.title}>
<div className="note-area">
<h1 className="note-title">{ data.homeNote.fields.title }</h1>
<div className="note-content" dangerouslySetInnerHTML={{ __html: data.homeNote.html }}></div>
</div>
</Layout>
) : (
<Layout title="Home">
<h1>{ siteConfig.siteMetadata.title }</h1>
<p className="lead">{ siteConfig.siteMetadata.description }</p>

<h3>Table Of Contents</h3>
<Menu />
<h3>Table Of Contents</h3>
<Menu />

<h3>Latest Notes</h3>
<NoteList notes={data.notes.edges} />
<h3>Latest Notes</h3>
<NoteList notes={data.notes.edges} />

<br />
<Link to="/sitemap">See All Notes</Link>
</Layout>
<br /><Link to="/sitemap">See All Notes</Link>

</Layout>
)
}
Loading

0 comments on commit 2d01165

Please sign in to comment.