Skip to content

Commit 8a56cde

Browse files
author
Ajay kumar
committed
[Blog] [Ajay]: Add readme file. Fix header component.
1 parent 8e1bd85 commit 8a56cde

File tree

3 files changed

+50
-4
lines changed

3 files changed

+50
-4
lines changed

README.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,45 @@
1-
# dev-arena
1+
This project is intended to be a static website representing a technical and software engineering blog.
2+
3+
Project structure
4+
- Layout folder
5+
- It contains files and component to support overall them and layout of the site
6+
- wwwroot
7+
- This folder is responsible for custom theming and acts as a starter point for site startup
8+
- Pages
9+
- This folder can be ignored for now as its deprecated
10+
- Blog
11+
- This folder has main things going on. This folder has files and component that support in writing the blog content.
12+
- Steps on how to write a blog using the component inside the project
13+
- Blog started with defining the header of the blog using `TestArena.Blog.Common.Header` Component
14+
- It takes blog title, image, published on date and authors like below and created the content like in image below ![[Pasted image 20250316123234.png]]
15+
- Images will be stored and read taken from the wwwroot/images/blog/<BLOG_TOPIC>/<BLOG_CHAPTER> folder
16+
- After this, the blog starts normally with the content
17+
- The whole article will be placed under `TestArena.Blog.Common.Section` component like in below image ![[Pasted image 20250316124801.png]]
18+
- Anything that starts with a heading will be counted as a section and `TestArena.Blog.Common.Section` Component will be used for it.
19+
- This component will take the following details
20+
- Heading: It will be the heading of the section
21+
- Level: This will tell the impact/font weight of the heading. Will range from 1 to 6. 1 being largest and 6 being smallest.
22+
- All other details will go inside child component
23+
- An example of usage of Section component is given in image below
24+
- ![[Pasted image 20250316123152.png]]
25+
- The blog will have images as well in between
26+
- Each image will be rendered using `TestArena.Blog.Common.BlogImage` Component. It will take below params
27+
- Image path: Path of the image. Usually it will be `wwwroot/images/blog/<BLOG_TOPIC>/<BLOG_CHAPTER> folder`
28+
- Description: Description of the image
29+
- Number: This will be the number which will represent the image number based on where it is placed in the blog. While deciding this number, header image will not be taken into account.
30+
- Example usage: ![[Pasted image 20250316123639.png]]
31+
- Blog will also contain code snippets at places
32+
- Each code snippet will use the the component `TestArena.Blog.Common.GithubGistSnippet` Component.
33+
- To make this component work, we will have to create a github jist first for the code snippet and use its id inside it.
34+
- It will take the below params:
35+
- Title: This represent the purpose of the code piece
36+
- UserId: UserId of the use who has hosted the gist code
37+
- FileName: Id of the gist file. For automated conversions use the default gist id `d5a6faaf1e103a6f90c0e92bcc69a440`
38+
- Example usage: ![[Pasted image 20250316124241.png]]
39+
- Blog might also contain lists at some times
40+
- Use the `TestArena.Blog.Common.List` component for that. It will use the below params:
41+
- Heading: Heading of the list
42+
- HeadingLevel: This will tell the impact/font weight of the heading. Will range from 1 to 6. 1 being largest and 6 being smallest.
43+
- ChildContents: This would be of type `List<RenderFragment>`. Example list creation looks like in below image![[Pasted image 20250316124546.png]]
44+
- Example list usage looks like in image below ![[Pasted image 20250316124617.png]]
45+
-

TestArena/Blog/Common/Header.razor

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
@code {
44
[Required][Parameter] public string Title { get; set; }
55
[Required][Parameter] public string Image { get; set; }
6+
[Required][Parameter] public DateTime PublishedOn { get; set; }
7+
[Required][Parameter] public string Authors { get; set; }
68
[Parameter] public string Description { get; set; }
79
}
810

@@ -41,12 +43,12 @@
4143
<!-- Author on the left -->
4244
<div class="col-6 d-flex justify-content-start">
4345
<span class="text-secondary fw-bold">Author(s): </span>
44-
<span class="text-secondary fw-bold ms-1">Ajay Kumar</span>
46+
<span class="text-secondary fw-bold ms-1">@Authors</span>
4547
</div>
4648

4749
<!-- Published date on the right -->
4850
<div class="col-6 d-flex justify-content-end">
49-
<span class="text-muted fw-bold">Published On: @DateTime.Now.ToString("dd MMM yyyy")</span>
51+
<span class="text-muted fw-bold">Published On: @PublishedOn.ToString("dd MMM yyyy")</span>
5052
</div>
5153
</div>
5254
</div>

TestArena/Blog/PactNet/Intro/Index.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<BlogContainer>
55
<Header Title="Intro to PACT for .NET Core: API contract testing"
6-
Image="/images/blog/pact/intro/header_landscape.png">
6+
Image="/images/blog/pact/intro/header_landscape.png" PublishedOn="@DateTime.Now" Authors="Ajay Kumar">
77
</Header>
88

99
<Summary></Summary>

0 commit comments

Comments
 (0)