dbm-graph-api 1.1.23 → 1.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dbm-graph-api",
3
- "version": "1.1.23",
3
+ "version": "1.1.24",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -13,7 +13,7 @@
13
13
  "dependencies": {
14
14
  "@aws-sdk/client-s3": "^3.741.0",
15
15
  "@aws-sdk/s3-request-presigner": "^3.741.0",
16
- "dbm": "^1.1.18",
16
+ "dbm": "^1.1.19",
17
17
  "mime": "^4.0.6",
18
18
  "sharp": "^0.33.5",
19
19
  "ws": "^8.18.0"
@@ -763,7 +763,7 @@ export const setupSite = function(aServer) {
763
763
 
764
764
  returnString += `<link rel="stylesheet" type="text/css" href="${assetsUri}css/main.css?version=${version}" />
765
765
 
766
- <link rel="icon" type="image/png" href="${assetsUri}img/favicon.png">`;
766
+ <link rel="icon" type="image/png" href="${baseUrl}${assetsUri}img/favicon.png">`;
767
767
 
768
768
  if(fields['meta/description']) {
769
769
  returnString += `
@@ -779,15 +779,35 @@ export const setupSite = function(aServer) {
779
779
  <meta property="og:url" content="${fullUrl}" />
780
780
  `;
781
781
 
782
+ if(fields["lastModified"]) {
783
+ returnString += `<meta property="article:modified_time" content="${fields["lastModified"]}" />\n`;
784
+ }
785
+
786
+ let image = await urlObject.singleObjectRelationQuery("in:isMainImageFor:image");
787
+ if(image) {
788
+ let imageFields = await image.getFields();
789
+
790
+ if(imageFields["resizeUrl"]) {
791
+ let imageUrl = imageFields["resizeUrl"];
792
+ let scaleString = "width=1200,height=630,fit=cover,format=jpeg";
793
+ imageUrl = imageUrl.split("{scale}").join(scaleString);
794
+
795
+ returnString += `<meta property="og:image" content="${imageUrl}" />\n`;
796
+ returnString += `<meta property="og:image:width" content="1200" />\n`;
797
+ returnString += `<meta property="og:image:height" content="630" />\n`;
798
+ returnString += `<meta property="og:image:type" content="image/jpeg" />\n`;
799
+ returnString += `<meta property="twitter:card" content="summary_large_image" />\n`;
800
+ }
801
+ else {
802
+ let imageUrl = imageFields["url"];
803
+ returnString += `<meta property="og:image" content="${imageUrl}" />\n`;
804
+ returnString += `<meta property="twitter:card" content="summary_large_image" />\n`;
805
+ }
806
+ }
807
+
782
808
  /*
783
809
  <meta property="article:publisher" content="https://sv-se.facebook.com/..." />
784
- <meta property="article:modified_time" content="2024-09-03T13:19:26+00:00" />
785
-
786
- <meta property="og:image" content="https://..." />
787
- <meta property="og:image:width" content="1024" />
788
- <meta property="og:image:height" content="683" />
789
- <meta property="og:image:type" content="image/jpeg" />
790
- <meta name="twitter:card" content="summary_large_image" />
810
+
791
811
  */
792
812
 
793
813
  returnString += `</head>