sass-template-common 0.9.20 → 0.9.21

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.
@@ -445,6 +445,7 @@ export declare type Config = {
445
445
  useS3Font: boolean;
446
446
  fontName: string;
447
447
  fontWeight: string;
448
+ fontDisplay: 'swap' | 'block' | 'fallback' | 'optional';
448
449
  useSpeculationRules: boolean;
449
450
  googleFontFamily: string;
450
451
  sideCopyright: string;
@@ -1532,7 +1532,7 @@ const Br = async ({
1532
1532
  font-family: '${e.fontName}';
1533
1533
  font-style: normal;
1534
1534
  font-weight: ${e.fontWeight};
1535
- font-display: swap;
1535
+ font-display: ${e.fontDisplay ?? "swap"};
1536
1536
  src: url("${e.fontS3Url}") format('woff2');
1537
1537
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
1538
1538
  }
@@ -1553,7 +1553,7 @@ const Br = async ({
1553
1553
  "link",
1554
1554
  {
1555
1555
  rel: "stylesheet",
1556
- href: `https://fonts.googleapis.com/css2?${e.googleFontFamily}&display=swap`
1556
+ href: `https://fonts.googleapis.com/css2?${e.googleFontFamily}&display=${e.fontDisplay ?? "swap"}`
1557
1557
  }
1558
1558
  ) });
1559
1559
  }, Gn = {
@@ -14,11 +14,11 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
14
14
  font-family: '${e.fontName}';
15
15
  font-style: normal;
16
16
  font-weight: ${e.fontWeight};
17
- font-display: swap;
17
+ font-display: ${e.fontDisplay??"swap"};
18
18
  src: url("${e.fontS3Url}") format('woff2');
19
19
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
20
20
  }
21
- `;return s.jsx(s.Fragment,{children:e.useS3Font?s.jsxs(s.Fragment,{children:[s.jsx("link",{rel:"preload",as:"font",href:e.fontS3Url,type:"font/woff2",crossOrigin:"anonymous"}),s.jsx("style",{dangerouslySetInnerHTML:{__html:t}})]}):s.jsx("link",{rel:"stylesheet",href:`https://fonts.googleapis.com/css2?${e.googleFontFamily}&display=swap`})})},as={404:()=>{},home:()=>({"[author_replace]":"","[section_replace]":"home","[tag_replace]":"","[url_replace]":""}),slug:e=>({"[author_replace]":"","[section_replace]":e.pathname==="/index.html"?"home":e.slug??"","[tag_replace]":"","[url_replace]":""}),news:e=>({"[author_replace]":e.currentNew?.authors[0]?.name??"","[section_replace]":e.currentNew?.info?.section?.slug??"","[tag_replace]":Xt(e.currentNew?.keywords),"[url_replace]":ha(e.internalPath??"")}),seccion:e=>({"[author_replace]":"","[section_replace]":e.pathname?.split("/"+e.config?.paths.seccion+"/")[1]??"","[tag_replace]":"","[url_replace]":""}),tema:e=>({"[author_replace]":"","[section_replace]":e.pathname?.split("/"+e.config?.paths.tema+"/")[1]??"","[tag_replace]":"","[url_replace]":""}),"ultimas-noticias":e=>({"[author_replace]":"","[section_replace]":e.config?.paths["ultimas-noticias"]??"","[tag_replace]":"","[url_replace]":""}),video:e=>({"[author_replace]":"","[section_replace]":e.slug,"[tag_replace]":"","[url_replace]":""}),videos:e=>({"[author_replace]":"","[section_replace]":e.pathname?.split("/videos/")[1]??"","[tag_replace]":"","[url_replace]":""}),pages:e=>({"[author_replace]":"","[section_replace]":e.slug??"","[tag_replace]":"","[url_replace]":""}),auth:e=>({"[author_replace]":"","[section_replace]":e.slug??"","[tag_replace]":"","[url_replace]":""}),contacto:e=>({"[author_replace]":"","[section_replace]":e.config?.paths.contacto??"contacto","[tag_replace]":"","[url_replace]":""}),anuncia:e=>({"[author_replace]":"","[section_replace]":e.config?.paths.anuncia??"anuncia","[tag_replace]":"","[url_replace]":""}),buscar:e=>({"[author_replace]":"","[section_replace]":e.config?.paths.buscar??"","[tag_replace]":"","[url_replace]":""}),autor:e=>({"[author_replace]":"","[section_replace]":e.pathname?.split("/"+e.config?.paths.autor+"/")[1]??"","[tag_replace]":"","[url_replace]":""})},Ta=e=>{if(!e)return e??"";if(e.search("/page/")===-1)return e.replace("/","");const t=e.split("/"),a=t.indexOf("page")-1;return a<0?e:(t[a]??"").replace("/","")},pe=e=>{const a=e.replace(/^\/|\/$/g,"").split("/"),n=a.indexOf("page");return n>0?`${a[n-1]??""}`:`${a[a.length-1]??""}`},xa={404:()=>"404",home:()=>"home",slug:e=>pe(e.pathname),news:e=>da(e.pathname)?.slug,seccion:e=>pe(e.pathname),tema:e=>pe(e.pathname),pages:e=>pe(e.pathname),auth:e=>pe(e.pathname),buscar:e=>pe(e.pathname),"ultimas-noticias":e=>pe(e.pathname),anuncia:e=>pe(e.pathname),contacto:e=>pe(e.pathname),autor:e=>pe(e.pathname),video:e=>pe(e.pathname),videos:e=>pe(e.pathname)},Xe=e=>{const t=e.split("/"),a=t[t.length-1]??"1";return Number(a)>0?Number(a):1},yo=(e,t=2)=>{if(!e||e.length===0)return[];const a=[];for(let n=0;n<t;n++){if(!e[n]||!e[n].preview)continue;const r=e[n].preview?.sizes;r&&(r.length>1?a.push({href:r[0]?.url??"",media:"(min-width: 900px)"},{href:r[1]?.url??"",media:"(max-width: 900px)"}):a.push({href:r[0]?.url??""}))}return a},Co=e=>{try{return JSON.stringify(e,null,2)}catch{return String(e)}},No=e=>{const{SERVICE_DEBUG:t,PUBLIC_API_HOST:a,PUBLIC_ENV:n,PUBLIC_PUBLICATION_ID:r}=G(),o=new Date().toISOString(),i=t?.projectName??"";return`<!doctype html>
21
+ `;return s.jsx(s.Fragment,{children:e.useS3Font?s.jsxs(s.Fragment,{children:[s.jsx("link",{rel:"preload",as:"font",href:e.fontS3Url,type:"font/woff2",crossOrigin:"anonymous"}),s.jsx("style",{dangerouslySetInnerHTML:{__html:t}})]}):s.jsx("link",{rel:"stylesheet",href:`https://fonts.googleapis.com/css2?${e.googleFontFamily}&display=${e.fontDisplay??"swap"}`})})},as={404:()=>{},home:()=>({"[author_replace]":"","[section_replace]":"home","[tag_replace]":"","[url_replace]":""}),slug:e=>({"[author_replace]":"","[section_replace]":e.pathname==="/index.html"?"home":e.slug??"","[tag_replace]":"","[url_replace]":""}),news:e=>({"[author_replace]":e.currentNew?.authors[0]?.name??"","[section_replace]":e.currentNew?.info?.section?.slug??"","[tag_replace]":Xt(e.currentNew?.keywords),"[url_replace]":ha(e.internalPath??"")}),seccion:e=>({"[author_replace]":"","[section_replace]":e.pathname?.split("/"+e.config?.paths.seccion+"/")[1]??"","[tag_replace]":"","[url_replace]":""}),tema:e=>({"[author_replace]":"","[section_replace]":e.pathname?.split("/"+e.config?.paths.tema+"/")[1]??"","[tag_replace]":"","[url_replace]":""}),"ultimas-noticias":e=>({"[author_replace]":"","[section_replace]":e.config?.paths["ultimas-noticias"]??"","[tag_replace]":"","[url_replace]":""}),video:e=>({"[author_replace]":"","[section_replace]":e.slug,"[tag_replace]":"","[url_replace]":""}),videos:e=>({"[author_replace]":"","[section_replace]":e.pathname?.split("/videos/")[1]??"","[tag_replace]":"","[url_replace]":""}),pages:e=>({"[author_replace]":"","[section_replace]":e.slug??"","[tag_replace]":"","[url_replace]":""}),auth:e=>({"[author_replace]":"","[section_replace]":e.slug??"","[tag_replace]":"","[url_replace]":""}),contacto:e=>({"[author_replace]":"","[section_replace]":e.config?.paths.contacto??"contacto","[tag_replace]":"","[url_replace]":""}),anuncia:e=>({"[author_replace]":"","[section_replace]":e.config?.paths.anuncia??"anuncia","[tag_replace]":"","[url_replace]":""}),buscar:e=>({"[author_replace]":"","[section_replace]":e.config?.paths.buscar??"","[tag_replace]":"","[url_replace]":""}),autor:e=>({"[author_replace]":"","[section_replace]":e.pathname?.split("/"+e.config?.paths.autor+"/")[1]??"","[tag_replace]":"","[url_replace]":""})},Ta=e=>{if(!e)return e??"";if(e.search("/page/")===-1)return e.replace("/","");const t=e.split("/"),a=t.indexOf("page")-1;return a<0?e:(t[a]??"").replace("/","")},pe=e=>{const a=e.replace(/^\/|\/$/g,"").split("/"),n=a.indexOf("page");return n>0?`${a[n-1]??""}`:`${a[a.length-1]??""}`},xa={404:()=>"404",home:()=>"home",slug:e=>pe(e.pathname),news:e=>da(e.pathname)?.slug,seccion:e=>pe(e.pathname),tema:e=>pe(e.pathname),pages:e=>pe(e.pathname),auth:e=>pe(e.pathname),buscar:e=>pe(e.pathname),"ultimas-noticias":e=>pe(e.pathname),anuncia:e=>pe(e.pathname),contacto:e=>pe(e.pathname),autor:e=>pe(e.pathname),video:e=>pe(e.pathname),videos:e=>pe(e.pathname)},Xe=e=>{const t=e.split("/"),a=t[t.length-1]??"1";return Number(a)>0?Number(a):1},yo=(e,t=2)=>{if(!e||e.length===0)return[];const a=[];for(let n=0;n<t;n++){if(!e[n]||!e[n].preview)continue;const r=e[n].preview?.sizes;r&&(r.length>1?a.push({href:r[0]?.url??"",media:"(min-width: 900px)"},{href:r[1]?.url??"",media:"(max-width: 900px)"}):a.push({href:r[0]?.url??""}))}return a},Co=e=>{try{return JSON.stringify(e,null,2)}catch{return String(e)}},No=e=>{const{SERVICE_DEBUG:t,PUBLIC_API_HOST:a,PUBLIC_ENV:n,PUBLIC_PUBLICATION_ID:r}=G(),o=new Date().toISOString(),i=t?.projectName??"";return`<!doctype html>
22
22
  <html lang="es">
23
23
  <head>
24
24
  <meta charset="utf-8" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sass-template-common",
3
- "version": "0.9.20",
3
+ "version": "0.9.21",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"