Public
Like
moiPosterImproved
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
This PR enhances the MoiPosterImproved project to better reflect how content appears on a buildDotMoi profile. It implements a tabs-based navigation system that matches the actual buildDotMoi interface, with support for:
- A default "Posts" tab that shows all vals with moi.md files (not excluded from posts)
- Custom tabs defined in moi.md frontmatter "tabs" field
- An "Unposted" tab for vals without moi.md files
- The original tabs for Code (Public), Unlisted, and Private still exist for convenience
- ProfilePreview.tsx: Completely redesigned to fetch and display moi information for all vals, with proper sorting by tier
- Now displays custom tabs from moi.md files as defined in frontmatter
- Supports tier-based sorting (no tier first, then lowest to highest)
- Respects the "excludeFromPosts" setting from moi.md files
- Added informative notices explaining what each tab displays
-
moiProcessor.ts:
- Added a dedicated
parseMoiConfigfunction to extract configuration from moi.md files - Enhanced parsing to properly handle tier, tabs, and excludeFromPosts properties
- Added a dedicated
-
index.ts:
- Updated API endpoints to include parsed moi.md configuration in responses
- Added config parsing to both file fetching and creation/update endpoints
- Dynamic Tab Generation: Tabs are populated from the "tabs" fields in moi.md files
- Tier-Based Sorting: Vals are sorted by tier with no tier first, then lowest to highest
- Exclusion Support: "excludeFromPosts" property allows vals to appear in custom tabs but not in the main Posts tab
- Improved Preview: The interface better represents how content will appear on a buildDotMoi profile
- Start the app and enter your Val Town API key
- Notice the new tab interface showing "Posts" first, followed by any custom tabs found in your moi.md files, then "Unposted"
- Edit a val's moi.md and add a custom tab using the "Tabs" field
- Save and verify the new tab appears in the interface
- Try setting different tier values to see how it affects sorting
- Test the "Exclude from Posts" checkbox and verify it removes items from the Posts tab but keeps them in custom tabs
- The existing functionality for editing moi.md files remains unchanged - this PR only enhances the preview interface
- The MoiEditor component already supported the tabs, tier, and excludeFromPosts properties
- The generators.ts file already included support for these properties in the default moi.md generation
(Would include screenshots here in a real PR)