Skip to content

Commit ac4842b

Browse files
authored
Merge pull request #15 from Khalilsqu/main
Use JSON file to create README.md
2 parents cc8c456 + 7101785 commit ac4842b

File tree

8 files changed

+2876
-631
lines changed

8 files changed

+2876
-631
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Update README from JSON
2+
3+
on:
4+
push:
5+
paths:
6+
- "awesome_geophysics.json"
7+
workflow_dispatch: # Allows manual triggering
8+
schedule:
9+
- cron: "0 0 * * 0" # Runs at 00:00 UTC every Sunday
10+
11+
jobs:
12+
update-readme:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0 # Needed for the git diff step
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: "3.10"
24+
25+
- name: Install dependencies
26+
run: pip install pyyaml
27+
28+
- name: Generate README
29+
run: |
30+
python generate_readme.py
31+
32+
- name: Check for changes
33+
id: git-check
34+
run: |
35+
git diff --quiet README.md || echo "changes=true" >> $GITHUB_OUTPUT
36+
37+
- name: Commit and push changes
38+
if: steps.git-check.outputs.changes == 'true'
39+
run: |
40+
git config --global user.name 'github-actions[bot]'
41+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
42+
git add README.md
43+
git commit -m "Auto-update README from JSON [skip ci]"
44+
git push
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 473 additions & 358 deletions
Large diffs are not rendered by default.

README_ORIGINAL.md

Lines changed: 633 additions & 0 deletions
Large diffs are not rendered by default.

_layouts/default.html

Lines changed: 11 additions & 273 deletions
Original file line numberDiff line numberDiff line change
@@ -8,262 +8,11 @@
88
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&family=Poppins:wght@500;700&display=swap"
99
rel="stylesheet"
1010
/>
11-
<style>
12-
/* Reset and Base Styles */
13-
* {
14-
box-sizing: border-box;
15-
margin: 0;
16-
padding: 0;
17-
}
18-
19-
body {
20-
font-family: "Roboto", sans-serif;
21-
line-height: 1.7;
22-
background: linear-gradient(135deg, #eceff1 0%, #cfd8dc 100%);
23-
color: #212121;
24-
padding: 30px;
25-
transition: background 0.4s ease, color 0.4s ease;
26-
}
27-
28-
/* Dark Mode */
29-
body.dark-mode {
30-
background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
31-
color: #f5f5f5;
32-
}
33-
34-
/* Hyperlink Base Styles (for all <a> tags) */
35-
a {
36-
color: #ff69b4; /* Barbie pink in light mode */
37-
text-decoration: none;
38-
transition: color 0.3s ease;
39-
}
40-
41-
a:hover {
42-
color: #ffb6c1; /* Lighter pink on hover */
43-
}
44-
45-
body.dark-mode a {
46-
color: #ffb6c1; /* Softer pink in dark mode for contrast */
47-
}
48-
49-
body.dark-mode a:hover {
50-
color: #fff; /* White on hover in dark mode */
51-
}
52-
53-
/* Header Styles */
54-
header {
55-
background: #ff69b4; /* Barbie Pink */
56-
color: #fff;
57-
padding: 15px 30px;
58-
border-radius: 8px;
59-
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
60-
position: sticky;
61-
top: 0;
62-
z-index: 100;
63-
animation: fadeIn 0.5s ease-in;
64-
display: flex; /* Flexbox for alignment */
65-
justify-content: space-between; /* Spread content */
66-
align-items: center; /* Vertically center items */
67-
flex-wrap: wrap; /* Allow wrapping on small screens */
68-
}
69-
70-
header h1 {
71-
font-family: "Poppins", sans-serif;
72-
font-weight: 700;
73-
font-size: 2.2rem;
74-
margin-bottom: 10px;
75-
}
76-
77-
nav {
78-
margin-top: 10px;
79-
}
80-
81-
nav a {
82-
color: #fff; /* White in header */
83-
margin: 0 15px;
84-
font-weight: 400;
85-
}
86-
87-
nav a:hover {
88-
color: #ffe6f2; /* Light pink hover */
89-
}
90-
91-
/* Main Content */
92-
main {
93-
max-width: 1100px;
94-
margin: 40px auto;
95-
padding: 30px;
96-
background: #fff;
97-
border-radius: 8px;
98-
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
99-
transition: background 0.4s ease;
100-
animation: slideUp 0.6s ease-out;
101-
}
102-
103-
body.dark-mode main {
104-
background: #363636; /* Lighter dark gray for contrast */
105-
}
106-
107-
/* Footer Styles */
108-
footer {
109-
text-align: center;
110-
margin-top: 40px;
111-
padding: 20px;
112-
background: #ff69b4; /* Barbie Pink */
113-
color: #fff;
114-
border-radius: 8px;
115-
box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
116-
animation: fadeIn 0.7s ease-in;
117-
}
118-
119-
footer a {
120-
color: #fff; /* White in footer */
121-
font-weight: 400;
122-
}
123-
124-
footer a:hover {
125-
color: #ffe6f2; /* Light pink hover */
126-
text-decoration: underline;
127-
}
128-
129-
/* Images */
130-
img {
131-
max-width: 100%;
132-
height: auto;
133-
display: block;
134-
margin: 20px auto;
135-
border-radius: 6px;
136-
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
137-
}
138-
139-
/* Theme Toggle Button */
140-
.theme-toggle {
141-
background: linear-gradient(45deg, #ff69b4, #ffb6c1); /* Gradient from Barbie pink to light pink */
142-
color: #fff;
143-
border: none;
144-
padding: 10px 20px;
145-
border-radius: 25px;
146-
cursor: pointer;
147-
font-size: 0.95rem;
148-
font-weight: 500;
149-
font-family: "Poppins", sans-serif;
150-
box-shadow: 0 4px 12px rgba(255, 105, 180, 0.4); /* Pink glow */
151-
transition: all 0.3s ease;
152-
overflow: hidden;
153-
position: relative;
154-
}
155-
156-
.theme-toggle:hover {
157-
background: linear-gradient(45deg, #ffb6c1, #ff69b4); /* Reverse gradient on hover */
158-
transform: scale(1.05); /* Slight scale up */
159-
box-shadow: 0 6px 16px rgba(255, 105, 180, 0.6); /* Stronger glow */
160-
}
161-
162-
.theme-toggle:active {
163-
transform: scale(0.95); /* Slight shrink on click */
164-
}
165-
166-
.theme-toggle::before {
167-
content: "";
168-
position: absolute;
169-
top: -50%;
170-
left: -50%;
171-
width: 200%;
172-
height: 200%;
173-
background: rgba(255, 255, 255, 0.2);
174-
transform: rotate(30deg);
175-
transition: all 0.5s ease;
176-
pointer-events: none;
177-
}
178-
179-
.theme-toggle:hover::before {
180-
left: 100%; /* Shine moves across on hover */
181-
}
182-
183-
/* Dark Mode Styles for Theme Toggle */
184-
body.dark-mode .theme-toggle {
185-
background: linear-gradient(45deg, #505050, #ffb6c1); /* Dark gray to pink gradient */
186-
color: #fff;
187-
box-shadow: 0 4px 12px rgba(255, 182, 193, 0.4); /* Softer pink glow */
188-
}
189-
190-
body.dark-mode .theme-toggle:hover {
191-
background: linear-gradient(45deg, #616161, #fff); /* Gray to white gradient */
192-
box-shadow: 0 6px 16px rgba(255, 255, 255, 0.5); /* White glow */
193-
}
194-
195-
/* Animations */
196-
@keyframes fadeIn {
197-
from { opacity: 0; }
198-
to { opacity: 1; }
199-
}
200-
201-
@keyframes slideUp {
202-
from { transform: translateY(30px); opacity: 0; }
203-
to { transform: translateY(0); opacity: 1; }
204-
}
205-
206-
/* Responsive Design */
207-
@media (max-width: 768px) {
208-
body {
209-
padding: 15px;
210-
}
211-
212-
header h1 {
213-
font-size: 1.8rem;
214-
}
215-
216-
nav a {
217-
margin: 0 10px;
218-
font-size: 0.9rem;
219-
}
220-
221-
main {
222-
padding: 20px;
223-
}
224-
225-
.theme-toggle {
226-
padding: 8px 16px;
227-
font-size: 0.85rem;
228-
}
229-
}
230-
231-
@media (max-width: 480px) {
232-
header {
233-
padding: 15px 20px; /* Reduce padding for less vertical bulk */
234-
flex-direction: row; /* Keep it horizontal, but wrap */
235-
flex-wrap: wrap;
236-
gap: 10px; /* Add spacing between items */
237-
align-items: center; /* Center everything vertically */
238-
}
239-
240-
header h1 {
241-
font-size: 1.3rem; /* Slightly smaller for compactness */
242-
flex: 1 1 100%; /* Full width to avoid squeezing */
243-
margin-bottom: 0; /* Remove extra spacing */
244-
}
245-
246-
nav {
247-
display: flex;
248-
flex-wrap: wrap; /* Allow links to wrap if needed */
249-
gap: 8px; /* Tighter spacing between links */
250-
margin-top: 0; /* Remove extra top margin */
251-
width: auto; /* Let it shrink naturally */
252-
}
253-
254-
nav a {
255-
margin: 0; /* Remove individual margins */
256-
font-size: 0.85rem; /* Smaller, tappable size */
257-
}
258-
259-
.theme-toggle {
260-
align-self: center; /* Center it vertically */
261-
margin-top: 0; /* No extra margin */
262-
padding: 6px 12px; /* Smaller button */
263-
font-size: 0.8rem; /* Readable but compact */
264-
}
265-
}
266-
</style>
11+
<!-- Styles-->
12+
<link
13+
rel="stylesheet"
14+
href="{{ '/assets/css/style.css' | relative_url }}"
15+
/>
26716
</head>
26817
<body>
26918
<!-- Header Section -->
@@ -275,7 +24,9 @@ <h1>{{ page.title }}</h1>
27524
<a href="https://aradfarahani.com/about/">About</a>
27625
<a href="mailto:[email protected]">Contact</a>
27726
</nav>
278-
<button class="theme-toggle" onclick="toggleTheme()">Toggle Dark Mode</button>
27+
<button class="theme-toggle" onclick="toggleTheme()">
28+
Toggle Dark Mode
29+
</button>
27930
</header>
28031

28132
<!-- Main Content Section -->
@@ -284,24 +35,11 @@ <h1>{{ page.title }}</h1>
28435
<!-- Footer Section -->
28536
<footer>
28637
<p>© {{ site.time | date: "%Y" }} {{ site.title }}</p>
287-
Maintained by <a href="{{ site.author.github }}">{{ site.author.name }}</a>.
38+
Maintained by
39+
<a href="{{ site.author.github }}">{{ site.author.name }}</a>.
28840
</footer>
28941

29042
<!-- JavaScript for Theme Toggle -->
291-
<script>
292-
function toggleTheme() {
293-
document.body.classList.toggle("dark-mode");
294-
const button = document.querySelector(".theme-toggle");
295-
button.textContent = document.body.classList.contains("dark-mode")
296-
? "Switch to Light Mode"
297-
: "Switch to Dark Mode";
298-
}
299-
300-
// Detect user's preferred color scheme on load
301-
if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
302-
document.body.classList.add("dark-mode");
303-
document.querySelector(".theme-toggle").textContent = "Switch to Light Mode";
304-
}
305-
</script>
43+
<script src="{{ '/assets/js/theme-toggle.js' | relative_url }}"></script>
30644
</body>
30745
</html>

0 commit comments

Comments
 (0)