File tree Expand file tree Collapse file tree 3 files changed +33
-17
lines changed Expand file tree Collapse file tree 3 files changed +33
-17
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,30 @@ Orionrobots website source
55CC BY SA 3.0 - < http://creativecommons.org/licenses/by-sa/3.0/ >
66Creative Commons By Attribution Share-Alike v3.0
77
8+ ## Running serve and build in docker
9+
10+ ``` bash
11+ docker compose up --rm dist
12+ docker compose run --interactive --rm serve npm install
13+ docker compose run --interactive --rm serve npm run dev
14+ docker compose up serve
15+ ```
16+
17+ Get a bash prompt with ` docker compose run --interactive serve bash `
18+
19+ ## Running locally
20+
21+ You may need to determine dependencies - the docker method is preferred.
22+
823Serve only:
924
1025``` bash
1126npm install
1227npm run serve
1328```
1429
30+ ## If you make changes to htaccess
31+
1532For an experience closer to hosting, use docker compose:
1633
1734``` bash
@@ -22,13 +39,10 @@ Attaching to orionrobotsgithubio-web-1
2239orionrobotsgithubio-web-1 | ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux-musl]
2340```
2441
25- ## Running serve and build in docker
42+ ## If you make changes to css bundle content
43+
44+ You will need to rerun the dist task:
2645
2746``` bash
28- docker compose run --interactive --rm serve npm install
29- docker compose run --interactive --rm serve npm run dev
30- docker compose up serve
47+ docker compose up --rm dist
3148```
32-
33- Get a bash prompt with ` docker compose run --interactive serve bash `
34-
Original file line number Diff line number Diff line change @@ -13,12 +13,13 @@ services:
1313 image : node:18-bullseye
1414 command : ["rm", "-rf", "dist"]
1515
16- web :
17- build : _drafts/staging
18- ports :
19- - 8080:80
20- volumes :
21- - ./_site:/var/www/html
16+ # web:
17+ # build: _drafts/staging
18+ # ports:
19+ # - 8080:80
20+ # volumes:
21+ # - ./_site:/var/www/html
22+
2223 serve :
2324 image : node:18-bullseye
2425 volumes :
Original file line number Diff line number Diff line change 11const slugify = require ( "slugify" ) ;
22
3- function tag_item ( tag_name ) {
4- tag_slug = slugify ( tag_name ) ;
5- return `<li><a href="/tags/${ tag_slug } ">${ tag_name } </a></li>` ;
3+ function tag_item ( tag_name , tags ) {
4+ const tag_slug = slugify ( tag_name ) ;
5+ const count = tags [ tag_name ] ?. length || 0 ;
6+ return `<li><a href="/tags/${ tag_slug } ">${ tag_name } <span class="badge tag-badge rounded-pill">${ count } </span></a></li>` ;
67}
78
89function tag_list ( tags ) {
910 const keys = Object . keys ( tags ) . sort ( ) ;
10- return `<ul>${ keys . map ( tag_item ) . join ( "" ) } </ul>` ;
11+ return `<ul>${ keys . map ( tag => tag_item ( tag , tags ) ) . join ( "" ) } </ul>` ;
1112}
1213
1314class TagIndex {
You can’t perform that action at this time.
0 commit comments