Skip to content

Update description in "Using one Layout for .md, .mdx, and .astro" section.#4244

Merged
yanthomasdev merged 2 commits into
withastro:mainfrom
codersjj:codersjj-patch-1-1
Aug 17, 2023
Merged

Update description in "Using one Layout for .md, .mdx, and .astro" section.#4244
yanthomasdev merged 2 commits into
withastro:mainfrom
codersjj:codersjj-patch-1-1

Conversation

@codersjj
Copy link
Copy Markdown
Contributor

@codersjj codersjj commented Aug 17, 2023

What kind of changes does this PR include?

  • New or updated content

Description

Considering the code first tries to get the title from frontmatter, the order in the paragraph should be:

the layout will display the page title either from a frontmatter YAML title property or from an Astro component passing a title attribute

This more accurately represents the actual execution flow of the code:

  1. First try to get the title from frontmatter
  2. If not exists, then use the title attribute from component

By swapping the order in the paragraph, it can be more consistent with the code behavior and improve readability.

Update description in "Using one Layout for .md, .mdx, and .astro" section.

Considering the code first tries to get the title from `frontmatter`, the order in the paragraph should be:

the layout will display the page title either from a frontmatter YAML title property or from an Astro component passing a title attribute

This more accurately represents the actual execution flow of the code:

1. First try to get the title from `frontmatter`
2. If not exists, then use the title attribute from component

By swapping the order in the paragraph, it can be more consistent with the code behavior and improve readability.
@netlify
Copy link
Copy Markdown

netlify Bot commented Aug 17, 2023

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 1d355e5
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/64de5fdd6e96b400083b0e8c
😎 Deploy Preview https://deploy-preview-4244--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Copy Markdown
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for merge queue! Thanks for this thoughtful edit, @codersjj !

@sarah11918 sarah11918 added the improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) label Aug 17, 2023
Copy link
Copy Markdown
Member

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @codersjj 🙌

@yanthomasdev yanthomasdev merged commit e832eed into withastro:main Aug 17, 2023
yanthomasdev added a commit that referenced this pull request Aug 18, 2023
* i18n(zh-cn): Update `core-concepts/layout.mdx`

* chore: fix the broken link

* feat: update from #4244

---------

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants