Published on: 2022-07-01
Welcome to my new blog about learning Astro! Here, I will share my learning journey as I build a new website.
What I’ve accomplished
Installing Astro: First, I created a new Astro project and set up my online accounts.
Making Pages: I then learned how to make pages by creating new
.astrofiles and placing them in thesrc/pages/folder.Making Blog Posts: This is my first blog post! I now have Astro pages and Markdown posts!
What’s next
I will finish the Astro tutorial, and then keep adding more posts. Watch this space for more to come.
src/
├── content/
│ ├── config.ts # Zod schema definitions for frontmatter
│ └── publications/ # The single source of truth for content
│ ├── my-single-post.md # [Type: Single Publication]
│ │
│ └── learn-astro/ # [Type: Collection] ID = "learn-astro"
│ ├── index.mdx # [Role: Root]
│ ├── setup.md # [Role: Chapter] order: 1
│ └── routing.md # [Role: Chapter] order: 2
│
├── utils/
│ └── contentHelpers.ts # Core logic for grouping and context
│
└── pages/
└── publications/
└── [...slug].astro # Dynamic route handling ALL content typesuser_list = [56, 73, 12, 6876, 1257, 120, 1223]
user_list.append(609345)
print(f"The list after adding elements is: {user_list}")
user_list.remove(73)
print(f"The list after removing an element is: {user_list}")
a = 1
if a >= 2 or a == 1:
print('I am just testing this code')In my project I have a shapes package which has shapes I designed for my graphics program, e.g., Rectangle and Circle. I also have one or two more packages that have the same names as java.awt classes.
Now, since I do not want to rename every class in my codebase, to show my source files which class I mean when I, say, declare a new Rectangle, I need to either:
1- import the rectangle class explicitly, i.e., import shapes.Rectangle
or
2- import only the java.awt classes I need and not import java.awt.* which automatically includes the awt.Rectangle
Now the problem is that both ways result in a lot of importing. I currently have an average of 15-25 imports in each source file, which is seriously making my code mixed-up and confusing.
Is too many imports in your code a bad thing? Is there a way around this?