Include header and footer, and nginx config.

This commit is contained in:
Leonora Tindall 2022-09-20 11:44:33 -05:00
parent 338e22dc69
commit 3f008be16c
3 changed files with 85 additions and 2 deletions

View File

@ -1,3 +1,38 @@
# Markdown @Edge
# Markdown@Edge
A Markdown renderer on the Compute @Edge platform from Fastly!
A Markdown renderer on the Compute@Edge platform from Fastly.
The main source file, `src/main.rs`, contains all the code for the renderer.
The header and footer files I use are included at `content/_header.md` and
`content/_footer.md` for easy inspection.
## Nginx Configuration
In order to best support this application, it's important to add the following
line to Nginx's MIME types configuration:
```text
text/markdown md;
```
I also disabled gzip and set the max-age and cache-control headers as follows:
```nginx
server {
# ...
location /edgeblog {
# To illustrate the source to visitors.
autoindex on;
autoindex_exact_size off;
autoindex_format html;
autoindex_localtime on;
# To facilitate tagging.
gzip off;
# Cache-Control headers
expires 1h;
add_header Cache-Control "public";
}
}
```

10
content/_footer.md Normal file
View File

@ -0,0 +1,10 @@
---
<h5>
Created by [Leonora Tindall](./author.md)
| [Code](https://git.nora.codes/nora/edgeblog)
| [Blog](https://nora.codes)
| [Fastly](https://fastly.com)
</h5>

38
content/_header.md Normal file
View File

@ -0,0 +1,38 @@
<style>
body {
max-width: 600px;
margin-left: auto;
margin-right: auto;
}
h1, h2, h3, h4, h5, h6 {
text-align: center;
}
h1 a {
text-decoration: none;
color: black;
font-weight: bold;
}
img {
margin-left: auto;
margin-right: auto;
margin-top: 2px;
margin-bottom: 8px;
aspect-ratio: attr(width) / attr(height);
}
img[alt="A diagram showing the difference in pipeline between normal websites with a CDN and this monstrosity"] {
width: 582px;
height: 521px;
}
</style>
<title>Markdown@Edge</title>
<a href="/"><h1>Markdown@Edge</h1></a>
---