# Publishing Code

**URL:** <https://discuss.write.as/t/publishing-code/11936>\
**Category:** Help\
**Tags:** troubleshooting, writefreely\
**Created:** [April 28, 2024, 8:58pm UTC](https://discuss.write.as/t/publishing-code/11936 "2024-04-28T20:58:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crow](https://discuss.write.as/user_avatar/discuss.write.as/crow/32/3736_2.png) [@Crow](https://discuss.write.as/u/Crow)\
**Post date:** [April 28, 2024, 8:58pm UTC](https://discuss.write.as/t/publishing-code/11936/1 "2024-04-28T20:58:24Z")

</div>

Problem understanding publishing code-

From what I gather it needs three ` ` ` before and after (example below) to make code active but I can’t make this work with copy/paste. This publishing of code is new to me as is markdown.

Example:

```auto
useradd -r -m -d /srv/writefreely -s /bin/bash writefreely

usermod -a -G www-data writefreely

su – writefreely
` ` `
I attempted this with no luck on my Writefreely blog. I would appreciate either direct help here or a link to better comprehend what I am doing. I am an avid fan of Writefreely and want to pass on what I have learned but I am an old man of almost seventy-six but raring to go. Thank you for your consideration and I hope I wrote this correctly. ACrowe
```

---

<div class="post-metadata">

**Author:** ![PaoloAmoroso](https://discuss.write.as/user_avatar/discuss.write.as/paoloamoroso/32/1659_2.png) [@PaoloAmoroso](https://discuss.write.as/u/PaoloAmoroso)\
**Post date:** [April 29, 2024, 6:54am UTC](https://discuss.write.as/t/publishing-code/11936/2 "2024-04-29T06:54:44Z")

</div>

Try not leaving any spaces between the backquote characters, which should be matched like this (the `lisp` language designator is optional):

````
```lisp
(defun square (x)
  (* x x))
```

````

It renders like this:

```plaintext
(defun square (x)
  (* x x))

```

---

<div class="post-metadata">

**Author:** ![Crow](https://discuss.write.as/user_avatar/discuss.write.as/crow/32/3736_2.png) [@Crow](https://discuss.write.as/u/Crow)\
**Post date:** [April 30, 2024, 12:04am UTC](https://discuss.write.as/t/publishing-code/11936/3 "2024-04-30T00:04:02Z")

</div>

This is rather new to me so I give you a large thank you for replying. I will do as you suggested as I saw what appeared to be spaces between each and considered trying again without. Then I decided it would be great if I could just get an answer rather than going round and round. I will do this a little later tonight and get back to you should it be the answer. Thank you, ACrowe

---

<div class="post-metadata">

**Author:** ![Crow](https://discuss.write.as/user_avatar/discuss.write.as/crow/32/3736_2.png) [@Crow](https://discuss.write.as/u/Crow)\
**Post date:** [April 30, 2024, 10:00pm UTC](https://discuss.write.as/t/publishing-code/11936/4 "2024-04-30T22:00:55Z")

</div>

That tip worked wonderfully. Another question and I am done for now.

What is the proper code to fill out:

/etc/nginx/sites-available/writefreely.conf

in a Writefreely tutorial I am attempting to build? I have tried the attached below but it seems not to work when nginx -t is entered. I am working with Debian 12 on my VPS server. Thank you all for helping out an old guy.

server {  
listen 80;  
listen [::]:80;

```
server_name example.com;

gzip on;
gzip_types
  application/javascript
  application/x-javascript
  application/json
  application/rss+xml
  application/xml
  image/svg+xml
  image/x-icon
  application/vnd.ms-fontobject
  application/font-sfnt
  text/css
  text/plain;
gzipminlength 256;
gzipcomplevel 5;
gziphttpversion 1.1;
gzipvary on;

location ~ ^/.well-known/(webfinger|nodeinfo|host-meta) {
    proxysetheader Host 

```

remoteaddr;  
proxysetheader X-Forwarded-For $remoteaddr;  
proxypass [http://127.0.0.1:8080](http://127.0.0.1:8080);  
proxyredirect off;  
}

```
location ~ ^/(css|img|js|fonts)/ {
    root /srv/writefreely/yourdomain.com/static;
    # Optionally cache these files in the browser:
    # expires 12M;
}

location / {
    proxysetheader Host 

```

remoteaddr;  
proxysetheader X-Forwarded-For $remoteaddr;  
proxypass [http://127.0.0.1:8080](http://127.0.0.1:8080);  
proxyredirect off;  
}  
}

---

<div class="post-metadata">

**Author:** ![Crow](https://discuss.write.as/user_avatar/discuss.write.as/crow/32/3736_2.png) [@Crow](https://discuss.write.as/u/Crow)\
**Post date:** [March 5, 2025, 2:39am UTC](https://discuss.write.as/t/publishing-code/11936/5 "2025-03-05T02:39:35Z")

</div>

Thanks, I finally got it. I had not been familiar with Markdown. Thank you for taking the time and sorry to have been so late getting back to you

---

<div class="post-metadata">

**Author:** ![Crow](https://discuss.write.as/user_avatar/discuss.write.as/crow/32/3736_2.png) [@Crow](https://discuss.write.as/u/Crow)\
**Post date:** [March 7, 2025, 7:59pm UTC](https://discuss.write.as/t/publishing-code/11936/6 "2025-03-07T19:59:53Z")

</div>

I have changed it so that it is front and center. Enjoy.
