Skip to content

Commit 0b21ebb

Browse files
authored
Design adjustments (open-neuromorphic#228)
* testing wkhtmltopdf * testing wkhtmltopdf * testing wkhtmltopdf * testing wkhtmltopdf * testing wkhtmltopdf * testing wkhtmltopdf * template updates for og-images * chore: try amd64 runner * chore: try amd64 runner * chore: try amd64 runner * chore: try amd64 runner * chore: try amd64 runner
1 parent ce456cf commit 0b21ebb

File tree

6 files changed

+2111
-41
lines changed

6 files changed

+2111
-41
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy Hugo site to Pages
22

33
on:
44
push:
5-
branches: ["main", "refactor-merge"]
5+
branches: ["main", "design-adjustments"]
66

77
permissions:
88
contents: read
@@ -13,23 +13,25 @@ env:
1313
HUGO_ENV: production
1414
HUGO_VERSION: "0.147.7"
1515
GO_VERSION: "1.24.3"
16-
NODE_VERSION: "22.16.0"
16+
NODE_VERSION: "22.x" # Use major version for setup-node
1717

1818
jobs:
1919
build:
20-
runs-on: ubuntu-24.04-arm
20+
# Switched to a standard x86_64 runner for better package compatibility
21+
runs-on: ubuntu-24.04
2122
steps:
2223
- name: Install Hugo
2324
run: |
24-
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-arm64.deb \
25+
# Updated to use amd64 for the new runner
26+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
2527
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
2628
2729
- name: Install Go
2830
run: |
29-
# Corrected to download linux-arm64 for ARM runner
30-
wget -O ${{ runner.temp }}/go.tar.gz https://go.dev/dl/go${GO_VERSION}.linux-arm64.tar.gz \
31+
# Updated to use amd64 for the new runner
32+
wget -O ${{ runner.temp }}/go.tar.gz https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz \
3133
&& sudo tar -C /usr/local -xzf ${{ runner.temp }}/go.tar.gz \
32-
&& sudo ln -s /usr/local/go/bin/go /usr/local/bin/go # Ensure go is in PATH
34+
&& sudo ln -s /usr/local/go/bin/go /usr/local/bin/go
3335
3436
- name: Install wkhtmltopdf
3537
run: |
@@ -46,8 +48,15 @@ jobs:
4648
id: pages
4749
uses: actions/configure-pages@v5
4850

51+
# Best practice: Use setup-node with caching
52+
- name: Setup Node.js
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: ${{ env.NODE_VERSION }}
56+
cache: 'npm'
57+
4958
- name: Install npm dependencies
50-
run: npm install
59+
run: npm ci # Use npm ci for faster, more reliable CI builds
5160

5261
- name: Determine Base URL
5362
id: base_url
@@ -82,7 +91,6 @@ jobs:
8291
- name: Create and Populate .htaccess
8392
run: |
8493
echo "Creating and populating .htaccess in public directory"
85-
# Ensure public directory exists (though npm run build should create it)
8694
mkdir -p public
8795
cat .github/config/htaccess.template > public/.htaccess
8896
echo ".htaccess created and populated."
@@ -94,10 +102,8 @@ jobs:
94102
echo "Current BASE_URL for .htaccess modification: $BASE_URL"
95103
if [[ "$BASE_URL" != "https://open-neuromorphic.org/" ]]; then
96104
echo "Modifying .htaccess to prevent indexing for $BASE_URL"
97-
# The file is created by the workflow user, sudo likely not needed for chmod.
98-
# If issues persist, can use sudo, but check file ownership first.
99-
chmod u+w public/.htaccess # Ensure user has write permission
100-
echo "" >> public/.htaccess # Add a newline for separation
105+
chmod u+w public/.htaccess
106+
echo "" >> public/.htaccess
101107
echo "# Rules to prevent indexing on non-production deployments" >> public/.htaccess
102108
echo "Header set X-Robots-Tag \"noindex, nofollow\"" >> public/.htaccess
103109
echo ".htaccess modified."
@@ -130,7 +136,8 @@ jobs:
130136
environment:
131137
name: github-pages
132138
url: ${{ steps.deployment.outputs.page_url }}
133-
runs-on: ubuntu-24.04-arm
139+
# Switched to a standard x86_64 runner for consistency
140+
runs-on: ubuntu-24.04
134141
needs: build
135142
steps:
136143
- name: Deploy to GitHub Pages

assets/og-template/template.html

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
z-index: 1; /* Behind the content */
2323
opacity: 0.25;
2424
/* Position at bottom-left, partially off-screen */
25-
bottom: -50px;
26-
left: 370px;
25+
bottom: -25px;
26+
left: 330px;
2727
/* Set an explicit size */
2828
width: 900px;
2929
height: auto;
@@ -32,14 +32,12 @@
3232

3333
/* The main content card, also absolutely positioned */
3434
.container {
35-
position: absolute;
3635
z-index: 2; /* On top of the watermark */
37-
width: 1200px;
38-
height: 630px;
39-
padding: 50px 60px;
40-
box-sizing: border-box;
41-
display: flex; /* Flexbox for internal alignment is fine */
42-
flex-direction: column;
36+
position: absolute;
37+
top: 30px;
38+
left: 30px;
39+
width: 950px;
40+
height: 550px;
4341
}
4442

4543
.main-content {
@@ -81,27 +79,26 @@
8179
}
8280

8381
.title {
84-
font-size: 60px;
82+
font-size: 50px;
8583
font-weight: 700;
8684
line-height: 1.15;
8785
color: #1f2937;
8886
margin: 0 0 20px 0;
8987
display: -webkit-box;
90-
-webkit-line-clamp: 2;
88+
-webkit-line-clamp: 3;
9189
-webkit-box-orient: vertical;
9290
overflow: hidden;
9391
text-overflow: ellipsis;
9492
text-align: left;
9593
}
96-
9794
.description {
9895
font-size: 32px;
9996
font-weight: 400;
10097
line-height: 1.45;
10198
color: #4b5563;
10299
margin: 0 0 20px 0;
103100
display: -webkit-box;
104-
-webkit-line-clamp: 4;
101+
-webkit-line-clamp: 3;
105102
-webkit-box-orient: vertical;
106103
overflow: hidden;
107104
text-overflow: ellipsis;
@@ -112,9 +109,7 @@
112109
font-size: 28px;
113110
font-weight: 500;
114111
color: #667eea;
115-
margin-top: auto;
116112
text-align: left;
117-
padding-top: 10px;
118113
}
119114
</style>
120115
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">

layouts/blog/single.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@
1414
<div class="content mb-10">
1515
{{ .Content }}
1616
</div>
17-
18-
{{ partial "components/author-bios.html" . }}
19-
2017
{{ partial "components/share-cta.html" . }}
18+
{{ partial "components/author-bios.html" . }}
2119
</article>
22-
2320
{{ partial "components/sidebar-toc-shared.html" . }}
2421
</div>
2522

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
<div class="share-cta-section mt-12 pt-8 border-t border-border dark:border-darkmode-border">
1+
<div class="share-cta-section mt-12 pt-8">
22
<div class="text-center">
33
<h2 class="text-3xl font-bold mb-4">Enjoy this content? Share it!</h2>
44
<p class="max-w-2xl mx-auto mb-8 text-lg text-gray-600 dark:text-gray-400">
55
Sharing our articles and resources is one of the easiest and most effective ways to support Open Neuromorphic. It helps us reach a wider audience, grow our community, and continue our mission of advancing open-source neuromorphic computing. Your support is greatly appreciated!
66
</p>
77
</div>
8-
9-
{{ partial "components/og-preview.html" . }}
10-
11-
<p class="text-center mt-6 text-sm text-gray-500">
12-
Hover over the image to reveal sharing options.
13-
</p>
14-
</div>
8+
9+
{{ partial "components/og-preview.html" . }}
10+
</div>

0 commit comments

Comments
 (0)