Skip to content

Commit 652b5fd

Browse files
committed
fix(theme): port newspaper UI and verify deploys
Port the actual drunk.support handoff into the WordPress theme and add deployment checks that prove production is serving the expected commit and UI markers.
1 parent 45fc877 commit 652b5fd

9 files changed

Lines changed: 682 additions & 185 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,25 @@ on:
88
jobs:
99
deploy:
1010
runs-on: ubuntu-latest
11+
env:
12+
SITE_URL: https://drunk.support
1113
steps:
1214
- uses: actions/checkout@v4
1315

16+
- name: Validate newspaper UI markers
17+
run: php tests/theme-design-static.php
18+
19+
- name: Write deploy marker
20+
run: |
21+
printf '%s\n' "$GITHUB_SHA" > DEPLOY_SHA
22+
{
23+
printf 'repo=%s\n' "$GITHUB_REPOSITORY"
24+
printf 'sha=%s\n' "$GITHUB_SHA"
25+
printf 'run_id=%s\n' "$GITHUB_RUN_ID"
26+
printf 'run_attempt=%s\n' "$GITHUB_RUN_ATTEMPT"
27+
printf 'deployed_at=%s\n' "$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
28+
} > DEPLOY_INFO
29+
1430
- name: Deploy via rsync
1531
uses: burnett01/rsync-deployments@6.0.0
1632
with:
@@ -20,3 +36,36 @@ jobs:
2036
remote_host: ${{ secrets.CLOUDWAYS_HOST }}
2137
remote_user: ${{ secrets.CLOUDWAYS_USER }}
2238
remote_key: ${{ secrets.CLOUDWAYS_SSH_KEY }}
39+
40+
- name: Verify deployed commit
41+
run: |
42+
set -euo pipefail
43+
44+
marker_url="${SITE_URL%/}/wp-content/themes/minimalcode/DEPLOY_SHA?check=${GITHUB_SHA}"
45+
46+
for attempt in 1 2 3 4 5; do
47+
deployed_sha="$(curl -fsSL -H 'Cache-Control: no-cache' "$marker_url" || true)"
48+
if [ "$deployed_sha" = "$GITHUB_SHA" ]; then
49+
echo "Production is serving commit $GITHUB_SHA"
50+
exit 0
51+
fi
52+
53+
echo "Attempt ${attempt}: expected ${GITHUB_SHA}, got '${deployed_sha:-<empty>}'"
54+
sleep 3
55+
done
56+
57+
echo "Production did not serve the deployed commit marker." >&2
58+
exit 1
59+
60+
- name: Smoke test live theme
61+
run: |
62+
set -euo pipefail
63+
64+
homepage="$(curl -fsSL -H 'Cache-Control: no-cache' "${SITE_URL%/}/?deploy-check=${GITHUB_SHA}")"
65+
custom_css="$(curl -fsSL -H 'Cache-Control: no-cache' "${SITE_URL%/}/wp-content/themes/minimalcode/assets/css/custom.css?deploy-check=${GITHUB_SHA}")"
66+
67+
grep -q 'wp-content/themes/minimalcode/assets/css/custom.css' <<< "$homepage"
68+
grep -q 'class="ticker"' <<< "$homepage"
69+
grep -q 'class="masthead wrap"' <<< "$homepage"
70+
grep -q -- '--paper' <<< "$custom_css"
71+
grep -q '.entry-hash' <<< "$custom_css"

assets/css/custom.css

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

footer.php

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,45 @@
11
</main>
22

3-
<footer class="site-footer">
4-
<div class="container">
5-
<div class="footer-content">
6-
<div class="footer-info">
7-
<p class="copyright">
8-
<?php echo esc_html(get_bloginfo('name')); ?> © <?php echo date('Y'); ?>
9-
</p>
10-
<?php
11-
$social_links = minimalcode_social_links();
12-
if (array_filter($social_links)) :
13-
?>
14-
<div class="social-links">
15-
<?php if ($social_links['email']) : ?>
16-
<a href="mailto:<?php echo esc_attr($social_links['email']); ?>" aria-label="Email" title="Email"><?php minimalcode_the_icon('email', 20); ?></a>
17-
<?php endif; ?>
18-
19-
<?php if ($social_links['twitter']) : ?>
20-
<a href="<?php echo esc_url($social_links['twitter']); ?>" target="_blank" rel="noopener noreferrer" aria-label="X (Twitter)" title="X (Twitter)"><?php minimalcode_the_icon('twitter', 20); ?></a>
21-
<?php endif; ?>
22-
23-
<?php if ($social_links['github']) : ?>
24-
<a href="<?php echo esc_url($social_links['github']); ?>" target="_blank" rel="noopener noreferrer" aria-label="GitHub" title="GitHub"><?php minimalcode_the_icon('github', 20); ?></a>
25-
<?php endif; ?>
26-
27-
<?php if ($social_links['linkedin']) : ?>
28-
<a href="<?php echo esc_url($social_links['linkedin']); ?>" target="_blank" rel="noopener noreferrer" aria-label="LinkedIn" title="LinkedIn"><?php minimalcode_the_icon('linkedin', 20); ?></a>
29-
<?php endif; ?>
30-
</div>
31-
<?php endif; ?>
3+
<footer class="footer">
4+
<div class="wrap">
5+
<div class="footer-grid">
6+
<div>
7+
<h4><?php esc_html_e( 'Notebook', 'minimalcode' ); ?></h4>
8+
<ul>
9+
<li><a href="<?php echo esc_url( home_url( '/' ) ); ?>">log</a></li>
10+
<li><a href="<?php echo esc_url( get_post_type_archive_link( 'project' ) ); ?>">projects</a></li>
11+
<li><a href="<?php echo esc_url( get_feed_link() ); ?>">rss</a></li>
12+
</ul>
13+
</div>
14+
<div>
15+
<h4><?php esc_html_e( 'Systems', 'minimalcode' ); ?></h4>
16+
<ul>
17+
<li><a href="#">automem</a></li>
18+
<li><a href="#">autohub</a></li>
19+
<li><a href="#">autojack</a></li>
20+
</ul>
3221
</div>
33-
34-
<?php if (has_nav_menu('social')) : ?>
35-
<nav class="footer-navigation">
36-
<?php
37-
wp_nav_menu(array(
38-
'theme_location' => 'social',
39-
'menu_class' => 'footer-menu',
40-
'container' => false,
41-
'depth' => 1,
42-
));
43-
?>
44-
</nav>
45-
<?php endif; ?>
22+
<div>
23+
<h4><?php esc_html_e( 'Elsewhere', 'minimalcode' ); ?></h4>
24+
<ul>
25+
<?php $social_links = minimalcode_social_links(); ?>
26+
<?php if ( $social_links['github'] ) : ?><li><a href="<?php echo esc_url( $social_links['github'] ); ?>">github</a></li><?php endif; ?>
27+
<?php if ( $social_links['twitter'] ) : ?><li><a href="<?php echo esc_url( $social_links['twitter'] ); ?>">x/twitter</a></li><?php endif; ?>
28+
<?php if ( $social_links['email'] ) : ?><li><a href="mailto:<?php echo esc_attr( $social_links['email'] ); ?>">email</a></li><?php endif; ?>
29+
</ul>
30+
</div>
31+
<div>
32+
<h4><?php esc_html_e( 'Colophon', 'minimalcode' ); ?></h4>
33+
<ul>
34+
<li>wordpress</li>
35+
<li>minimalcode</li>
36+
<li>built in public</li>
37+
</ul>
38+
</div>
39+
</div>
40+
<div class="footer-foot">
41+
<span><?php echo esc_html( get_bloginfo( 'name' ) ); ?> © <?php echo esc_html( date( 'Y' ) ); ?></span>
42+
<span class="colophon"><?php esc_html_e( 'Just another Wordprussite.', 'minimalcode' ); ?></span>
4643
</div>
4744
</div>
4845
</footer>

functions.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,19 @@ function minimalcode_reading_time() {
105105
return $reading_time . ' minute read';
106106
}
107107

108+
/**
109+
* Return the first category name for compact newspaper-style labels.
110+
*/
111+
function minimalcode_primary_category_name() {
112+
$categories = get_the_category();
113+
114+
if (!empty($categories)) {
115+
return $categories[0]->name;
116+
}
117+
118+
return __('Log', 'minimalcode');
119+
}
120+
108121
/**
109122
* Custom excerpt length
110123
*/

header.php

Lines changed: 67 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -17,65 +17,75 @@
1717
<body <?php body_class(); ?>>
1818
<?php wp_body_open(); ?>
1919

20-
<header class="site-header">
21-
<div class="container">
22-
<div class="header-content">
23-
<div class="site-branding">
24-
<h1 class="site-title">
25-
<a href="<?php echo esc_url(home_url('/')); ?>" rel="home">
26-
<?php bloginfo('name'); ?>
27-
</a>
28-
</h1>
29-
<?php
30-
$tagline = get_theme_mod('minimalcode_tagline', get_bloginfo('description'));
31-
if ($tagline) :
32-
?>
33-
<p class="site-description"><?php echo esc_html($tagline); ?></p>
34-
<?php endif; ?>
35-
</div>
20+
<div class="ticker" aria-label="<?php esc_attr_e( 'Site status ticker', 'minimalcode' ); ?>">
21+
<div class="ticker-track">
22+
<?php
23+
$ticker_items = array(
24+
'automem recall pipeline live',
25+
'autohub orchestration notes',
26+
'wp fusion still pays the bills',
27+
'autojack last pass: recent',
28+
'skills indexed locally',
29+
'debug notes from production',
30+
);
3631

37-
<nav class="main-navigation">
38-
<?php
39-
wp_nav_menu(array(
40-
'theme_location' => 'primary',
41-
'menu_class' => 'nav-menu',
42-
'container' => false,
43-
'fallback_cb' => false,
44-
));
45-
?>
46-
<button class="search-trigger" aria-label="Search (⌘K)" title="Search (⌘K)">
47-
<?php minimalcode_the_icon('search', 20); ?>
48-
<span class="search-trigger-label">Search&hellip;</span>
49-
<span class="search-kbd">⌘K</span>
50-
</button>
51-
<button class="theme-toggle" aria-label="Toggle dark mode" title="Toggle dark mode">
52-
<span class="sun-icon"><?php minimalcode_the_icon('sun', 20); ?></span>
53-
<span class="moon-icon"><?php minimalcode_the_icon('moon', 20); ?></span>
54-
</button>
55-
<?php
56-
$header_social = minimalcode_social_links();
57-
if ( array_filter( array(
58-
'github' => $header_social['github'],
59-
'twitter' => $header_social['twitter'],
60-
'linkedin' => $header_social['linkedin'],
61-
) ) ) :
62-
?>
63-
<ul class="header-social" aria-label="Social links">
64-
<?php if ( $header_social['github'] ) : ?>
65-
<li><a class="social-squircle" href="<?php echo esc_url( $header_social['github'] ); ?>" target="_blank" rel="noopener noreferrer" aria-label="GitHub" title="GitHub"><?php minimalcode_the_icon('github', 20); ?></a></li>
66-
<?php endif; ?>
67-
<?php if ( $header_social['twitter'] ) : ?>
68-
<li><a class="social-squircle" href="<?php echo esc_url( $header_social['twitter'] ); ?>" target="_blank" rel="noopener noreferrer" aria-label="X (Twitter)" title="X (Twitter)"><?php minimalcode_the_icon('twitter', 20); ?></a></li>
69-
<?php endif; ?>
70-
<?php if ( $header_social['linkedin'] ) : ?>
71-
<li><a class="social-squircle" href="<?php echo esc_url( $header_social['linkedin'] ); ?>" target="_blank" rel="noopener noreferrer" aria-label="LinkedIn" title="LinkedIn"><?php minimalcode_the_icon('linkedin', 20); ?></a></li>
72-
<?php endif; ?>
73-
</ul>
74-
<?php endif; ?>
75-
</nav>
76-
</div>
77-
</div>
32+
foreach ( array_merge( $ticker_items, $ticker_items ) as $ticker_item ) :
33+
?>
34+
<span><?php echo esc_html( $ticker_item ); ?><span class="dot">&bull;</span></span>
35+
<?php endforeach; ?>
36+
</div>
37+
</div>
38+
39+
<header class="masthead wrap">
40+
<div class="mast-row">
41+
<div class="brand">
42+
<a class="brand-logo" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
43+
<?php bloginfo( 'name' ); ?>
44+
</a>
45+
<div class="brand-meta">
46+
VOL.04 / <span class="iss">ISS.27</span><br>
47+
EST. 2009 · MIA / LIS<br>
48+
jack arturo · vgp
49+
</div>
50+
</div>
51+
52+
<div class="mast-tag serif">
53+
&quot;Just another <span class="pull">Wordprussite</span>.&quot; — a working notebook for memory-bearing agents, half-built systems, and bugs we learned to live with.
54+
</div>
55+
56+
<div class="mast-utility">
57+
<button class="util-btn search-trigger" aria-label="Search (⌘K)" title="Search (⌘K)">
58+
<span class="search-kbd">⌘K</span>
59+
<span class="search-trigger-label"><?php esc_html_e( 'Search', 'minimalcode' ); ?></span>
60+
</button>
61+
<button class="util-btn theme-toggle" aria-label="Toggle dark mode" title="Toggle dark mode">
62+
<span class="sun-icon"><?php esc_html_e( 'Light', 'minimalcode' ); ?></span>
63+
<span class="moon-icon"><?php esc_html_e( 'Dark', 'minimalcode' ); ?></span>
64+
</button>
65+
<a class="util-btn hot" href="<?php echo esc_url( get_feed_link() ); ?>"><?php esc_html_e( 'RSS', 'minimalcode' ); ?></a>
66+
</div>
67+
</div>
7868
</header>
7969

70+
<nav class="nav wrap" aria-label="<?php esc_attr_e( 'Primary navigation', 'minimalcode' ); ?>">
71+
<a class="nav-item <?php echo is_home() ? 'active' : ''; ?>" href="<?php echo esc_url( home_url( '/' ) ); ?>">
72+
<span class="nav-num">01</span> <?php esc_html_e( 'Log', 'minimalcode' ); ?>
73+
</a>
74+
<a class="nav-item <?php echo is_post_type_archive( 'project' ) ? 'active' : ''; ?>" href="<?php echo esc_url( get_post_type_archive_link( 'project' ) ); ?>">
75+
<span class="nav-num">02</span> <?php esc_html_e( 'Projects', 'minimalcode' ); ?>
76+
</a>
77+
<a class="nav-item" href="<?php echo esc_url( home_url( '/dev-pulse/' ) ); ?>">
78+
<span class="nav-num">03</span> <?php esc_html_e( 'Dev Pulse', 'minimalcode' ); ?>
79+
</a>
80+
<a class="nav-item" href="<?php echo esc_url( home_url( '/about/' ) ); ?>">
81+
<span class="nav-num">04</span> <?php esc_html_e( 'About', 'minimalcode' ); ?>
82+
</a>
83+
<a class="nav-item" href="<?php echo esc_url( home_url( '/colophon/' ) ); ?>">
84+
<span class="nav-num">05</span> <?php esc_html_e( 'Colophon', 'minimalcode' ); ?>
85+
</a>
86+
<span class="nav-spacer" aria-hidden="true"></span>
87+
<span class="nav-status"><span class="live-dot"></span><?php esc_html_e( 'Live', 'minimalcode' ); ?></span>
88+
</nav>
89+
8090
<main id="main" class="site-main">
8191

0 commit comments

Comments
 (0)