Skip to content

Commit 00f1233

Browse files
author
Sidharth123-cpu
committed
more styling
1 parent 3b25532 commit 00f1233

File tree

4 files changed

+81
-79
lines changed

4 files changed

+81
-79
lines changed

docs/_layouts/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>{{ page.title | default: site.title }}</title>
7-
<link rel="stylesheet" href="{{ "/assets/css/style.css" | relative_url }}">
7+
<link rel="stylesheet" href="{{ "/assets/style.css" | relative_url }}">
88
<link rel="icon" type="image/png" href="{{ "/assets/css/pytorch-logo.png" | relative_url }}">
99
</head>
1010
<body>

docs/assets/css/style.scss

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -2,71 +2,3 @@
22
---
33

44
@import "{{ site.theme }}";
5-
6-
/* Custom styles for header and navigation */
7-
body {
8-
padding-top: 60px; /* Space for fixed header */
9-
}
10-
11-
header {
12-
background-color: #333;
13-
color: white;
14-
padding: 10px 20px;
15-
position: fixed;
16-
width: 100%;
17-
top: 0;
18-
left: 0;
19-
z-index: 1000;
20-
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
21-
}
22-
23-
nav {
24-
display: flex;
25-
justify-content: flex-start;
26-
gap: 20px;
27-
}
28-
29-
nav a {
30-
color: white;
31-
text-decoration: none;
32-
padding: 5px 10px;
33-
border-radius: 4px;
34-
transition: background-color 0.3s ease;
35-
}
36-
37-
nav a:hover {
38-
background-color: #575757;
39-
}
40-
41-
.metric-container {
42-
display: flex;
43-
flex-wrap: wrap;
44-
gap: 20px;
45-
margin-top: 30px;
46-
justify-content: center;
47-
}
48-
49-
.metric-box {
50-
background-color: #f9f9f9;
51-
border: 1px solid #ddd;
52-
border-radius: 8px;
53-
padding: 20px;
54-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
55-
text-align: center;
56-
flex: 1;
57-
min-width: 250px;
58-
max-width: 300px;
59-
}
60-
61-
.metric-box h3 {
62-
color: #333;
63-
margin-top: 0;
64-
font-size: 1.2em;
65-
}
66-
67-
.metric-box p {
68-
font-size: 2em;
69-
font-weight: bold;
70-
color: #007bff;
71-
margin-bottom: 0;
72-
}

docs/assets/style.css

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
2+
/* Custom styles for header and navigation */
3+
body {
4+
padding-top: 60px; /* Space for fixed header */
5+
}
6+
7+
header {
8+
background-color: #333;
9+
color: white;
10+
padding: 10px 20px;
11+
position: fixed;
12+
width: 100%;
13+
top: 0;
14+
left: 0;
15+
z-index: 1000;
16+
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
17+
}
18+
19+
nav {
20+
display: flex;
21+
justify-content: flex-start;
22+
gap: 20px;
23+
}
24+
25+
nav a {
26+
color: white;
27+
text-decoration: none;
28+
padding: 5px 10px;
29+
border-radius: 4px;
30+
transition: background-color 0.3s ease;
31+
}
32+
33+
nav a:hover {
34+
background-color: #575757;
35+
}
36+
37+
.metric-container {
38+
display: flex;
39+
flex-wrap: wrap;
40+
gap: 20px;
41+
margin-top: 30px;
42+
justify-content: center;
43+
}
44+
45+
.metric-box {
46+
background-color: #f9f9f9;
47+
border: 1px solid #ddd;
48+
border-radius: 8px;
49+
padding: 20px;
50+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
51+
text-align: center;
52+
flex: 1;
53+
min-width: 250px;
54+
max-width: 300px;
55+
}
56+
57+
.metric-box h3 {
58+
color: #333;
59+
margin-top: 0;
60+
font-size: 1.2em;
61+
}
62+
63+
.metric-box p {
64+
font-size: 2em;
65+
font-weight: bold;
66+
color: #007bff;
67+
margin-bottom: 0;
68+
}

generate-site.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,17 @@ def generate_site():
5050
layouts_dir = os.path.join(output_dir, '_layouts')
5151
Path(layouts_dir).mkdir(exist_ok=True)
5252

53-
# Create assets/css directory and style.scss file
54-
css_dir = os.path.join(output_dir, 'assets', 'css')
55-
Path(css_dir).mkdir(parents=True, exist_ok=True)
53+
# Create assets directory for style.css and other assets
54+
assets_dir = os.path.join(output_dir, 'assets')
55+
Path(assets_dir).mkdir(parents=True, exist_ok=True)
5656

57-
style_scss = """---
58-
---
57+
# Re-create assets/css directory for pytorch-logo.png
58+
css_assets_dir = os.path.join(output_dir, 'assets', 'css')
59+
Path(css_assets_dir).mkdir(parents=True, exist_ok=True)
5960

60-
@import "{{ site.theme }}";
61+
# The pytorch-logo.png will remain in assets/css/ as per user request
6162

63+
style_css_content = """
6264
/* Custom styles for header and navigation */
6365
body {
6466
padding-top: 60px; /* Space for fixed header */
@@ -128,9 +130,9 @@ def generate_site():
128130
}
129131
"""
130132

131-
with open(os.path.join(css_dir, 'style.scss'), 'w') as f:
132-
f.write(style_scss)
133-
print('Generated assets/css/style.scss')
133+
with open(os.path.join(assets_dir, 'style.css'), 'w') as f:
134+
f.write(style_css_content)
135+
print('Generated assets/style.css')
134136

135137
# Create minimal default.html layout
136138
default_layout_content = '''\
@@ -140,7 +142,7 @@ def generate_site():
140142
<meta charset="UTF-8">
141143
<meta name="viewport" content="width=device-width, initial-scale=1.0">
142144
<title>{{ page.title | default: site.title }}</title>
143-
<link rel="stylesheet" href="{{ \"/assets/css/style.css\" | relative_url }}">
145+
<link rel="stylesheet" href="{{ \"/assets/style.css\" | relative_url }}">
144146
<link rel="icon" type="image/png" href="{{ \"/assets/css/pytorch-logo.png\" | relative_url }}">
145147
</head>
146148
<body>

0 commit comments

Comments
 (0)