Opengraph Settings
OpenGraph is a protocol used by websites to control how their content is displayed when shared on social media platforms and messaging apps.
This section contains notes on updating the thumbnail-like images that appears when sharing the ACAP website URLs in social media like Meta and Twitter.
ACAP only display OpenGraph images on its production website hosted at (GitHub Pages) https://acap-bicol.github.io (opens in a new tab) to differentiate between the development
and production
websites.
OpenGraph / Meta Description
- assets_dev.csv
- Open the
/server/src/scripts/data/assets_dev.csv
file. - Select the row whose
filename
column is equals to"og_home"
.- Replace all
"Bicol"
text with the new region name in it's description column.
- Replace all
OpenGraph Thumbnails
Create New OpenGraph Images
-
Take note of ACAP's public pages. These are pages which do not require login.
- Home Page -
/
(index page) - ACAP Services -
/weather-services
- Cropping Calendar -
/cropping-calendar-v2
- Seasonal / 10-Day Recommendations -
/agroclimatic-services
- Bulletins PDF Download -
/bulletins
- Sesaonal Bulletins PDF Download -
/bulletins/seasonal-outlook
- 10-Day Bulletins PDF Download -
/bulletins/weather
- Special Bulletins PDF Download -
/special-weather-forecast
- Admin Login -
/admin/login
- Superadmin Login -
/superadmin/login
- Home Page -
-
Create
1200 x 600
pixel picture banners for each public page mentioned in step #1. -
(Optional) For reference, you can use ACAP's OpenGraph Photoshop PSD template to create new OpenGraph images. Press the (left) DOWNLOAD button to download the file.
-
A total of ten (10) new thumbnail files should be created, continuing from step #2. Let us use the Region 6 OpenGraph images only as an example to have preview samples of different OpenGraph images for each public page aside from Region 5. Press the (left) DOWNLOAD button to download and view the picture files.
ℹ️These are only examples. Regions can and should use OpenGraph images that match and sync with their regions.
Upload the OpenGraph Images
-
Upload the ten (10) new OpenGraph to an online storage or hosting site, carrying on from Create New OpenGraph Images step #2. The online URLs of region-specific thumbnails should be publicly accessible after upload.
đź’ˇACAP uploaded its OpenGraph images in Firebase Storage.
-
Take note of the images' online URL after upload.
Replace the OpenGraph URLs
- assets_dev.csv
-
Open and edit the
/server/src/scripts/data/assets_dev.csv
CSV file, preferably with Microsoft Excel or other software for editing tabular data, showing a visual overview of tables and columns. -
Replace the URL values under the
url
"CSV" column of the rows whosepage
column values are"og"
and whosefilename
column content starts with"og_"
prefix with the new OpenGraph image URLs from Upload the OpenGraph Images - step #2⚠️Refer to the format, content, and structure of the
/server/src/scripts/data/assets_dev.csv
CSV file when replacing values.filename page name public page route og_home Home Page /
og_services ACAP Services /weather-services
og_calendar Cropping Calendar /cropping-calendar-v2
og_recommendations Seasonal / 10-Day Recommendations /agroclimatic-services
og_bulletins Bulletins PDF Download /bulletins
og_bulletins_10day 10-Day Bulletins PDF Download /bulletins/weather
og_bulletins_seasonal Sesaonal Bulletins PDF Download /bulletins/seasonal-outlook
og_bulletins_typhoon Special Bulletins PDF Download /special-weather-forecast
og_admin Admin Login /admin/login
og_superadmin Superadmin Login /superadmin/login
Upload the New OpenGraph URLs
Upload the new OpenGraph URLs (in the assets_dev.csv
CSV file) to the development
and production
Firestore database.
- Update the server
.env
file with the production Firebase variables:FIREBASE_SERVICE_ACC
andFIREBASE_PRIVATE_KEY
. - Run the server NPM script:
npm run seed:11_assets
- Update the server
.env
file with the development Firebase variables:FIREBASE_SERVICE_ACC
andFIREBASE_PRIVATE_KEY
. - Re-run the NPM script on step #2.
- Deploy to theÂ
production
 environment (after deploying first to theÂdevelopment
 environment since this is part of the deployment process) to view the updates on the live production site.
Confirm the New OpenGraph Images
-
Load the
production
website on a browser tab after successfully deploying to the production environment on the Upload the New OpenGraph URLs - step #5. -
Inspect the web page elements by right-clicking on the page and then selecting the Inspect option.
-
Look for the
<meta>
propertyproperty="og:image"
under the<head>
tag. Itscontent
attribute should contain the OpenGraph image URL encoded in theassets_dev.csv
CSV file. For example:<meta property="og:image" content="https://firebasestorage.googleapis.com/v0/b/amia-cis-dev.appspot.com/o/media%2Fimages%2Fopengraph%2F1200x600%2Fog_home_1200.png?alt=media&token=51f9241c-45da-456e-9906-677c2f8fe93a">
-
Share one of the public web pages in social media, for example, in a Meta (Facebook) post. Observe if the new Opengraph thumbnails are visible.
đź’ˇNew OpenGraph thumbnails may take some time to display the latest pictures from some image hosting providers, such as Firebase Storage, depending on its server settings for
maxAge
in seconds, even if its new OpenGrapgh image URL is already visible in the<meta>
tag from step #3.