Skip to content

Commit ebade23

Browse files
feat: Add language specifiers to code blocks
Adds language specifiers to all code blocks in the blog and notes to ensure proper syntax highlighting with the new CodeMirror integration.
1 parent 044168c commit ebade23

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

src/content/blog/getting-started-with-ansible.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ your-folder-name/
4545
First, define the server host machines and ensure they are accessible via SSH. Set up the necessary SSH configuration using private/public keys, then specify the hosts in the inventory/hosts file like this:
4646

4747
inventory/hosts
48-
```
48+
```ini
4949
[web_servers]
5050
your-host-ip # for example: 192.168.1.10
5151
```
5252

5353
Define the ansible.cfg file like this:
5454

5555
ansible.cfg
56-
```
56+
```ini
5757
[defaults]
5858
inventory = inventory/hosts
5959
remote_user = ubuntu
@@ -95,7 +95,7 @@ Here is the breakdown of the ansible.cfg settings:
9595
Ansible uses simple, human-readable scripts called playbooks to automate tasks. Now add the playbook file in the following location:
9696

9797
playbooks/provision.yml
98-
```
98+
```yaml
9999
- name: Provision PHP
100100
hosts: web_servers
101101
become: true
@@ -143,7 +143,7 @@ The roles/ directory is where Ansible stores reusable automation logic. Each rol
143143
Now let's configure the `common` role. This role is mainly useful for common tasks like updating the apt cache, installing packages, setting timezone, etc.
144144

145145
roles/common/tasks/main.yml
146-
```
146+
```yaml
147147
- name: Install common packages
148148
apt:
149149
name:
@@ -168,15 +168,15 @@ roles/common/tasks/main.yml
168168
The {{ timezone }} variable is defined in the roles/common/vars/main.yml file:
169169

170170
roles/common/vars/main.yml
171-
```
171+
```yaml
172172
---
173173
timezone: Asia/Tokyo
174174
```
175175

176176
Now that the common role is ready, let's set up the PHP role in a similar way:
177177

178178
roles/php/tasks/main.yml
179-
```
179+
```yaml
180180
- name: Install PHP and extensions
181181
apt:
182182
name:
@@ -194,7 +194,7 @@ roles/php/tasks/main.yml
194194
This will install PHP and php-fpm (PHP FastCGI Process Manager) and notify the handler to restart php-fpm. The handler is defined like this:
195195

196196
roles/php/handlers/main.yml
197-
```
197+
```yaml
198198
- name: restart php-fpm
199199
service:
200200
name: "php{{ php_version }}-fpm"
@@ -205,7 +205,7 @@ roles/php/handlers/main.yml
205205
Set the PHP version in the following variable file:
206206

207207
roles/php/vars/main.yml
208-
```
208+
```yaml
209209
---
210210
php_version: 8.3
211211
```
@@ -214,7 +214,9 @@ If you need to add secret variables, you can use an Ansible vault file. When usi
214214

215215
Finally, run this command to provision the server:
216216

217-
`ansible-playbook playbooks/provision.yml`
217+
```bash
218+
ansible-playbook playbooks/provision.yml
219+
```
218220

219221
This is the basic way of using Ansible. For more advanced usage, please check additional resources about Ansible. Creating a README.md file for each role is a best practice to document all necessary details.
220222

src/content/notes/data-structure-circular-queue-in-javascript.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Circular Queue usage:
3636
- print() - print the elements in the queue
3737

3838

39-
```
39+
```js
4040
class CircularQueue {
4141
constructor(capacity) {
4242
this.items = new Array(capacity)
@@ -109,7 +109,7 @@ class CircularQueue {
109109

110110
This is the implementation for the circular queue data structure in JavaScript. Let's check if it workks correctly.
111111

112-
```
112+
```js
113113
const circularQueue = new CircularQueue(5)
114114
console.log(circularQueue.isEmpty()) // true
115115

src/content/notes/data-structure-linkedlist-in-javascript.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Linked List Usage
2727
- Video Player
2828

2929

30-
```
30+
```js
3131
class Node {
3232
constructor(value) {
3333
this.value = value
@@ -58,7 +58,7 @@ class LinkedList {
5858
}
5959
```
6060

61-
```
61+
```js
6262
const list = new LinkedList()
6363
console.log(list.isEmpty()) // true
6464
console.log(list.getSize()) // 0

0 commit comments

Comments
 (0)