refactor(media): แยกรูปออกจาก code — รูปทั้งหมดอยู่บน object storage
code อยู่ใน git · รูปอยู่บน SeaweedFS (https://storage.hobbypj.com/hobbypj/alterflixhub/) - อัปโหลด images/ (21 ไฟล์) + og/ (1 ไฟล์) ขึ้น storage แล้วตรวจ sha256 ตรงทุกไฟล์ - แทนที่อ้างอิง 894 จุด ใน 37 ไฟล์: /images/… → <storage>/images/…, /og/… → <storage>/og/… (absolute URL ทุกที่ รวม JSON-LD/og:image/twitter:image และ placeholder ในหลังบ้าน) - ลบ images/ + og/ ออกจาก repo · สำเนาในเครื่องย้ายไป media/ (gitignored) - scripts/media-to-storage.py: สคริปต์ที่ใช้ย้าย (บันทึกวิธี + ใช้ซ้ำได้เมื่อเปลี่ยน base) - scripts/media-sync.py: --check / --upload รูปขึ้น storage (basic auth หรือ SSH tunnel ไป filer) - sw.js: bump v2.1.6 + แคชรูปจาก storage แบบ cache-first (isMedia/mediaCacheFirst) กันออฟไลน์แล้วรูปหาย - docker/traefik-storage-alterflixhub.yml: router เปิดอ่านสาธารณะเฉพาะ /hobbypj/alterflixhub/ (host storage บังคับ Basic auth ทั้ง host — ต้องมี router priority 300 + CORS ก่อน) - docs/media-storage.md: วิธีอัปโหลด/เพิ่มรูป + ข้อกำหนดฝั่ง Traefik - .gitignore/.dockerignore: กัน media/, images/, og/ กลับเข้า repo/image ไอคอน PWA (icon-*.png, favicon.svg) ยังอยู่ใน repo — ต้อง same-origin ให้ติดตั้ง PWA ได้
This commit is contained in:
1 parent
bc0e7a963e
commit
ddfb0a5053
67 files changed
+442
-104
No files matched your search
@@ -1 +1 @@
|
||||
var e={name:`AlterFlixHub`,title:`AlterFlixHub — โรงหนังอิสระ อาร์ตเฮาส์ และกลุ่มคนฉายหนังในไทย`,description:`รวมโรงหนังอิสระและอาร์ตเฮาส์ในประเทศไทยไว้ที่เดียว พร้อมที่ตั้ง วิธีเดินทาง สิ่งอำนวยความสะดวก และปุ่มหาภาพยนตร์โรงใกล้ฉัน`,locale:`th_TH`,ogImage:`/og/alterflixhub-1200x630.png`,staticPages:[{path:`/`,priority:`1.0`,changeFrequency:`daily`},{path:`/for-film-lovers`,priority:`0.7`,changeFrequency:`monthly`},{path:`/for-cinemas`,priority:`0.7`,changeFrequency:`monthly`},{path:`/about`,priority:`0.5`,changeFrequency:`yearly`}]};function t(e,t){let n=t.startsWith(`/`)?t:`/${t}`;return`${e.replace(/\/+$/,``)}${n}`}function n(e){if(!e)return``;for(let t of e){let e=t.data;if(typeof e?.siteUrl==`string`&&e.siteUrl!==``)return e.siteUrl}return``}function r({origin:n,title:r,description:i,path:a,type:o=`website`,noIndex:s=!1}){let c=t(n,a),l=t(n,e.ogImage);return[{title:r},{name:`description`,content:i},{name:`robots`,content:s?`noindex, nofollow`:`index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1`},{tagName:`link`,rel:`canonical`,href:c},{property:`og:type`,content:o},{property:`og:site_name`,content:e.name},{property:`og:locale`,content:e.locale},{property:`og:title`,content:r},{property:`og:description`,content:i},{property:`og:url`,content:c},{property:`og:image`,content:l},{property:`og:image:width`,content:`1200`},{property:`og:image:height`,content:`630`},{property:`og:image:alt`,content:e.name},{name:`twitter:card`,content:`summary_large_image`},{name:`twitter:title`,content:r},{name:`twitter:description`,content:i},{name:`twitter:image`,content:l}]}function i(n){return[{"script:ld+json":{"@context":`https://schema.org`,"@graph":[{"@type":`WebSite`,"@id":`${n}/#website`,url:`${n}/`,name:e.name,description:e.description,inLanguage:`th-TH`,publisher:{"@id":`${n}/#organization`},potentialAction:{"@type":`SearchAction`,target:`${n}/?q={search_term_string}`,"query-input":`required name=search_term_string`}},{"@type":`Organization`,"@id":`${n}/#organization`,name:e.name,url:`${n}/`,logo:t(n,`/icon-512.png`)}]}}]}function a(e,n){return[{"script:ld+json":{"@context":`https://schema.org`,"@type":`BreadcrumbList`,itemListElement:n.map((n,r)=>({"@type":`ListItem`,position:r+1,name:n.name,item:t(e,n.path)}))}}]}function o(e){let n=e.image&&e.image.trim()!==``?e.image:null;return[{"script:ld+json":{"@context":`https://schema.org`,"@type":`MovieTheater`,name:e.name,description:e.description,url:t(e.origin,e.path),...n?{image:n.startsWith(`http`)?n:t(e.origin,n)}:{},...e.coordinates?{geo:{"@type":`GeoCoordinates`,latitude:e.coordinates.latitude,longitude:e.coordinates.longitude}}:{},address:{"@type":`PostalAddress`,addressCountry:`TH`,...e.locationLabel?{streetAddress:e.locationLabel}:{}},...e.mapUrl?{hasMap:e.mapUrl}:{}}}]}function s(n){return[{"script:ld+json":{"@context":`https://schema.org`,"@type":`Article`,headline:n.headline,description:n.description,inLanguage:`th-TH`,mainEntityOfPage:t(n.origin,n.path),author:{"@type":`Organization`,name:e.name},publisher:{"@type":`Organization`,name:e.name}}}]}export{r as a,n as i,a as n,i as o,o as r,e as s,s as t};
|
||||
var e={name:`AlterFlixHub`,title:`AlterFlixHub — โรงหนังอิสระ อาร์ตเฮาส์ และกลุ่มคนฉายหนังในไทย`,description:`รวมโรงหนังอิสระและอาร์ตเฮาส์ในประเทศไทยไว้ที่เดียว พร้อมที่ตั้ง วิธีเดินทาง สิ่งอำนวยความสะดวก และปุ่มหาภาพยนตร์โรงใกล้ฉัน`,locale:`th_TH`,ogImage:`https://storage.hobbypj.com/hobbypj/alterflixhub/og/alterflixhub-1200x630.png`,staticPages:[{path:`/`,priority:`1.0`,changeFrequency:`daily`},{path:`/for-film-lovers`,priority:`0.7`,changeFrequency:`monthly`},{path:`/for-cinemas`,priority:`0.7`,changeFrequency:`monthly`},{path:`/about`,priority:`0.5`,changeFrequency:`yearly`}]};function t(e,t){let n=t.startsWith(`/`)?t:`/${t}`;return`${e.replace(/\/+$/,``)}${n}`}function n(e){if(!e)return``;for(let t of e){let e=t.data;if(typeof e?.siteUrl==`string`&&e.siteUrl!==``)return e.siteUrl}return``}function r({origin:n,title:r,description:i,path:a,type:o=`website`,noIndex:s=!1}){let c=t(n,a),l=t(n,e.ogImage);return[{title:r},{name:`description`,content:i},{name:`robots`,content:s?`noindex, nofollow`:`index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1`},{tagName:`link`,rel:`canonical`,href:c},{property:`og:type`,content:o},{property:`og:site_name`,content:e.name},{property:`og:locale`,content:e.locale},{property:`og:title`,content:r},{property:`og:description`,content:i},{property:`og:url`,content:c},{property:`og:image`,content:l},{property:`og:image:width`,content:`1200`},{property:`og:image:height`,content:`630`},{property:`og:image:alt`,content:e.name},{name:`twitter:card`,content:`summary_large_image`},{name:`twitter:title`,content:r},{name:`twitter:description`,content:i},{name:`twitter:image`,content:l}]}function i(n){return[{"script:ld+json":{"@context":`https://schema.org`,"@graph":[{"@type":`WebSite`,"@id":`${n}/#website`,url:`${n}/`,name:e.name,description:e.description,inLanguage:`th-TH`,publisher:{"@id":`${n}/#organization`},potentialAction:{"@type":`SearchAction`,target:`${n}/?q={search_term_string}`,"query-input":`required name=search_term_string`}},{"@type":`Organization`,"@id":`${n}/#organization`,name:e.name,url:`${n}/`,logo:t(n,`/icon-512.png`)}]}}]}function a(e,n){return[{"script:ld+json":{"@context":`https://schema.org`,"@type":`BreadcrumbList`,itemListElement:n.map((n,r)=>({"@type":`ListItem`,position:r+1,name:n.name,item:t(e,n.path)}))}}]}function o(e){let n=e.image&&e.image.trim()!==``?e.image:null;return[{"script:ld+json":{"@context":`https://schema.org`,"@type":`MovieTheater`,name:e.name,description:e.description,url:t(e.origin,e.path),...n?{image:n.startsWith(`http`)?n:t(e.origin,n)}:{},...e.coordinates?{geo:{"@type":`GeoCoordinates`,latitude:e.coordinates.latitude,longitude:e.coordinates.longitude}}:{},address:{"@type":`PostalAddress`,addressCountry:`TH`,...e.locationLabel?{streetAddress:e.locationLabel}:{}},...e.mapUrl?{hasMap:e.mapUrl}:{}}}]}function s(n){return[{"script:ld+json":{"@context":`https://schema.org`,"@type":`Article`,headline:n.headline,description:n.description,inLanguage:`th-TH`,mainEntityOfPage:t(n.origin,n.path),author:{"@type":`Organization`,name:e.name},publisher:{"@type":`Organization`,name:e.name}}}]}export{r as a,n as i,a as n,i as o,o as r,e as s,s as t};
|
||||
Reference in new issue
Block a user