-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
cli: Add new Markdown route command #4955
Conversation
To make it easier to add Markdown routes. Because creating a folder with an index.md is cumbersome.
|
👷 Deploy request for qwik-insights pending review.Visit the deploys page to approve it
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @brandonpittman 👋
Thx a lot for your (first) contribution 🎉 looks great! just left a question/input. let me know when another review can happen 🙏
let nameArg: string | undefined; | ||
let outDir: string | undefined; | ||
if (mainInput && mainInput.startsWith('/')) { | ||
typeArg = 'route'; | ||
nameArg = mainInput; | ||
if (mainInput.endsWith(':md')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just my thought: wouldn't npm run qwik new /about.md
be more natural? and just thought about .mdx
as well 👼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered that too. I wasn't sure if it would appear as if we'd be creating an /about.md
Markdown file. I'm okay with .md
though. I also considered MDX. Should MDX be in this PR or would it be better as a later PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the :md
suffix to .md
and added support for .mdx
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank u very much! will test it asap 🙏
Co-authored-by: roman zanettin <zanettin@users.noreply.github.com>
From `:md` to `.md`
What is blocking for this to be merged? |
@mhevery just a final test. on it right now 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @brandonpittman 👋
works like a charm! thanks a lot for your contribution and time 🙏 and welcome to the contributors family 🤩
Thank you! Thinking about tackling the Valibot adapter issue next. |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@builder.io/qwik](https://qwik.builder.io/) ([source](https://togithub.com/BuilderIO/qwik)) | [`1.2.7` -> `1.2.10`](https://renovatebot.com/diffs/npm/@builder.io%2fqwik/1.2.7/1.2.10) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@builder.io%2fqwik/1.2.10?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@builder.io%2fqwik/1.2.10?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@builder.io%2fqwik/1.2.7/1.2.10?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@builder.io%2fqwik/1.2.7/1.2.10?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>BuilderIO/qwik (@​builder.io/qwik)</summary> ### [`v1.2.10`](https://togithub.com/BuilderIO/qwik/releases/tag/v1.2.10) [Compare Source](https://togithub.com/BuilderIO/qwik/compare/v1.2.9...v1.2.10) ##### What's Changed - fix: docs/cookbook/index.mdx link to portal page by [@​Craiqser](https://togithub.com/Craiqser) in [QwikDev/qwik#5022 - qwik-labs: fix prettier estree error by [@​gioboa](https://togithub.com/gioboa) in [QwikDev/qwik#5027 - insights: add existsSync check by [@​gioboa](https://togithub.com/gioboa) in [QwikDev/qwik#5026 - chore(insights): correct DB migration script by [@​mhevery](https://togithub.com/mhevery) in [QwikDev/qwik#5024 - fix(core): Report errors to browser global error handler by [@​mhevery](https://togithub.com/mhevery) in [QwikDev/qwik#5029 - style(pnpm-lock.yaml): synchronize lockfile version with version of pnpm in use by [@​jensmeindertsma](https://togithub.com/jensmeindertsma) in [QwikDev/qwik#4905 - fix(starter): missing key attrib on `routerHead` component on `1.2.9` by [@​zanettin](https://togithub.com/zanettin) in [QwikDev/qwik#5025 - 1.2.10 by [@​mhevery](https://togithub.com/mhevery) in [QwikDev/qwik#5035 **Full Changelog**: QwikDev/qwik@v1.2.9...v1.2.10 ### [`v1.2.9`](https://togithub.com/BuilderIO/qwik/releases/tag/v1.2.9) [Compare Source](https://togithub.com/BuilderIO/qwik/compare/v1.2.8...v1.2.9) #### What's Changed - docs: Vercel environment variables by [@​gioboa](https://togithub.com/gioboa) in [QwikDev/qwik#4993 - refactor(create-qwik): add yargs in create-qwik for better DX by [@​MrWaip](https://togithub.com/MrWaip) in [QwikDev/qwik#4932 - feat(adapter): firebase adapter by [@​leifermendez](https://togithub.com/leifermendez) in [QwikDev/qwik#4778 - Pr chore by [@​mhevery](https://togithub.com/mhevery) in [QwikDev/qwik#4994 - fix: Link component `reload` functionality by [@​zanettin](https://togithub.com/zanettin) in [QwikDev/qwik#4917 - docs(qwikcity): html attributes docs page by [@​bab2683](https://togithub.com/bab2683) in [QwikDev/qwik#4961 - feat(qwik-city): add a way to get server-side env vars from `onStaticGenerate` by [@​Kocal](https://togithub.com/Kocal) in [QwikDev/qwik#4912 - fix(eslint): allow eslint to accept FunctionComponent inside lexical scopes by [@​nynevi](https://togithub.com/nynevi) in [QwikDev/qwik#4900 - refactor(cloudflare-pages): allow PlatformCloudflarePages.env to be undefined by [@​bangonkali](https://togithub.com/bangonkali) in [QwikDev/qwik#4941 - docs: dynamic alt image by [@​the-r3aper7](https://togithub.com/the-r3aper7) in [QwikDev/qwik#4999 - docs: add responsive image recipe by [@​fabiobiondi](https://togithub.com/fabiobiondi) in [QwikDev/qwik#5002 - docs: community project update image url by [@​the-r3aper7](https://togithub.com/the-r3aper7) in [QwikDev/qwik#5000 - docs: enhance image documentation by [@​fabiobiondi](https://togithub.com/fabiobiondi) in [QwikDev/qwik#5005 - added qwik-meet in showcase by [@​harshmangalam](https://togithub.com/harshmangalam) in [QwikDev/qwik#5007 - docs: Update index.mdx by [@​the-r3aper7](https://togithub.com/the-r3aper7) in [QwikDev/qwik#5010 - docs: update side bar by [@​the-r3aper7](https://togithub.com/the-r3aper7) in [QwikDev/qwik#5009 - fix(qwik-city): enable matching route and pathname with an optional t… by [@​pleclech](https://togithub.com/pleclech) in [QwikDev/qwik#5004 - docs(image): add details by [@​fabiobiondi](https://togithub.com/fabiobiondi) in [QwikDev/qwik#5014 - insights(feat): qwikInsights Vite Plugin + save symbol details by [@​gioboa](https://togithub.com/gioboa) in [QwikDev/qwik#5011 - chore(insights): Remove deprecated InferModel by [@​mhevery](https://togithub.com/mhevery) in [QwikDev/qwik#5018 - fix: add options to qwik vite plugin by [@​jessezhang91](https://togithub.com/jessezhang91) in [QwikDev/qwik#4983 - 1.2.9 by [@​mhevery](https://togithub.com/mhevery) in [QwikDev/qwik#5021 #### New Contributors - [@​MrWaip](https://togithub.com/MrWaip) made their first contribution in [QwikDev/qwik#4932 - [@​bab2683](https://togithub.com/bab2683) made their first contribution in [QwikDev/qwik#4961 - [@​Kocal](https://togithub.com/Kocal) made their first contribution in [QwikDev/qwik#4912 - [@​nynevi](https://togithub.com/nynevi) made their first contribution in [QwikDev/qwik#4900 - [@​bangonkali](https://togithub.com/bangonkali) made their first contribution in [QwikDev/qwik#4941 - [@​pleclech](https://togithub.com/pleclech) made their first contribution in [QwikDev/qwik#5004 **Full Changelog**: QwikDev/qwik@v1.2.8...v1.2.9 ### [`v1.2.8`](https://togithub.com/BuilderIO/qwik/releases/tag/v1.2.8) [Compare Source](https://togithub.com/BuilderIO/qwik/compare/v1.2.7...v1.2.8) ##### What's Changed - docs: cleanup by [@​mhevery](https://togithub.com/mhevery) in [QwikDev/qwik#4945 - chore: update issue templates by [@​shairez](https://togithub.com/shairez) in [QwikDev/qwik#4962 - docs: correctly generate edit URLs for github by [@​mhevery](https://togithub.com/mhevery) in [QwikDev/qwik#4963 - Typo in FAQ by [@​ThatJSGuy](https://togithub.com/ThatJSGuy) in [QwikDev/qwik#4953 - feat(qwik-city): Show current route in container by [@​mhevery](https://togithub.com/mhevery) in [QwikDev/qwik#4954 - fix(docs): add overview link by [@​fabiobiondi](https://togithub.com/fabiobiondi) in [QwikDev/qwik#4958 - Towards personalized SSG by [@​eric-burel](https://togithub.com/eric-burel) in [QwikDev/qwik#4951 - fix(qwik-auth): remove qaction param from defaultCallbackUrl by [@​ulic75](https://togithub.com/ulic75) in [QwikDev/qwik#4936 - fix(qwik-city): cleanup matchRouteRequest by [@​gioboa](https://togithub.com/gioboa) in [QwikDev/qwik#4967 - fix(auth): Cookies get updated if session returns Updated Cookies by [@​aliyss](https://togithub.com/aliyss) in [QwikDev/qwik#4960 - cli(library): fix release script by [@​fabiobiondi](https://togithub.com/fabiobiondi) in [QwikDev/qwik#4957 - docs: Improved media, fixed height thumbnails by [@​the-r3aper7](https://togithub.com/the-r3aper7) in [QwikDev/qwik#4970 - feat(qwik-city): Adding Script Tag to Head Tag via DocumentHead by [@​Harkunwar](https://togithub.com/Harkunwar) in [QwikDev/qwik#3230 - fix: fix cookie parsing to allow invalid uri encoding by [@​jessezhang91](https://togithub.com/jessezhang91) in [QwikDev/qwik#4915 - fix(qwikcity): respect X-Forwarded-Host header by [@​mhevery](https://togithub.com/mhevery) in [QwikDev/qwik#4982 - chore(docs): fix broken cloudflare build by [@​mhevery](https://togithub.com/mhevery) in [QwikDev/qwik#4984 - feat(insights): manage routes and timeline metrics by [@​gioboa](https://togithub.com/gioboa) in [QwikDev/qwik#4971 - feat: complex form data by [@​ulic75](https://togithub.com/ulic75) in [QwikDev/qwik#4634 - docs(portals): update the portal cookbook example by [@​mhevery](https://togithub.com/mhevery) in [QwikDev/qwik#4968 - chore(insights): fix build by [@​mhevery](https://togithub.com/mhevery) in [QwikDev/qwik#4986 - fix: only show qwik eslint errors in dev mode by [@​jessezhang91](https://togithub.com/jessezhang91) in [QwikDev/qwik#4985 - docs: some progress on the update of the react-cheat-sheet section re… by [@​nsdonato](https://togithub.com/nsdonato) in [QwikDev/qwik#4976 - chore(docs): Remove home-page from SSR to improve TTFB metric by [@​mhevery](https://togithub.com/mhevery) in [QwikDev/qwik#4988 - Pr no ssr by [@​mhevery](https://togithub.com/mhevery) in [QwikDev/qwik#4989 - cli: Add new Markdown route command by [@​brandonpittman](https://togithub.com/brandonpittman) in [QwikDev/qwik#4955 - docs: update Prisma limitations by [@​ruheni](https://togithub.com/ruheni) in [QwikDev/qwik#4241 - 1.2.8 by [@​mhevery](https://togithub.com/mhevery) in [QwikDev/qwik#4992 ##### New Contributors - [@​ThatJSGuy](https://togithub.com/ThatJSGuy) made their first contribution in [QwikDev/qwik#4953 - [@​fabiobiondi](https://togithub.com/fabiobiondi) made their first contribution in [QwikDev/qwik#4958 - [@​eric-burel](https://togithub.com/eric-burel) made their first contribution in [QwikDev/qwik#4951 - [@​aliyss](https://togithub.com/aliyss) made their first contribution in [QwikDev/qwik#4960 - [@​brandonpittman](https://togithub.com/brandonpittman) made their first contribution in [QwikDev/qwik#4955 - [@​ruheni](https://togithub.com/ruheni) made their first contribution in [QwikDev/qwik#4241 **Full Changelog**: QwikDev/qwik@v1.2.7...v1.2.8 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 9pm on sunday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ascorbic/unpic-img). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi42NC44IiwidXBkYXRlZEluVmVyIjoiMzYuNjQuOCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
Overview
This PR adds a way to quickly create Markdown-based routes using a syntax very close to the existing new route command.
Fixes #4931
What is it?
Description
If you have a lot of Markdown routes (say a blog), adding them individually can be cumbersome. This PR just mimics the implementation of
route
andcomponent
. The sole difference being you can affix:md
to a route path to get a Markdown file instead of a TSX file.Use cases and why
Checklist: