Skip to content

Commit 21e066c

Browse files
committed
Output to public/ instead of site/
1 parent 105f8db commit 21e066c

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ jobs:
3232
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
3333

3434
- run: cargo run
35-
- run: cp CNAME ./site/
36-
- run: touch site/.nojekyll
35+
- run: cp CNAME ./public/
36+
- run: touch public/.nojekyll
3737

3838
- uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
3939
with:
40-
path: site
40+
path: public
4141

4242
deploy:
4343
if: ${{ github.ref == 'refs/heads/master' }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/target/
33
**/*.rs.bk
44
site
5+
public
56
static/styles/vendor.css
67
static/styles/app.css
78
static/styles/fonts.css

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ $ cargo run
1919

2020
You could do it in release mode if you'd like, but it's pretty fast in debug.
2121

22-
From there, the generated HTML will be in a `site` directory.
23-
Open `site/index.html` in your web browser to view the site.
22+
From there, the generated HTML will be in a `public` directory.
23+
Open `public/index.html` in your web browser to view the site.
2424

2525
```console
26-
$ firefox site/index.html
26+
$ firefox public/index.html
2727
```
2828

2929
You can also run a server, if you need to preview your changes on a different machine:

serve/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
77
let footer = format!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"));
88

99
warpy::server::run(
10-
format!("{}/../site", env!("CARGO_MANIFEST_DIR")),
10+
format!("{}/../public", env!("CARGO_MANIFEST_DIR")),
1111
[0, 0, 0, 0],
1212
footer,
1313
Some(8000),

src/bin/blog.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ pub fn main() -> eyre::Result<()> {
55

66
println!(
77
"blog has been generated; you can now serve its content by running\n\
8-
{INDENT}python3 -m http.server --directory {ROOT}/site\n\
8+
{INDENT}python3 -m http.server --directory {ROOT}/public\n\
99
or running:\n\
1010
{INDENT}cargo run -p serve\n\
1111
or you can read it directly by opening a web browser on:\n\
12-
{INDENT}file:///{ROOT}/site/index.html",
12+
{INDENT}file:///{ROOT}/public/index.html",
1313
ROOT = env!("CARGO_MANIFEST_DIR"),
1414
INDENT = " "
1515
);

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ fn copy_dir(source: impl AsRef<Path>, dest: impl AsRef<Path>) -> Result<(), io::
297297
}
298298

299299
pub fn main() -> eyre::Result<()> {
300-
let blog = Generator::new("site", "content")?;
300+
let blog = Generator::new("public", "content")?;
301301

302302
blog.render()?;
303303

@@ -306,11 +306,11 @@ pub fn main() -> eyre::Result<()> {
306306

307307
#[test]
308308
fn snapshot() {
309-
let _ = std::fs::remove_dir_all(concat!(env!("CARGO_MANIFEST_DIR"), "/site"));
309+
let _ = std::fs::remove_dir_all(concat!(env!("CARGO_MANIFEST_DIR"), "/public"));
310310
main().unwrap();
311311
let timestamped_files = ["releases.json", "feed.xml"];
312312
let inexplicably_non_deterministic_files = ["images/2023-08-rust-survey-2022/experiences.png"];
313-
insta::glob!("..", "site/**/*", |path| {
313+
insta::glob!("..", "public/**/*", |path| {
314314
if path.is_dir() {
315315
return;
316316
}
@@ -335,7 +335,7 @@ fn snapshot() {
335335
(r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+\d{2}:\d{2}", "(filtered timestamp)"),
336336
]}, {
337337
for file in timestamped_files {
338-
let content = fs::read(format!("site/{file}")).unwrap();
338+
let content = fs::read(format!("public/{file}")).unwrap();
339339
let content = String::from_utf8_lossy(&content).into_owned();
340340
insta::assert_snapshot!(content);
341341
}

0 commit comments

Comments
 (0)