Code Monkey home page Code Monkey logo

docs's Introduction

Astro Docs Astro logo

To all who come to this happy place: welcome.

This is the repo for docs.astro.build. This repo contains all the source code we use to build our docs site.

Open in Gitpod Open with CodeSandbox Open in Codeflow

We are Astro

Astro is an all-in-one web framework for building fast, content-focused websites. We want everyone to be successful building sites, and that means helping everyone understand how Astro works.

You are Awesome

You can also help make the docs awesome. Your feedback is welcome. Your writing, editing, translating, designing, and developing skills are welcome. You being a part of our community is welcome.

Chat with Us

You can learn more about Astro, get support, and meet other devs in our Discord community.

Raise an Issue

Is something missing? Is something confusing? Is something wrong?

Creating a new Issue puts a problem on our radar!

See if your issue has already been reported, and if not, create a new one.

Share an Idea

Could something be better? Want to share an idea with us?

Discussions are threads where you can offer feedback on things that might not exactly be problems to be fixed but are ideas to be explored.

Join the Docs Discussions where we brainstorm, ask questions, share hopes and dreams...

Make a Fix or Contribution

Did you find a typo, a broken link, or another item with an obvious quick fix?

If you can see what the problem is, and you know how to fix it, then you can make a PR (pull request) with the change and contribute to the docs repo yourself.

Want to make a larger contribution? Please see CONTRIBUTING.md first!

Translate a Page

Speak another language natively?

Join our i18n gang on Discord or jump into the PRs to help with reviewing existing draft translations!

Check out the dedicated i18n guide for more details.

Next Steps

docs's People

Contributors

100gle avatar aitormt avatar alexnguyennz avatar alynva avatar astrobot-houston avatar bholmesdev avatar chrissdroid avatar delucis avatar dreyfus92 avatar eliancodes avatar fredkschott avatar hippotastic avatar huyikai avatar hyro32 avatar jasikpark avatar jonathantneal avatar jsparkdev avatar jutanium avatar kecrily avatar kevinzunigacuellar avatar kyosuke avatar liruifengv avatar mcflypartages avatar mearashadowfax avatar morinokami avatar sarah11918 avatar theotterlord avatar thomasbnt avatar waxer59 avatar yanthomasdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs's Issues

What is Astro?

There's a simple secret to building a faster website — just ship less.
Unfortunately, modern web development has been trending in the opposite direction—towards more. More JavaScript, more features, more moving parts, and ultimately more complexity needed to keep it all running smoothly.
Today I'm excited to publicly share Astro: a new kind of static site builder that delivers lightning-fast performance with a modern developer experience. To design Astro, we borrowed the best parts of our favorite tools and then added a few innovations of our own, including:

  • Bring Your Own Framework (BYOF): Build your site using React, Svelte, Vue, Preact, web components, or just plain ol' HTML + JavaScript.
  • 100% Static HTML, No JS: Astro renders your entire page to static HTML, removing all JavaScript from your final build by default.
  • On-Demand Components: Need some JS? Astro can automatically hydrate interactive components when they become visible on the page. If the user never sees it, they never load it.
  • Fully-Featured: Astro supports TypeScript, Scoped CSS, CSS Modules, Sass, Tailwind, Markdown, MDX, and any of your favorite npm packages.
  • SEO Enabled: Automatic sitemaps, RSS feeds, pagination and collections take the pain out of SEO and syndication.

This post marks the first public beta release of Astro. Missing features and bugs are still to be expected at this early stage. There are still some months to go before an official 1.0 release, but there are already several fast sites built with Astro in production today. We would love your early feedback as we move towards a v1.0 release later this year.

Merge Installation page with Quick Start page?

There is a lot of overlapping content from both pages, I believe we could merge them both in a way that we can have the "quick start" followed by the rest of the "installation" content.

I believe this should be done after these two PR's are completed so that no content is missed or we have double work.

Color issue in light mode code blocks

image

For some reason there's a dark color used now - I expect this is the default color for <code> blocks regardless of whether it's embedded in a <pre>

Sidebar Language not matching for pt-BR

pt-BR is the only non-two-character language code we've used in translations (leading to /pt-br/), and it's not being recognized in utils.ts to create a non-English sidebar.

I've tried adding it to SIDEBAR in config.ts in a couple of different ways, tried playing with the regex in config.ts, but I can't get it working correctly myself. Neither pt-BR (nor pt-br) are being successfully matched in getLanguageFromURL so the Portuguese site is showing the default English sidebar.

I have it confirmed from our i18n community that the following translations are correct for Brazilian Portuguese, so this can be added into SIDEBAR in config.ts in whatever way is going to make this file, and the function happy together.

	pt-BR: [
		{ text: 'Instalação', header: true },
		{ text: 'Introdução', link: 'pt-br/getting-started' },
	],

Pages for Group `Integrations`

Task -> Assignee

  • Integrations ->
  • Deploy Astro ->
  • Data Sources / CMS ->
  • State Management ->
  • Styles & CSS Libraries ->
  • Developer Tools ->

📘 DOC: Disable bundling hashes

Under Styling & CSS Bundling it mentions

All styles are hashed according to their contents (the hashes only change if the contents do!)

This is (I presume) fine with most services. With Netlify as per [Support Guide] Making the most of Netlify’s CDN cache hashes break caching.

Perhaps your build framework is trying to be helpful. Gatsby for instance uses asset fingerprinted filenames intentionally, which breaks Netlify’s usual caching.

In order to eliminate the hashes I did find it is possible to disable this via a setting in vite.config.js as originally read here with official documentation here

export default {
  build: {
    rollupOptions: {
      output: {
        // Disable hashes for CSS files.
        assetFileNames: `assets/[name].[ext]`
        // These may also work, though haven't tested
        // entryFileNames: `assets/[name].js`,
        // chunkFileNames: `assets/[name].js`,
      }
    }
  }
}

I can confirm the assetFileNames setting is honoured in Astro (unsure about the entryFileNames and chunkFileNames as I haven't a project to test these on currently) and think it worth adding this to official documentation for those who (like me) may wish to remove hashes.

📘 DOC: Add support for clearing your theme selection in the docs

Currently, if you select light theme or dark theme in the theme toggle, it is then fixed, and there is no way to return to prefers-color-scheme without going into Inspect Element and clearing the local storage key.

I'd like to propose using https://cssdb.org/'s Theme Switcher that adds an indeterminate state to the theme toggle.

light mode:
image

dark mode:
image

"let the browser choose" mode:
image

Show off Astro sites!

It would be pretty cool if we could some how make a Netflix style slider that shows off all of the example sites!

- slider, not a carousel: https://lsnrae.medium.com/if-you-must-use-a-carousel-make-it-accessible-977afd0173f4

image

cc the non-existent @snowpackjs/maintainers/design role xD

It sounds like a carousel is less popular, but there's another design to copy from in: https://nextjs.org/showcase

image

Possible showcase sites include:

📘 DOC: Lint for broken links in all languages

Currently we have a yarn lint:linkcheck:local command that can check for broken links, but we don't have any way to switch what language you're using without JS, so it only checks the English pages.

I want to write a script using the programmatic version of blc to check all translations of the docs for broken links!

DOC: Add docs for building non-HTML pages

Add docs for building non-HTML pages PR #2586

The feature is currently hidden behind the --experimental-static-build flag, but has some very powerful use cases for building generic files (ex: JSON or XML), and a couple useful caveats like the Astro global isn't available

ASCII Replacing { Character

I noticed across the site { is being replaced by &#123;. But not in every instance.

E.g. 1: Collections page: const &#123; collection } = Astro.props;

Add side-by-side component for showing off code

It'd be great to make a component that styles a code example and the rendered component side-by-side!

Could honestly just look like hooking up Prism and a little css grid box that renders the source on the right side 🤔 though i'm not sure how you say "create a component out of this source code that was passed to me as a prop", though maybe we do like the astro tests and pull from a code examples folder 🤔

<CodeExample src="src/examples/fetchingdata.tsx" />

This reads to me as linked to the issue in the astro repo about wanting a compiler api though!

No Menubar on mobile

Currently there is a button to open the sidebar on mobile, but it is not linked to showing the sidebar, and the sidebar is not visible if I manually disable the display: none; via devtools.

Add DocSidebar info to footer when on mobile

Currently the "Editor On Github" and table of contents are thrown away and hidden on mobile, maybe we can add them to the layout somehow on mobile?

  • Maybe add the TOC to the top before the page content
  • Maybe add Edit on Github to the footer, in addition to social links

Cannot search for "define:vars"

When searching for define:vars using the algolia search (top right) it doesn't find this page:

https://docs.astro.build/en/guides/styling/#variables-in-scripts--styles

Or any relevant page to "define:vars". Not sure if this can be fixed?

Also note, the documentation here might be improved to explain the double {{ syntax...
Something like {myval} expands to {myval: myval}, and that is within an outer { which is a JSX expression.

The object literal property value shorthand was introduced in ES6 to make the object initialization shorter. It allows us to define an object whose keys have the same names as the variables passed-in as properties, by simply passing the variables like {myval} which is interpreted as {myval: myval}.

📘 DOC: Improve docs around deployment script to gh-pages

Hello all! I think Astro is pretty great at what it does and I even contribute a small amount each month to help support your work.

I came across the docs for deploying to github pages and found the deploy script would overwrite my main branch with the output of the dist folder. I'd like to be able to maintain my main branch as it is but to instead deploy to a separate branch named gh-pages. I ran into issues with the deploy script for this scenario and instead went with using an npm package to help: gh-pages. All I had to do was run yarn build && touch ./dist/.nojekyll && gh-pages -d dist -t true and it worked like a charm. In my settings for the repo, I just point to gh-pages as the branch I want deployed.

I thought this would be a good idea to add to the docs but maybe it's too specialized to npm land, hence the bash script you have as the first/primary way to deploy. Anyhow, I'd thought I'd at least bring up the idea and see what you all thought in case there was agreement there. Thanks for all the work on this project, I am excited to see where things go.

Pages for Group `Basic Concepts`

Task -> Assignee

  • Project Structure ->
  • Astro Pages ->
  • Astro Components ->
  • Component Hydration -> @itskitto
  • Layouts -> @ewatch
  • Styling -> @itskitto
  • Content (Markdown) -> @jgil-r
  • Data Fetching ->
  • Pagination ->
  • Collections ->
  • Build & Deploy ->
  • URL Sanitization -> Tackled in "Security FAQs" of Markdown document

Installation

Starting a new project in Astro is easy:

# create your project
mkdir new-project-directory
cd new-project-directory
npm init astro
# install your dependencies
npm install
# start the dev server and open your browser
npm start

Further reference: https://github.com/snowpackjs/astro#-guides

License file

Hello, is this repo intended to have an MIT license?

Need a custom 404 page

Especially now that we removed the "Quick Start" page and replaced all instructions with the Installation page, we should really have a custom 404 page.

This could be a fun thing for someone to build and a great project for a new contributor!

Explanation for frontmatter

It seems that a lot of users that never worked with frontmatter or related technologies are trying to manipulate the DOM inside frontmatter, so we should have it detailed that DOM manipulation is not possible within frontmatter because it runs on the server, at build time, and not on the client/browser.

Project Structure

Even though nearly-everything is configurable, we recommend starting out by creating an src/ folder in your project with the following structure:

├── src/
│ ├── components/
│ └── pages/
│ └── index.astro
├── public/
└── package.json
src/components/: where your reusable components go. You can place these anywhere, but we recommend a single folder to keep them organized.
src/pages/
: this is a special folder where your routing lives.

Would like to understand what astro do under the cover

Hi, I was looking around the current documentation to understand in brief what astro really does when you build your site's using astro.

Would also like to know whether astro is a SPA (Single page application) or a pure SSG or both somehow.

As per Internet reading it looks like a SSG but as per my first project its acting as a SPA .. local routes and stuff like that. So pretty confused whether I am it right or am I missing something in my understanding.

link lang?

Hi! Tried several increasingly cheekier ways of linking to my SCSS files, to no avail. Several times, in fact, because I keep forgetting this not being possible from my experiments.

Is this something that is possible? The docs consistently <link /> to CSS. Could a notice be added noting that this is not an option?

Examples:

<!-- none of these work for me -->

<link rel="stylesheet" src={Astro.resolve("@styles/heet.scss")} lang="scss" /> <!-- using my tsconfig alias -->
<link rel="stylesheet" src={Astro.resolve("../../../styles/heet.scss")} lang="scss"  /> <!-- using astro.resolve -->
<link rel="stylesheet" src={path.join(PUBLIC_SRC_DIR, 'styles/heet.scss')} lang="scss" /> <!-- using an actual absolute path -->

In all 3 cases, the actual file is resolved, and in the 2nd case I can get Astro to point to the correct, if uncompiled, SCSS file. But I was expecting it would render it for me? If this isn't supposed to happen, it'd be pretty cool if the docs would mention it.

📘 DOC: Example/Template color contrast ratios

I noticed by default in the examples/templates, the color contrast ratios come up in the accessibility portion of the Lighthouse Audit.

Primarily seems to be these 2 colors:

--theme-accent(--color-orange): #ff5d01 - against white provides ratio of 3.08

and

--theme-text-lighter(--color-gray-400): #9ca3af - against white provides ratio of 2.53

For smaller font sizes, the minimum ratio should be 4.5 to meet AA standards.
For larger font sizes, the minimum ratio should be 3.0 to meet AA standards.

It would great to provide no accessibility issues out of the box on our examples/templates.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.