New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flowershow conversion #81
Comments
* tailwind monitors content directory WARNING: broken but pushing for collaborators.
@khalilcodes progress on site is looking great 👏 First, don't worry too much about getting this too similar to before as we are probably going to deprecate this site soon and merge into main life itself! In terms of remaining work:
I've added both of these to the description. |
@rufuspollock remaining tasks completed with some additional info at the end of notes that may be useful later. |
@khalilcodes can you link me to an example of the site with profile page working? For me https://ecosystem.lifeitself.us/profiles/life-itself still shows unformatted page? |
FIXED. All working. See https://ecosystem.lifeitself.us/ and https://ecosystem.lifeitself.us/profiles/life-itself. |
Introduce flowershow and/or refactor towards it.
Acceptance
NB: one big issue is we are passing all profile data to every page so the basic page load is now 500kb!! This is because this is the only way we have found to pass data in with contentlayer and mdx atm. See datopian/flowershow#20 for details.
Tasks
Refactor
content/index.md
<div className="...">....</div>
Seecontent/index.md
- svg needs to be wrapped in a fragment ie. <>...</> so added this to mdx components for default behavior
-
Link, Hero, Search, TernaryPlot, CircularVis
<TernaryPlot orgs={orgs} />
-
useMDXComponent(body.code, { orgs: ... }
will make orgs accessible as a variable globally (in md files). Seepages/[[...slug]].js
for implementation.- defined two separate document types
Profile
andTopic
with respective fields incontentlayer.config.js
javascript import { allDocuments, allProfiles, allTopics } from 'contentlayer/generated' /** allDocuments => [ allPages, allProfiles, allTopics ] using allDocuments to generate all paths allProfiles => getOrganizations() */
name => title
content/profiles/...
, values in frontmatter differ from the orignal json. eg...topic: 0 // this was an empty array [] in the json db
. Why we need an array? => used in vis components to map by topics FIX: resolve 0 values to array for lists incontentlayer.config.js => Profile
layout/profile.js
layout: profile
Notes
Where we are now
Current layout of pages
Content folder:
Future
Layout of pages
Content folder:
Some interesting findings (only for info)
From https://www.contentlayer.dev/docs/reference/source-files/define-document-type#contenttype-default-markdown
With contentlayer we can even source content from json/yaml files using the contentType...
Also global configs... documentation
The text was updated successfully, but these errors were encountered: