Skip to content

Commit 024cb06

Browse files
committed
improve theme: update deps, fix bugs, add a11y/perf/ci/dx/docs improvements
1 parent e7a6547 commit 024cb06

25 files changed

Lines changed: 475 additions & 100 deletions

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
indent_size = 4
13+
trim_trailing_whitespace = false

.github/workflows/build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: ruby/setup-ruby@v1
16+
with:
17+
ruby-version: "3.3"
18+
bundler-cache: true
19+
20+
- name: Build site
21+
run: JEKYLL_ENV=production bundle exec jekyll build
22+
env:
23+
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pages.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [master]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: ruby/setup-ruby@v1
24+
with:
25+
ruby-version: "3.3"
26+
bundler-cache: true
27+
28+
- name: Build site
29+
run: JEKYLL_ENV=production bundle exec jekyll build -d ./_site
30+
env:
31+
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- uses: actions/upload-pages-artifact@v3
34+
35+
deploy:
36+
environment:
37+
name: github-pages
38+
url: ${{ steps.deployment.outputs.page_url }}
39+
runs-on: ubuntu-latest
40+
needs: build
41+
steps:
42+
- id: deployment
43+
uses: actions/deploy-pages@v4

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.3.1

404.html

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,8 @@
11
---
2+
layout: default
3+
title: Page not found
24
permalink: /404.html
3-
layout: post
45
---
56

6-
<style type="text/css" media="screen">
7-
.container {
8-
margin: 1em auto;
9-
max-width: 60em;
10-
text-align: center;
11-
}
12-
h1 {
13-
margin: 30px 0;
14-
font-size: 4em;
15-
line-height: 1;
16-
letter-spacing: -1px;
17-
}
18-
</style>
19-
20-
<div class="container">
21-
<h1>404</h1>
22-
23-
<p><strong>Page not found :(</strong></p>
24-
<p>The requested page could not be found.</p>
25-
</div>
7+
<h1>404</h1>
8+
<p>Page not found. <a href="{{ "/" | relative_url }}">Head back home</a>.</p>

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Changelog
2+
3+
## Unreleased
4+
5+
### Added
6+
- GitHub Markdown Alerts (admonitions) support - NOTE, TIP, IMPORTANT, WARNING, CAUTION
7+
- Light mode syntax highlighting with proper contrast
8+
- Tag archive page with clickable tags in posts
9+
- 404 page with themed layout
10+
- Skip-to-content link for keyboard and screen reader users
11+
- `prefers-reduced-motion` support for theme transitions
12+
- `aria-label` and `aria-pressed` on theme toggle button
13+
- `robots.txt` with sitemap reference
14+
- `jekyll-sitemap` for automatic sitemap generation
15+
- `.ruby-version` file for consistent Ruby version management
16+
- `.editorconfig` for cross-editor formatting consistency
17+
- `bin/build` script for production builds
18+
- `Makefile` with setup, serve, build, and clean targets
19+
- `netlify.toml` deployment configuration
20+
- GitHub Actions workflows for build validation and Pages deployment
21+
- Font preconnect hints for faster loading
22+
- DNS prefetch for Soopr SDK
23+
24+
### Changed
25+
- Moved Google Fonts from render-blocking SCSS imports to non-blocking link tags
26+
- Updated gem dependencies: Jekyll ~> 4.3, rouge ~> 4.2, jekyll-feed ~> 0.17, webrick ~> 1.8
27+
- Theme toggle button uses static positioning on mobile (no longer overlaps content)
28+
- Improved `bin/bootstrap` with Ruby version check
29+
- Improved `bin/start` with `--livereload` and passthrough flags
30+
- Soopr twitter handle now reads from `_config.yml` instead of being hardcoded
31+
- Tags in posts now link to tag archive page
32+
- Improved 404 page with minimal themed layout
33+
- Gemspec now includes `_data/` directory in packaged files
34+
35+
### Fixed
36+
- Undefined CSS variable `--border` in blockquote styles (now uses `--text`)

CONTRIBUTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Contributing to Moonwalk
2+
3+
Bug reports and pull requests are welcome.
4+
5+
## Development setup
6+
7+
1. Fork and clone the repo
8+
2. Make sure you have Ruby installed (see `.ruby-version` for the recommended version)
9+
3. Run `bin/bootstrap` to install dependencies
10+
4. Run `bin/start` to launch the dev server at `http://127.0.0.1:4000`
11+
12+
You can also use `make serve` and `make build` if you prefer.
13+
14+
## Making changes
15+
16+
- Keep the theme minimal - avoid adding heavy dependencies or complex JavaScript
17+
- Test both light and dark mode for any visual changes
18+
- Make sure the site builds cleanly with `bin/build`
19+
- If adding a new config option, document it in `_config.yml` with a comment
20+
21+
## Pull requests
22+
23+
- Keep PRs focused on a single change
24+
- Describe what the change does and why
25+
- Include a screenshot if the change is visual

Gemfile.lock

Lines changed: 51 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,75 +2,93 @@ PATH
22
remote: .
33
specs:
44
moonwalk (0.1.3)
5-
jekyll (~> 4.2.0)
6-
jekyll-feed (~> 0.15.0)
5+
jekyll (~> 4.3)
6+
jekyll-feed (~> 0.17)
7+
jekyll-sitemap (~> 1.4)
78
jekyll-soopr-seo-tag (~> 2.7.3)
8-
rouge (~> 3.23.0)
9-
webrick (~> 1.7)
9+
rouge (~> 4.2)
10+
webrick (~> 1.8)
1011

1112
GEM
1213
remote: https://rubygems.org/
1314
specs:
14-
addressable (2.8.1)
15-
public_suffix (>= 2.0.2, < 6.0)
15+
addressable (2.9.0)
16+
public_suffix (>= 2.0.2, < 8.0)
17+
base64 (0.3.0)
18+
bigdecimal (4.1.1)
1619
colorator (1.1.0)
17-
concurrent-ruby (1.1.10)
20+
concurrent-ruby (1.3.6)
21+
csv (3.3.5)
1822
em-websocket (0.5.3)
1923
eventmachine (>= 0.12.9)
2024
http_parser.rb (~> 0)
2125
eventmachine (1.2.7)
22-
ffi (1.15.5)
26+
ffi (1.17.4)
2327
forwardable-extended (2.6.0)
24-
http_parser.rb (0.8.0)
25-
i18n (1.12.0)
28+
google-protobuf (4.34.1)
29+
bigdecimal
30+
rake (~> 13.3)
31+
http_parser.rb (0.8.1)
32+
i18n (1.14.8)
2633
concurrent-ruby (~> 1.0)
27-
jekyll (4.2.2)
34+
jekyll (4.4.1)
2835
addressable (~> 2.4)
36+
base64 (~> 0.2)
2937
colorator (~> 1.0)
38+
csv (~> 3.0)
3039
em-websocket (~> 0.5)
3140
i18n (~> 1.0)
32-
jekyll-sass-converter (~> 2.0)
41+
jekyll-sass-converter (>= 2.0, < 4.0)
3342
jekyll-watch (~> 2.0)
34-
kramdown (~> 2.3)
43+
json (~> 2.6)
44+
kramdown (~> 2.3, >= 2.3.1)
3545
kramdown-parser-gfm (~> 1.0)
3646
liquid (~> 4.0)
37-
mercenary (~> 0.4.0)
47+
mercenary (~> 0.3, >= 0.3.6)
3848
pathutil (~> 0.9)
39-
rouge (~> 3.0)
49+
rouge (>= 3.0, < 5.0)
4050
safe_yaml (~> 1.0)
41-
terminal-table (~> 2.0)
42-
jekyll-feed (0.15.1)
51+
terminal-table (>= 1.8, < 4.0)
52+
webrick (~> 1.7)
53+
jekyll-feed (0.17.0)
54+
jekyll (>= 3.7, < 5.0)
55+
jekyll-sass-converter (3.1.0)
56+
sass-embedded (~> 1.75)
57+
jekyll-sitemap (1.4.0)
4358
jekyll (>= 3.7, < 5.0)
44-
jekyll-sass-converter (2.2.0)
45-
sassc (> 2.0.1, < 3.0)
4659
jekyll-soopr-seo-tag (2.7.3)
4760
jekyll (>= 3.8, < 5.0)
4861
jekyll-watch (2.2.1)
4962
listen (~> 3.0)
50-
kramdown (2.4.0)
51-
rexml
63+
json (2.19.3)
64+
kramdown (2.5.2)
65+
rexml (>= 3.4.4)
5266
kramdown-parser-gfm (1.1.0)
5367
kramdown (~> 2.0)
54-
liquid (4.0.3)
55-
listen (3.7.1)
68+
liquid (4.0.4)
69+
listen (3.10.0)
70+
logger
5671
rb-fsevent (~> 0.10, >= 0.10.3)
5772
rb-inotify (~> 0.9, >= 0.9.10)
73+
logger (1.7.0)
5874
mercenary (0.4.0)
5975
pathutil (0.16.2)
6076
forwardable-extended (~> 2.6)
61-
public_suffix (5.0.0)
77+
public_suffix (7.0.5)
78+
rake (13.3.1)
6279
rb-fsevent (0.11.2)
63-
rb-inotify (0.10.1)
80+
rb-inotify (0.11.1)
6481
ffi (~> 1.0)
65-
rexml (3.2.5)
66-
rouge (3.23.0)
82+
rexml (3.4.4)
83+
rouge (4.7.0)
6784
safe_yaml (1.0.5)
68-
sassc (2.4.0)
69-
ffi (~> 1.9)
70-
terminal-table (2.0.0)
71-
unicode-display_width (~> 1.1, >= 1.1.1)
72-
unicode-display_width (1.8.0)
73-
webrick (1.7.0)
85+
sass-embedded (1.99.0)
86+
google-protobuf (~> 4.31)
87+
rake (>= 13)
88+
terminal-table (3.0.2)
89+
unicode-display_width (>= 1.1.1, < 3)
90+
unicode-display_width (2.6.0)
91+
webrick (1.9.2)
7492

7593
PLATFORMS
7694
ruby

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.PHONY: setup serve build clean
2+
3+
setup:
4+
bin/bootstrap
5+
6+
serve:
7+
bin/start
8+
9+
build:
10+
bin/build
11+
12+
clean:
13+
bundle exec jekyll clean

README.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@
88
</h3>
99

1010
## Features
11-
* Light & dark mode with theme switcher
11+
* Light & dark mode with theme switcher (respects `prefers-reduced-motion`)
1212
* Vertical list, horizontal list, card list
1313
* Landing page with navbar, footer, portfolio
1414
* Fast (very minimal CSS) - 100/100 on performance, accessibility, best practices and SEO, please see [Lighthouse Report](https://raw.githubusercontent.com/abhinavs/moonwalk/master/_screenshots/lighthouse-report.png) for more details
1515
* Responsive and mobile friendly
16-
* SEO optimized (uses [Jekyll Soopr SEO Tag](https://github.com/jekyll/jekyll-soopr-seo-tag))
16+
* SEO optimized with auto-generated sitemap
1717
* RSS feed (uses [Jekyll Feed](https://github.com/jekyll/jekyll-feed))
18+
* [GitHub Markdown Alerts](#github-markdown-alerts) (NOTE, TIP, IMPORTANT, WARNING, CAUTION)
19+
* Tag archive page with clickable tags
20+
* Light and dark mode syntax highlighting
21+
* Accessible - skip-to-content link, ARIA labels, keyboard friendly
1822
* Easy to extend
1923
* Fully compatible with [GitHub Pages](https://pages.github.com/) (see [GitHub Pages installation](#github-pages-installation))
2024
* Auto-generated share images for social media (using [Soopr](https://www.soopr.co))
@@ -118,17 +122,40 @@ html {
118122

119123
<img src="https://raw.githubusercontent.com/abhinavs/moonwalk/master/_screenshots/twitter_card.png" />
120124

125+
### GitHub Markdown Alerts
126+
127+
Moonwalk supports [GitHub-style Markdown Alerts](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts). Use them in your posts like this:
128+
129+
```markdown
130+
> [!NOTE]
131+
> Useful information that users should know, even when skimming content.
132+
133+
> [!TIP]
134+
> Helpful advice for doing things better or more easily.
135+
136+
> [!IMPORTANT]
137+
> Key information users need to know to achieve their goal.
138+
139+
> [!WARNING]
140+
> Urgent info that needs immediate user attention to avoid problems.
141+
142+
> [!CAUTION]
143+
> Advises about risks or negative outcomes of certain actions.
144+
```
145+
146+
All five alert types are styled with color-coded left borders and icons, and work in both light and dark mode.
147+
121148
## Contributing
122149

123-
Bug reports and pull requests are welcome on GitHub at https://github.com/abhinavs/moonwalk.
150+
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
124151

125152
## Development
126153

127-
To set up your environment to develop this theme, run `bundle install`.
128-
129-
Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
154+
1. Run `bin/bootstrap` (or `make setup`) to install dependencies
155+
2. Run `bin/start` (or `make serve`) to start the dev server with live reload at `http://127.0.0.1:4000`
156+
3. Run `bin/build` (or `make build`) for a production build
130157

131-
When your theme is released, only the files in `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled.
158+
When your theme is released, only the files in `_layouts`, `_includes`, `_sass`, `_data`, and `assets` tracked with Git will be bundled.
132159
To add a custom directory to your theme-gem, please edit the regexp in `moonwalk.gemspec` accordingly.
133160

134161
## Acknowledgement

0 commit comments

Comments
 (0)