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

Config : Airtable.s + Node for dynamic content importing #50

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
3d16eb1
Add airtable dependency, along with new package and package-lock file…
pkane Nov 16, 2023
762a64a
Swap require import for Airtable.js CDN import
curt-mitch-census Nov 16, 2023
cd67fac
Add Curtis Airtable API token
curt-mitch-census Nov 16, 2023
4145e9a
Update base ID
curt-mitch-census Nov 16, 2023
26fc195
Updates to API to get first 6 records of site content
curt-mitch-census Nov 16, 2023
cc80724
Create xdContent object from record fields. Render test data to 'more…
pkane Nov 17, 2023
0646e96
Separate the content and markup creation logic. Create separate condi…
pkane Nov 17, 2023
d4d2420
Test parsing of image content, adding image tags to page.
pkane Nov 21, 2023
0441f45
Merge branch 'master' into at-integration-curtis
pkane Nov 27, 2023
e31ad79
Create node script to read from airtable, write cache json file from …
pkane Nov 27, 2023
0b324dc
Merge branch 'master' of github.com:XDgov/xd.gov into at-integration-…
pkane Nov 28, 2023
367b75a
Create structure for generating markup and writing to news, bios mark…
pkane Nov 28, 2023
cce4276
Use deepCompare function to compare to cache, handle accordingly
pkane Nov 28, 2023
de1f12f
Remove test js from javascript include file
pkane Nov 28, 2023
57a5099
Cleanup logs
pkane Nov 28, 2023
dfbe1f0
Restore master version of home and apply page files.
pkane Nov 28, 2023
712af6e
Create workflow folder and test airtable action
pkane Nov 29, 2023
0366c46
Gemfile lockfile update platforms list
pkane Nov 29, 2023
24092c2
Restore liquid dependency version. Rename airtable action
pkane Nov 29, 2023
d8015f9
Add npm install step to actions
pkane Nov 29, 2023
94350ef
Update airtable.yml
ian-gov Nov 29, 2023
adc8c55
Update airtable.js
ian-gov Nov 29, 2023
fd8164d
Update config file to build from new import collections files. Update…
pkane Nov 29, 2023
64a561c
Merge branch 'at-integration-curtis' of github.com:XDgov/xd.gov into …
pkane Nov 29, 2023
9de6e7f
Adjust markup concatenation in string literal to fix formatting issue…
pkane Nov 30, 2023
ddb8510
Updated cache and markdown files
pkane Nov 30, 2023
f0630b5
Create new layout type for bios. Add simple grid styling.
pkane Nov 30, 2023
ddb6a8d
Restore private key lookup
pkane Nov 30, 2023
ad47270
Update workflow to create new pr after building
pkane Dec 8, 2023
6fc0a3d
Replace pr step with CPR marketplace action
pkane Dec 8, 2023
f234501
Update gitignore with vendor and .bundle folders
pkane Dec 8, 2023
e0714a0
Create new news landing layout type, update config
pkane Dec 8, 2023
12355a8
Update airtable script to include image alt attributes. Commit cache …
pkane Dec 8, 2023
23f0e99
Comment out hiring include within new layouts
pkane Dec 11, 2023
05360e6
Cleanup anonymous functions for consistency.
pkane Dec 11, 2023
4d37ac0
leverage object destructuring for cleaner markup construction functions
pkane Dec 11, 2023
4fb425c
Update airtable workflow with named jekyll build step
pkane Dec 11, 2023
3d2ccbc
Update bios and cache file
pkane Dec 11, 2023
4b744d9
Update ruby version
pkane Dec 13, 2023
ffc4563
Refactor object prototype call to use json stringify and array isarray
pkane Dec 13, 2023
1a5adf4
Airtable console comment
pkane Dec 13, 2023
dcb672d
Fix typeof erroneous change
pkane Dec 13, 2023
6213aa0
Liquid dependency version update
pkane Dec 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.3
3.2.2
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source "https://rubygems.org"

# Note: when updating Ruby version update update .ruby-version file as well
# to ensure Cloud.gov environment version of Ruby matches
ruby '3.1.3'
ruby '3.2.2'

# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
Expand Down
5 changes: 3 additions & 2 deletions airtable.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const biosFilePath = './collections/_import/bios.md';

// Utility function we'll use to compare our data
const deepCompare = (arg1, arg2) => {
if (Object.prototype.toString.call(arg1) === Object.prototype.toString.call(arg2)){
if (Object.prototype.toString.call(arg1) === '[object Object]' || Object.prototype.toString.call(arg1) === '[object Array]' ){
if (JSON.stringify(arg1) === JSON.stringify(arg2)){
if (JSON.stringify(arg1) === '[object Object]' || Array.isArray(arg1)){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I should be more explicit for this line since the JSON.stringify method shouldn't ever return '[object Object]'. Here we should probably use typeof like so:

typeof arg1 === 'object'  || Array.isArray(arg1))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, sorry about that! I haphazardly grouped that in with the other changes.

if (Object.keys(arg1).length !== Object.keys(arg2).length ){
return false;
}
Expand Down Expand Up @@ -74,6 +74,7 @@ const generateXdMarkup = (content) => {
}
})

// Keep log for Action debugging
console.log(newsMarkDown, biosMarkdown);
curt-mitch-census marked this conversation as resolved.
Show resolved Hide resolved

return [newsMarkDown, biosMarkdown];
Expand Down
Loading