Skip to content

Commit 305b27e

Browse files
author
Daniel Langr
committed
Update content
1 parent cb46df5 commit 305b27e

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

CLAUDE.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
66

77
This is **cppbits.dev**, a static website for C++ tutorials written in AsciiDoc format. The site is deployed to GitHub Pages at cppbits.dev.
88

9-
## Build and Preview
9+
## Build Commands
1010

1111
The site uses Asciidoctor to convert `.adoc` files to HTML.
1212

@@ -15,42 +15,45 @@ The site uses Asciidoctor to convert `.adoc` files to HTML.
1515
gem install asciidoctor
1616
```
1717

18-
**Build all files locally:**
18+
**Build everything:**
1919
```bash
20-
asciidoctor index.adoc
21-
asciidoctor posts/*.adoc
20+
make
2221
```
2322

24-
**Build a single post:**
23+
**Build a single file:**
2524
```bash
26-
asciidoctor posts/260114_move_semantics_explained.adoc
25+
asciidoctor articles/move/introductory_example.adoc
26+
```
27+
28+
**Clean generated HTML:**
29+
```bash
30+
make clean
2731
```
2832

2933
The GitHub Actions workflow (`.github/workflows/publish.yml`) automatically builds and deploys on push to master.
3034

3135
## Content Structure
3236

33-
- `index.adoc` - Main landing page with table of contents
34-
- `posts/*.adoc` - Individual tutorial posts (naming: `YYMMDD_title.adoc`)
35-
- `include/attributes.adoc` - Shared AsciiDoc attributes (styling, syntax highlighting, etc.)
37+
- `index.adoc` - Main landing page
38+
- `articles/` - Tutorial content organized by topic (e.g., `articles/move/`)
39+
- `include/attributes.adoc` - Shared AsciiDoc attributes (styling, syntax highlighting)
3640
- `include/copyright.adoc` - Copyright footer included in all pages
3741
- `stylesheets/ubuntu-custom.css` - Custom styling based on Ubuntu theme
3842

39-
## Writing Posts
43+
## Writing Articles
4044

41-
Posts should:
42-
1. Set `:rootdir: ..` to properly resolve includes
45+
Articles should:
46+
1. Set `:rootdir:` relative to the include directory (e.g., `../..` for `articles/topic/file.adoc`)
4347
2. Include `{rootdir}/include/attributes.adoc` for consistent styling
4448
3. Include `{rootdir}/include/copyright.adoc` at the end
45-
4. Use `[source]` blocks for C++ code (syntax highlighting is preconfigured)
49+
4. Use `[source]` blocks for C++ code (syntax highlighting via highlight.js is preconfigured)
4650

47-
Example post header:
51+
Example article header:
4852
```asciidoc
49-
= Post Title
53+
= Article Title
5054
Daniel Langr
51-
:revdate: January 2025
52-
:rootdir: ..
55+
:rootdir: ../..
5356
include::{rootdir}/include/attributes.adoc[]
5457
```
5558

56-
After creating a new post, add a link to it in `index.adoc` under the Contents section.
59+
After creating a new article or section, add a link to it in the appropriate index file.

articles/move/introductory_example.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ std::string s("orange");
2121
// How do we define 's2' so that it will have the same value as 's'?
2222
----
2323

24-
To achieve that, we need to “intialize `s2` by `s`”. To be more precise, the expression that initializes `s2` needs to refer to `s`.
24+
To achieve that, we need to “initialize `s2` by `s`”. More precisely, the expression that initializes `s2` must refer to `s`.
2525

2626
[source]
2727
----
@@ -47,7 +47,7 @@ std::string s2(s);
4747
// The value of 's' is "orange".
4848
----
4949

50-
If the second options applies, the initialization expression typically used is `std::move(s)`:
50+
If the second option applies, the initialization expression typically used is `std::move(s)`:
5151

5252
[source]
5353
----
@@ -56,7 +56,7 @@ std::string s2(std::move(s));
5656
// The value of 's' does not need to be "orange".
5757
----
5858

59-
What have these expressions in common? They both refer to variable `s`. This guarantees that `s2` will have the same value as `s` originally had.
59+
What do these expressions have in common? They both refer to variable `s`. This guarantees that `s2` will have the same value as `s` originally had.
6060

6161
[source]
6262
----

0 commit comments

Comments
 (0)