Skip to content

Commit 090b9fb

Browse files
committed
readme: add table of content
1 parent 85b0d08 commit 090b9fb

File tree

1 file changed

+53
-28
lines changed

1 file changed

+53
-28
lines changed

‎README.md‎

Lines changed: 53 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
![Screenshot of the hudevto push command](https://user-images.githubusercontent.com/2195781/108324642-737e7f80-71c8-11eb-9e4f-8f23fd14d644.png)
44

5+
**Content:**
6+
7+
- [Install](#install)
8+
- [Usage](#usage)
9+
- [Use it](#use-it)
10+
- [List your dev.to articles](#list-your-devto-articles)
11+
- [Preview the Markdown content that will be pushed to dev.to](#preview-the-markdown-content-that-will-be-pushed-to-devto)
12+
- [Push one blog post to dev.to](#push-one-blog-post-to-devto)
13+
- [Push all blog posts to dev.to](#push-all-blog-posts-to-devto)
14+
- [Notes](#notes)
15+
516
## Install
617

718
```sh
@@ -34,9 +45,10 @@ First, copy your dev.to token from your dev.to settings and set it as an environ
3445
export DEVTO_APIKEY=$(lpass show dev.to -p)
3546
```
3647

37-
**List your dev.to posts**. This is useful because I have dev.to configured with
38-
the RSS feed of my blog so that dev.to automatically creates a draft of each
39-
of my new posts.
48+
### List your dev.to articles
49+
50+
This is useful because I have dev.to configured with the RSS feed of my
51+
blog so that dev.to automatically creates a draft of each of my new posts.
4052

4153
```sh
4254
% hudevto list
@@ -49,7 +61,34 @@ of my new posts.
4961
317339: published at https://dev.to/maelvls/learning-kubernetes-controllers-496j (Learning Kubernetes Controllers)
5062
```
5163

52-
**Preview the Markdown content that will be pushed to dev.to**.
64+
### Preview the Markdown content that will be pushed to dev.to
65+
66+
I use the `hudevto preview` command because I do some transformations and I need a way to preview the changes to make sure the Markdown and front matter make sense. The transformations are:
67+
68+
- Generate a new front matter which is used by dev.to for setting the dev.to post title and canonical URL;
69+
- Change the Hugo "tags" into Liquid tags, such as:
70+
71+
```md
72+
{{< youtube 30a0WrfaS2A >}}
73+
```
74+
75+
is changed to the Liquid tag:
76+
77+
```md
78+
{% youtube 30a0WrfaS2A %}
79+
```
80+
81+
- Add the base URL of the post to the markdown images so that images are not broken. ONLY WORKS if your images are stored along side your blog post, such as:
82+
83+
```sh
84+
% ls --tree ./content/2020/avoid-gke-lb-using-hostport
85+
./content/2020/avoid-gke-lb-using-hostport
86+
├── cost-load-balancer-gke.png
87+
├── cover-external-dns.png
88+
├── how-service-controller-works-on-gke.png
89+
├── index.md # The actual blog post.
90+
└── packet-routing-with-akrobateo.png
91+
```
5392

5493
```sh
5594
% hudevto preview ./content/2020/avoid-gke-lb-using-hostport/index.md
@@ -73,38 +112,24 @@ cover_image: "https://maelvls.dev/avoid-gke-lb-with-hostport/cover-external-dns.
73112
In my spare time, I maintain a tiny "playground" Kubernetes cluster on [GKE](https://cloud.google.com/kubernetes-engine) (helm charts [here](https://github.com/maelvls/k.maelvls.dev)). I quickly realized that realized using `Service type=LoadBalancer` in GKE was spawning a _[Network Load Balancer](https://cloud.google.com/load-balancing/docs/network)_ which costs approximately **\$15 per month**! In this post, I present a way of avoiding the expensive Google Network Load Balancer by load balancing in-cluster using akrobateo, which acts as a Service type=LoadBalancer controller.
74113
```
75114

76-
I use the `preview` command because I do some transformations and I need a way to preview the changes to make sure the Markdown and front matter make sense. The transformations are:
77-
78-
- Generate a new front matter which is used by dev.to for setting the dev.to post title and canonical URL;
79-
- Change the Hugo "tags" into Liquid tags, such as:
80-
```md
81-
{{< youtube 30a0WrfaS2A >}}
82-
```
83-
is changed to the Liquid tag:
84-
```md
85-
{% youtube 30a0WrfaS2A %}
86-
```
87-
- Gdd the base URL of the post to the markdown images so that images are not broken. ONLY WORKS if your images are stored along side your blog post, such as:
88-
```sh
89-
% ls --tree ./content/2020/avoid-gke-lb-using-hostport
90-
./content/2020/avoid-gke-lb-using-hostport
91-
├── cost-load-balancer-gke.png
92-
├── cover-external-dns.png
93-
├── how-service-controller-works-on-gke.png
94-
├── index.md # The actual blog post.
95-
└── packet-routing-with-akrobateo.png
96-
```
97-
98-
**Push one blog post to dev.to**
115+
### Push one blog post to dev.to
99116

100117
```sh
101118
% hudevto push ./content/2020/avoid-gke-lb-using-hostport/index.md
102119
success: ./content/2020/avoid-gke-lb-using-hostport/index.md pushed published to https://dev.to/maelvls/avoid-gke-s-expensive-load-balancer-by-using-hostport-2ab9 (devtoId: 241275, devtoPublished: true)
103120
```
104121

105-
**Push all blog posts to dev.to**
122+
### Push all blog posts to dev.to
106123

107124
```sh
125+
% hudevto push
126+
success: ./content/notes/dns.md pushed unpublished to https://dev.to/maelvls/it-s-always-the-dns-fault-3lg3-temp-slug-8953915/edit (devtoId: 410260, devtoPublished: false)
127+
success: ./content/2020/deployment-available-condition/index.md pushed published to https://dev.to/maelvls/understanding-the-available-condition-of-a-kubernetes-deployment-51li (devtoId: 386691, devtoPublished: true)
128+
success: ./content/2020/docker-proxy-registry-kind/index.md pushed published to https://dev.to/maelvls/pull-through-docker-registry-on-kind-clusters-cpo (devtoId: 410837, devtoPublished: true)
129+
success: ./content/2020/mitmproxy-kubectl/index.md pushed published to https://dev.to/maelvls/using-mitmproxy-to-understand-what-kubectl-does-under-the-hood-36om (devtoId: 377876, devtoPublished: true)
130+
success: ./content/2020/static-libraries-and-autoconf-hell/index.md pushed published to https://dev.to/maelvls/epic-journey-with-statically-and-dynamically-linked-libraries-a-so-1khn (devtoId: 365849, devtoPublished: true)
131+
success: ./content/2020/gh-actions-with-tf-private-repo/index.md pushed published to https://dev.to/maelvls/github-actions-with-a-private-terraform-module-5b85 (devtoId: 331169, devtoPublished: true)
132+
...
108133
```
109134

110135
## Notes

0 commit comments

Comments
 (0)