diff --git a/blog-vault/.obsidian/workspace.json b/blog-vault/.obsidian/workspace.json index fbdd8479e9f6513c7bb5be8faac57a3507d369c9..6bc48b30c4b4b5db80f8419f9839737baeb4403b 100644 --- a/blog-vault/.obsidian/workspace.json +++ b/blog-vault/.obsidian/workspace.json @@ -13,15 +13,30 @@ "state": { "type": "markdown", "state": { - "file": "posts/2024-11-27 First Blog Post.md", + "file": "posts/First Blog Post.md", + "mode": "source", + "source": false + }, + "icon": "lucide-file", + "title": "First Blog Post" + } + }, + { + "id": "1f44ec327a2372e7", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "posts/Escaping Text for URLs in Python.md", "mode": "source", - "source": true + "source": false }, "icon": "lucide-file", - "title": "2024-11-27 First Blog Post" + "title": "Escaping Text for URLs in Python" } } - ] + ], + "currentTab": 1 } ], "direction": "vertical" @@ -166,8 +181,7 @@ } ], "direction": "horizontal", - "width": 300, - "collapsed": true + "width": 300 }, "left-ribbon": { "hiddenItems": { @@ -180,12 +194,12 @@ "bulk-exporter:Bulk Exporter Preview": false } }, - "active": "e5912a702b758f30", + "active": "1f44ec327a2372e7", "lastOpenFiles": [ + "posts/First Blog Post.md", + "posts/Escaping Text for URLs in Python.md", "templates/Blog Post Template.md", - "posts/2024-11-27 First Blog Post.md", "images/Pasted image 20241127184913.png", - "Untitled.md", "images", "posts", "First Blog Post.md", diff --git a/blog-vault/posts/Escaping Text for URLs in Python.md b/blog-vault/posts/Escaping Text for URLs in Python.md new file mode 100644 index 0000000000000000000000000000000000000000..afb1a78e4fc03cda94035b116bd6f35191ca0755 --- /dev/null +++ b/blog-vault/posts/Escaping Text for URLs in Python.md @@ -0,0 +1,19 @@ +--- +title: Escaping Text for URLs in Python +date: 2024-11-28T08:58:24+00:00 +draft: false +tags: + - programming + - python +--- +Escaping text for is really easy in Python. In fact, I used it for this project. +Here's how to do it: +```python +from urllib.parse import quote + +starting_text = "Test!" +escaped_text = quote(starting_text) +``` + +Initially, I thought that `urllib.parse.urlencode` should be used for this but I didn't read the documentation properly. +I realised that `urllib.parse.urlencode` is used for creating query strings from a dict, whereas `urllib.parse.quote` is actually used for escaping text. \ No newline at end of file diff --git a/blog-vault/posts/2024-11-27 First Blog Post.md b/blog-vault/posts/First Blog Post.md similarity index 85% rename from blog-vault/posts/2024-11-27 First Blog Post.md rename to blog-vault/posts/First Blog Post.md index 280ac520d20d048770a3b2b553e1dcebf802c1d2..524fc160ea7a5a29d675838a5d0dd3de3ffd7b63 100644 --- a/blog-vault/posts/2024-11-27 First Blog Post.md +++ b/blog-vault/posts/First Blog Post.md @@ -1,8 +1,9 @@ --- -title: 2024-11-27 First Blog Post +title: First Blog Post date: 2024-11-27T21:01:51+00:00 draft: false tags: + - test --- This is mostly a test of the scripts I'm writing to try and get Obsidian to sync to Hugo... hopefully. diff --git a/content/posts/Escaping Text for URLs in Python.md b/content/posts/Escaping Text for URLs in Python.md new file mode 100644 index 0000000000000000000000000000000000000000..afb1a78e4fc03cda94035b116bd6f35191ca0755 --- /dev/null +++ b/content/posts/Escaping Text for URLs in Python.md @@ -0,0 +1,19 @@ +--- +title: Escaping Text for URLs in Python +date: 2024-11-28T08:58:24+00:00 +draft: false +tags: + - programming + - python +--- +Escaping text for is really easy in Python. In fact, I used it for this project. +Here's how to do it: +```python +from urllib.parse import quote + +starting_text = "Test!" +escaped_text = quote(starting_text) +``` + +Initially, I thought that `urllib.parse.urlencode` should be used for this but I didn't read the documentation properly. +I realised that `urllib.parse.urlencode` is used for creating query strings from a dict, whereas `urllib.parse.quote` is actually used for escaping text. \ No newline at end of file diff --git a/content/posts/2024-11-27 First Blog Post.md b/content/posts/First Blog Post.md similarity index 87% rename from content/posts/2024-11-27 First Blog Post.md rename to content/posts/First Blog Post.md index f410230e7ffd42d7a4b2208ca3c0fd590117f733..aa0e17615e61ed16d7a09dcf91e857410665e0bb 100644 --- a/content/posts/2024-11-27 First Blog Post.md +++ b/content/posts/First Blog Post.md @@ -1,8 +1,9 @@ --- -title: 2024-11-27 First Blog Post +title: First Blog Post date: 2024-11-27T21:01:51+00:00 draft: false tags: + - test --- This is mostly a test of the scripts I'm writing to try and get Obsidian to sync to Hugo... hopefully.