From fd246b58d69d3ae61a7f7e0fb1a874aa8e2f19da Mon Sep 17 00:00:00 2001 From: Pallav Kumar Shrestha Date: Fri, 17 Mar 2023 22:40:46 +0100 Subject: [PATCH 1/5] Revert "sed: insert lines from file" This reverts commit 00cf292c1acc5808e51ed92228c45f659848aced. --- source/_posts/sed.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/source/_posts/sed.md b/source/_posts/sed.md index 801c475..bdc0a2b 100644 --- a/source/_posts/sed.md +++ b/source/_posts/sed.md @@ -257,14 +257,6 @@ Insert "Example: " before each line that contains "hello" ```shell script $ sed '/hello/i Example: ' file.txt ``` -Insert lines from file1 before line 5 -```shell script -$ sed '5 r file1' file.txt -``` -Insert lines from file1 after the line that starts with "hello" -```shell script -$ sed '/^hello/ r file1' file.txt -``` From 25a8b5593b161d29c0e6eda4e5a63bc296d4857f Mon Sep 17 00:00:00 2001 From: Pallav Kumar Shrestha Date: Fri, 17 Mar 2023 22:41:30 +0100 Subject: [PATCH 2/5] Revert "Revert "sed: insert lines from file"" This reverts commit fd246b58d69d3ae61a7f7e0fb1a874aa8e2f19da. --- source/_posts/sed.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/_posts/sed.md b/source/_posts/sed.md index bdc0a2b..801c475 100644 --- a/source/_posts/sed.md +++ b/source/_posts/sed.md @@ -257,6 +257,14 @@ Insert "Example: " before each line that contains "hello" ```shell script $ sed '/hello/i Example: ' file.txt ``` +Insert lines from file1 before line 5 +```shell script +$ sed '5 r file1' file.txt +``` +Insert lines from file1 after the line that starts with "hello" +```shell script +$ sed '/^hello/ r file1' file.txt +``` From 4011c244ad8c1795af01d0fa1277ddfd29fdb054 Mon Sep 17 00:00:00 2001 From: fechin Date: Sat, 18 Mar 2023 10:24:46 +0800 Subject: [PATCH 3/5] Resolve CSS Cheat Sheet and CSS style directory conflict --- nginx.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nginx.conf b/nginx.conf index 3602521..d4a0661 100644 --- a/nginx.conf +++ b/nginx.conf @@ -35,6 +35,11 @@ http { # Rename cheatsheet rewrite ^/golang$ /go permanent; + # Resolve CSS Cheat Sheet and CSS style directory conflict. + location ^/css$ { + alias css.html; + } + location / { try_files $uri $uri/ @html; } From 58affbcc3a47eac1b638ef7f4b0def51b19106ed Mon Sep 17 00:00:00 2001 From: fechin Date: Sat, 18 Mar 2023 11:02:25 +0800 Subject: [PATCH 4/5] Rename CSS files to CSS3 files and corresponding images --- source/_posts/{css.md => css3.md} | 0 .../image/{css-preview.png => css3-preview.png} | Bin 2 files changed, 0 insertions(+), 0 deletions(-) rename source/_posts/{css.md => css3.md} (100%) rename source/assets/image/{css-preview.png => css3-preview.png} (100%) diff --git a/source/_posts/css.md b/source/_posts/css3.md similarity index 100% rename from source/_posts/css.md rename to source/_posts/css3.md diff --git a/source/assets/image/css-preview.png b/source/assets/image/css3-preview.png similarity index 100% rename from source/assets/image/css-preview.png rename to source/assets/image/css3-preview.png From fb29b7845c0af72aef95efb9569c4e825bd7b6b1 Mon Sep 17 00:00:00 2001 From: fechin Date: Sat, 18 Mar 2023 11:02:35 +0800 Subject: [PATCH 5/5] Update rewrite rule for CSS Cheat Sheet from alias to permanent redirect --- nginx.conf | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/nginx.conf b/nginx.conf index d4a0661..f038b49 100644 --- a/nginx.conf +++ b/nginx.conf @@ -34,11 +34,7 @@ http { # Rename cheatsheet rewrite ^/golang$ /go permanent; - - # Resolve CSS Cheat Sheet and CSS style directory conflict. - location ^/css$ { - alias css.html; - } + rewrite ^/css$ /css3 permanent; location / { try_files $uri $uri/ @html;