-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
DOCS: WIP - Examples and Template page example for review #871
DOCS: WIP - Examples and Template page example for review #871
Conversation
This is a WIP of the Examples page, to view the page would be at the root ('localhost/template')
|
This pull request is being automatically deployed with Vercel (learn more). astro-docs – ./docs🔍 Inspect: https://vercel.com/pikapkg/astro-docs/9KfVSmGfXmRPSqfP1MumNoM1Y67o astro-www – ./www🔍 Inspect: https://vercel.com/pikapkg/astro-www/7iXgMLw6Bb1TRtVuf9fkJoz3Jhut |
here's the link to that page in the preview: https://astro-docs-git-fork-afuzzybear-docs-experimental-546c26-pikapkg.vercel.app/template You should be able to add the page to the sidebar config file so that it shows up in the sidebar, that would be a part of this pr |
Ill add that to the sitemap and have that added to this pr @jasikpark, thanks for pulling up that preview page =) |
Changes Made:
Updated the Sitemap and the Sidebar to incorporate the Examples & Templates page, I have left the existing Examples.md page link also on the sidebar, this is too allow for comparison between the two pages, if accepted we could easily remove the latter reference,
Renamed the files with some better filenames, and updated the relevant file paths where needed. |
@aFuzzyBear when this is ready can you remove the "WIP" in the title? For in the future, GitHub lets you create Draft PRs now, that way reviewers know that it's a work in progress. |
@aFuzzyBear is attempting to deploy a commit to the Pika Team on Vercel. A member of the Team first needs to authorize it. |
ignore the last one, pushd to the wrong place 😓 |
307ce6f
to
d7b0080
Compare
Would love to see some examples around using web components too? |
hey bud @shreeshbhat, if there is an example that we could put together and have placed into the example repo ill be able to make a link to it on the examples page, just need to get the doc's sidebar styling to work then this should be good to go, |
I've managed to get the examples page working perfectly with the rest of the site, I did notice a few things that required me to bend the There is a part of the Main.astro that pulls in the current page, this works great for To get the sidebar working I had to rearrange some variables in the All I need to do now is update the placeholder text in the =) |
Been struggling with the online code sandboxes today, been wanting to setup online demo's for each of the templates, any advice/assistance with this would be great. I was thinking of just dockerising each template so that there is a live version of it, when there is better support for Astro with the online code-waste of times then we can add in a link to those as well, this wouldn't take much todo, just add in a link in the So should I go ahead and spend tomorrow making up dockerfiles, if so, what about deployment....? if not, what should be the best course for me to pursue with this? KR |
Had an update from the team over at 'Stackblitz' and they said that they are currently working on the 'problem' of allowing astro to run natively on their online code-editors. The current problem as they state is "The underlying issue is our lack of ESM modules (and dynamic import()) at the moment. We're working on it though. Thanks for the report!" if this does get solved then it should be as simple to run the links to the online code sandbox. |
983e6e0
to
fc739c2
Compare
Hey @aFuzzyBear, thanks for submitting this! I think this is a great start and I think this would be a great addition to the site. Here are some thoughts on what's still needed to get this merged:
If you can tackle these, I'd be happy to help review the rest of the PR and get it merged in. Thanks for taking the initiative on this! |
Hi fred, thanks for taking a look over it man, I will start working on these the day. =) Looking over the 11ty example site, this is very doable in terms of design, I really like the use of site images and lighthouse scores. I'm just thinking about this extra annotation, would this information such as site image, lighthouse scores, links to external demo's would this be placed into the I wholly accept your remarks concerning the maintenance of the Thanks for this Fred, really looking forward to tackling this =) |
An idea that I hope might work: // templateData.ts
export function getExamples() {
const allExampleManifests = // glob.sync('../../examples/*/package.json);
return allExampleManifests.map((fileContents) => JSON.parse(allExampleManifests));
// TODO: make sure any metadata that you want to show here, lives on the example package.json
// even better, reuse existing data like pkg.description
}
export const examples = getExamples();
export const templates = [
// user-submitted templates added here!
]; |
I think some of those features of the 11ty site should definitely be avoided for now. For example, they generate live screenshots of every site automatically via pupeteer. I think we could just use Also, lighthouse scores are a great idea but can be added later on after this has been merged. |
Topical for the screenshots: |
@jasikpark dude I can hug you, lol I know the fred said that he wasnt keen on the idea but it has been buggin me for most of the day. Also having a small victory dance atm; Thats me able to get the data from the Now all I need to do is go through each of the repo's and update the manifest files....then i'll tackle the re-design, |
@aFuzzyBear awesome, nicely done! Still blown away that you can do that with Astro :) |
also don't get me wrong, I'd love to get an auto-screenshotting-with-puppeteer setup going eventually! But its a pretty big task and this PR already has the potential to get too big to review if we're not careful. No reason it can't be done in a separate followup immediately after Update: I take that back... it looks like Zach isn't saying no to using his hosted version of https://v1.screenshot.11ty.dev/:url/ directly... if we don't have to build the service ourselves I'm +1! We were also lucky enough to get a OSS Netlify plan for the project, so we could literally hit that "Deploy with Netlify" button from the blog post and host a copy ourselves.
|
inadvertently astro has server-side functions nailed to a T 😅 |
With that, it'd be really nice to have hosted versions of all of the example sites for people to browse and for the screenshot endpoint to be pointed at! That'd also make it easier for people to spot problems in the example sites as well! |
Superseded by #1100 |
This is a WIP of the Examples page, to view the page would be at the url ('localhost/template') - there is not sidebar access to this page at the present moment as it is a WIP and awaiting adjudication on its composure
Changes
-Examples.astro
This is a component file that parses the template data from (./src/templates.ts) and outputs them onto small 'cards'
Each card has the following structure:
Title
Blurb
Command
Links to Github and if there is an online demo then the scope to add those links as well.
-template.astro
This is serving as the page template for the Templates list
-templates.ts (in hindsight this should be called templateList.ts)
This is the datafile containing links and description to the Templates located in the astro/examples folder, my reasoning for doing it this way was after I had scrapped the data via the api i was wanting to annotate it a bit with a blurb and allow for the potenial of applying demonstration links to the templates, once these become available. I realised that this was out-with my current skill level and thought that this approach should suffice in delivering the same objectives for this particular page.
I would happily defer this to a better practice,
Please let me know what you think of this page,
Many Thanks =)