Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]:: Feature/dyn og img [from custom JSON feed] #852

Draft
wants to merge 78 commits into
base: staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
d41d46a
working og image edge functions
rediris Nov 22, 2022
06bfb80
Update og.tsx
rediris Nov 22, 2022
82ea0f2
Try dynamic imports to resolve netlify build error?
rediris Nov 23, 2022
b827d72
Revert, add log
rediris Nov 23, 2022
f3cd407
OK, try using a non-local webfont URL instead?
rediris Nov 23, 2022
8a29b5a
Working take5 image generation
rediris Nov 28, 2022
651ec38
config JSON
rediris Nov 28, 2022
0637651
Add additional logic for scraping meta
rediris Nov 29, 2022
1983aa5
working dynamic meta title
rediris Nov 29, 2022
3315bf5
Working courses meta (sans workshop)
rediris Nov 29, 2022
69d1615
Adds offset
rediris Nov 29, 2022
66363a2
add domain
rediris Nov 30, 2022
8487bb3
Adds back custom title, support for workshops
rediris Nov 30, 2022
42f5e95
Adds meta data attributes, improved logic
rediris Dec 2, 2022
c273ba7
Use netlify deploy URL
rediris Dec 2, 2022
2b88ede
Update og.tsx
rediris Dec 5, 2022
b18b980
improved bg img size for full/short courses
rediris Dec 5, 2022
506b3a7
update take 5 logic from staging
rediris Dec 12, 2022
5784f27
Add back data_topic
rediris Dec 12, 2022
8b63c92
Update og.tsx
rediris Dec 12, 2022
9bb8ea8
Set default logo size
rediris Dec 13, 2022
9be6b45
Fix localhost error
rediris Jan 11, 2023
f4a9d62
Merge branch 'staging' into feature/dynamic-og
rediris Jan 11, 2023
d041733
Create .nvmrc
rediris Jan 16, 2023
5a41111
Add debugging, footer display
rediris Jan 16, 2023
db7e9c0
support for yaml data files
rediris Jan 18, 2023
5be1889
data file: course_type
rediris Jan 18, 2023
55258be
query local data files only!
rediris Jan 19, 2023
37968dc
Update og.tsx
rediris Jan 20, 2023
9a4d2ad
Add img_bg_color to data
rediris Jan 20, 2023
b947ac7
Try to fix netlify error
rediris Jan 20, 2023
db55742
Fix broken build?
rediris Jan 20, 2023
6780a59
Add included_files to config
rediris Jan 20, 2023
9a8ce47
__root instead of Deno.cwd()
rediris Jan 20, 2023
c6b61e1
Add font to included_files
rediris Jan 20, 2023
023a9ff
Read meta.md files by path
rediris Jan 20, 2023
78fac76
Add testing edge function
rediris Jan 20, 2023
f646a0c
Update test.tsx
rediris Jan 20, 2023
549e3d8
Test: Use deno.readFile
rediris Jan 20, 2023
c2baa28
Update netlify.toml
rediris Jan 20, 2023
8406421
Update test.tsx
rediris Jan 20, 2023
fd5c5db
Update test.tsx
rediris Jan 20, 2023
18dd4cf
Read headers for host name
rediris Jan 20, 2023
a2a6a0c
Disable og function
rediris Jan 20, 2023
f42033f
simplify
rediris Jan 20, 2023
39092be
does it work w/o a font?
rediris Jan 20, 2023
c6e0d1a
Create custom data feed
rediris Jan 20, 2023
141daa1
update local logic
rediris Jan 20, 2023
2a7f19b
home meta image path
rediris Jan 23, 2023
dfad781
remove svg bg img support
rediris Jan 23, 2023
a1df8d2
Working with JSON?
rediris Jan 23, 2023
04054ac
prep take5 data files
rediris Jan 24, 2023
eab32df
Take5s use the hero image, I guess
rediris Jan 24, 2023
c06c24e
better img height calc
rediris Jan 24, 2023
a92eba4
Refactor aspectRatio function
rediris Jan 25, 2023
f3f8836
add static pages to JSON
rediris Jan 25, 2023
f529453
Ignore tests folder
rediris Jan 31, 2023
bf7d99c
Add rudimentary path support
rediris Jan 31, 2023
69c984c
Adds back missing indices
rediris Jan 31, 2023
0ce4ffa
static use og_description
rediris Jan 31, 2023
fbf2f6e
Update og.tsx
rediris Jan 31, 2023
ae14d74
Notes
rediris Jan 31, 2023
9256956
Add offsets
rediris Feb 1, 2023
9ae821b
Remove unused data attr
rediris Feb 1, 2023
3535270
Add take5 border
rediris Feb 1, 2023
6f6d78f
Update og.tsx
rediris Feb 1, 2023
0f0a44a
Add offsets
rediris Feb 1, 2023
e2a8201
take5 font size logic
rediris Feb 1, 2023
6879bd3
cleanup unused config
rediris Feb 2, 2023
6875ae9
add initial layouts
rediris Feb 2, 2023
9c4f7ae
Add additional layout logic
rediris Feb 8, 2023
d5d9726
Update page inclusion logic
rediris Feb 10, 2023
dac1274
DRY logic improvements
rediris Feb 10, 2023
16be936
use liquid extension
rediris Feb 22, 2023
16ee6f4
Use og_gen_data prefix
rediris Feb 22, 2023
352747b
README for /og-image
rediris Mar 6, 2023
4fa95d5
Update README.md
rediris Mar 6, 2023
4f41e49
Add Satori reference
rediris Mar 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -4,3 +4,6 @@ _site/
.jekyll-cache/
.DS_Store
node_modules

# Local Netlify folder
.netlify/state.json
1 change: 1 addition & 0 deletions .netlify/edge-functions-import-map.json
@@ -0,0 +1 @@
{"imports":{"netlify:edge":"https://edge.netlify.com/v1/index.ts"},"scopes":{}}
30 changes: 30 additions & 0 deletions .netlify/functions/README.md
@@ -0,0 +1,30 @@
# Netlify Edge Functions
Below is a list of the edge functions we currently have.

## OG Image Generator

Path: `/og-image`

Accepted parameters:
- `?id=gym-100`
- `?path=courses/take5`

The parameters are used in turn to look up entries in the `/feeds/data.json` file, which provides everything we need to render content specific to each course.

### Layouts
Most layouts are automatically determined by the id or path passed in.

#### Logo only
Visiting `/og-image` without any parameters will display the single column logo only layout.

#### Two-Column Layouts
All courses use a two-column layout.

##### Full & Short Course Layouts
Standard course layouts use a course icon/badge and a hex color value to color the background area behind the icon.

##### Take 5 Tutorial Layouts
Take 5 tutorials are visually different from course layouts, utilizing a custom image and an image offset.

### Additional Documentation
- [Satori](https://github.com/vercel/satori) - documentation on the Satori library, by Vercel. Of particular interest should be the section on permissible CSS.