Skip to content

Commit 87d59dd

Browse files
committed
Simplify, add writings first iteration.
1 parent a80c4bc commit 87d59dd

37 files changed

+7486
-12592
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,13 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4
12-
- uses: actions/setup-node@v4
13-
with:
14-
node-version: '14'
15-
- uses: actions/cache@v4
16-
with:
17-
path: '**/node_modules'
18-
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
19-
- run: yarn install
20-
- run: yarn run build
12+
- run: ruby generate.rb
13+
- run: mv .gitignore.build .gitignore
2114
- uses: JamesIves/github-pages-deploy-action@v4
2215
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
2316
with:
2417
git-config-name: 'RubyElders bot'
2518
git-config-email: 'info@rubyelders.com'
2619
branch: gh-pages # The branch the action should deploy to.
27-
folder: _site # The folder the action should deploy.
20+
folder: . # The folder the action should deploy.
2821
clean: true # Automatically remove deleted files from the deploy branch

.gitignore.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/*.erb
2+
**/*.rb
3+
**/*.md
4+
**/*.json

Gulpfile.js

Lines changed: 0 additions & 101 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
11
# rubyelders.com
22

3-
## setup
3+
## start "dev server"
44

55
```
6-
yarn install
7-
```
8-
9-
## start dev server
10-
11-
```
12-
yarn run server
6+
npx --yes chokidar-cli "**/*.{erb,json,md,rb}" -c "ruby generate.rb"
137
```
148

159
## build
1610

1711
```
18-
yarn run build
12+
ruby generate.rb
1913
```
2014

2115
## manual deploy (push to gh-pages)
2216

23-
```
24-
yarn run build
25-
yarn run deploy
26-
```
17+
Just commit changes, other to ruby generate.rb, there is no build needed.
2718

2819
*Usually there is no need for manual deploy. `master` branch is automatically deployed by GitHub actions.*

_layout.html.erb

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Writings | Ruby Elders</title>
7+
<link rel="stylesheet" href="/css/writings.css" />
8+
<link rel="icon" type="image/png" href="/assets/img/favicon.png" />
9+
<!-- Syntax Highlighting: Prism.js -->
10+
<link
11+
rel="stylesheet"
12+
href="https://cdn.jsdelivr.net/npm/prismjs/themes/prism-tomorrow.css"
13+
/>
14+
</head>
15+
<body>
16+
<header class="site-header">
17+
<a href="/writings.html">
18+
<svg
19+
viewBox="0 0 279.09328 71.770356"
20+
xmlns="http://www.w3.org/2000/svg"
21+
>
22+
<path
23+
d="m 236.07491,44.384808 c 0,-0.1 -0.2,-0.3 -0.4,-0.4 -1.2,-0.5 -3.7,-0.9 -5.7,-0.9 -3.8,0 -6.5,2.3 -6.5,5.4 0,3 2.2,4.9 4.7,5.9 2,0.8 5.6,1.6 5.6,4.2 0,1.4 -1.6,2.8 -3.2,2.8 -2.2,0 -4.4,-1.8 -5.6,-4.6 -0.4,-1 -0.6,-1.2 -0.9,-1.2 -0.3,0 -0.4,0.3 -0.4,0.7 l 0.3,3.9 c 0,0.7 0.2,1 0.9,1.2 1.9,0.4 3.7,1 5.4,1 4,0 7.5,-3 7.5,-6.5 0,-3.7 -3.5,-5.1 -6.3,-6.3 -2.8,-1.2 -4,-2.1 -4,-3.3 0,-1.3 1.5,-2.4 3.3,-2.4 2,0 4.2,1.8 4.9,4 0.3,0.8 0.4,0.9 0.8,0.9 0.3,0 0.4,-0.1 0.4,-0.4 v -0.3 z"
24+
/>
25+
<path
26+
d="m 211.77491,47.384808 v -3.3 c 0,-0.4 0,-0.6 -0.3,-0.6 -0.2,0 -0.7,0.3 -0.8,0.3 -1.3,0.5 -2.9,1.2 -5.7,2 -0.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.5 -0.6,2.1 -2.4,7.2 -5.3,12.2 -1.9,3.3 -4.1,6.1 -5.8,8.2 1.2,1.1 2.6,2.2 4,3.3 2.1,1.6 4.5,3.4 6.9,4.9 z"
55+
/>
56+
<path
57+
d="m 275.04646,48.019694 c -5.1,0.5 -10.3,-0.3 -15.3,-1.7 -5.8,-1.6 -11.3,-4 -16.4,-7 -5.1,-3 -10,-6.6 -14.3,-10.8 -3.6,-3.6 -7,-7.7 -9.1,-12.4 -0.2,-0.3 0.2,-0.6 0.5,-0.5 0,0 0.1,0 0.1,0.1 3.3,3.8 6.9,7.1 10.8,10.1 2.3,1.7 4.5,3.4 6.9,5 2.1,1.4 4.2,2.8 6.4,4 0.3,0.2 0.6,0.3 0.9,0.5 4.9,2.8 10,5.4 15.3,7.5 4.6,1.8 9.2,3.4 14.2,4.3 h 0.1 c 0.3,0.4 0.3,0.9 -0.1,0.9 z"
58+
/>
59+
</g>
60+
</svg>
61+
</a>
62+
</header>
63+
64+
<%= @content %>
65+
66+
<script src="https://cdn.jsdelivr.net/npm/prismjs/prism.js"></script>
67+
<script src="https://cdn.jsdelivr.net/npm/prismjs/components/prism-javascript.min.js"></script>
68+
<script src="https://cdn.jsdelivr.net/npm/prismjs/components/prism-css.min.js"></script>
69+
<script src="/assets/js/writings.js"></script>
70+
</body>
71+
</html>
72+

_list.html.erb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<main>
2+
<h1>Latest writings</h1>
3+
<ul class="post-list">
4+
<% @writings.each do |writing| %>
5+
<li>
6+
<a href="<%= writing[:url] %>"><%= writing[:title] %></a>
7+
<time datetime="<%= writing[:datetime] %>"><%= writing[:released_at] %></time>
8+
</li>
9+
<% end %>
10+
</ul>
11+
</main>

_post.html.erb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<article>
2+
<header>
3+
<h1><%= @writing[:title] %></h1>
4+
5+
<p class="post-meta">
6+
<span class="avatar-text-group">
7+
By
8+
<img
9+
id="avatar-photo"
10+
src="<%= @writing[:author_avatar_url] %>"
11+
/>
12+
<%= @writing[:author] %><%= @writing[:released_at] %><%= @writing[:place] %>
13+
</span>
14+
</p>
15+
</header>
16+
17+
<%= @content %>
18+
</article>

assets/img/hat.png

18.2 KB
Loading

assets/js/function.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
"use strict";
2-
3-
4-
$(function(){
5-
6-
});
7-
81
document.addEventListener("DOMContentLoaded", function () {
92
setTimeout(() => {
103
const hat = document.getElementById("hat");

assets/js/writings.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
function setupAnimation({
2+
selector,
3+
animationClass,
4+
duration = 1500,
5+
onLoad = false,
6+
onHover = true,
7+
}) {
8+
const element =
9+
typeof selector === "string" ? document.querySelector(selector) : selector;
10+
if (!element) return;
11+
12+
let isAnimating = false;
13+
14+
function triggerAnimation() {
15+
if (isAnimating) return;
16+
isAnimating = true;
17+
element.classList.add(animationClass);
18+
19+
setTimeout(() => {
20+
element.classList.remove(animationClass);
21+
isAnimating = false;
22+
}, duration);
23+
}
24+
25+
if (onLoad) {
26+
setTimeout(triggerAnimation, 2000); // or 0 for immediate
27+
}
28+
29+
if (onHover) {
30+
element.addEventListener("mouseenter", triggerAnimation);
31+
}
32+
}
33+
34+
document.addEventListener("DOMContentLoaded", function () {
35+
setupAnimation({
36+
selector: "#avatar-photo",
37+
animationClass: "spin",
38+
duration: 3000,
39+
onLoad: false,
40+
onHover: true,
41+
});
42+
43+
// You can reuse it for other elements too:
44+
setupAnimation({
45+
selector: "#hat",
46+
animationClass: "greet",
47+
duration: 1500,
48+
onLoad: true,
49+
onHover: true,
50+
});
51+
});

0 commit comments

Comments
 (0)