《TO 導讀》:一個工程師的成就感未必來自於工作,而是能將專業所學投入生活相互呼應,有所貢獻。媽祖繞境在北港人心中不只是民俗活動,而是從小看到大的成長記憶。一位來自北港的工程師便運用所學,為媽祖繞境架設網站,只要透過手機就能參與媽祖遶境盛事。以下是為作者第一人稱描述。
很久沒來版上 PO 文章了 >"
最近忙著幫忙我們家鄉的活動製作網站,基本上我是屬於義務性幫忙、非官方、沒盈利的自主服務 (XD),每一年的製作這個網站我算是不斷自我突破吧 (疑?),從後端、系統、設計、切版、上稿,我嘗試一個人完成!
話題扯遠了,回到正題,這個網站我要分享的是前、後端以及系統部分,
如果內容不 OK 可以跟我講一下喔!
《 笨港迎媽祖 》網站
從設計開始,我參考了 Material Design 的角度去設計版面以及流程,不過當然的,手機與網頁的表現還是會有些許的差異,但是整體我仍然盡量參考規範XD
PHP 這次我就使用了很潮的 php7,跑起來貌似有變快,因為我的爬蟲變快了,所以整體來說算是很滿意,只是有些 function 需要稍做調整,不過大致上都很健康!
JavaScript 這次主力都在 Google Maps API 的運用。因為三年前我將此地圖資訊與廟會遶境路線做了結合,開啟了我對 Google Maps 運用的熱愛,所以今年也是把他當主力,活動當天沒意外的話,我會結合 GPS 線上定位!
CSS 的部分,我則是使用 compass scss 去實作,javascript 的話則是使用 jQuery 以及一些其他的 lib 實作!因為前後端都自己包辦,所以 Framework(CodeIgniter)我做了一些修改,讓這些靜態 css、javascript code 上 production 時候自動的 merge 以及 minify。
在靜態檔案的處理,我利用 S3 強大的空間功能,將網站的圖檔資源、js、css 都上到 S3 以減少 EC2 的 Loading,所以說,S3 上的 js、css 都是已經 minify 的了,而圖片檔若是遇到大檔案,則利用 TinyPNG 去對圖片做壓縮,然後再上傳到 S3,
對了,以上當然是用程式跑的:)
再來則是 HTML,基本上網站前台都是使用大量的文章以及簡介,所以可以做大量的 cache,然後這部分採用 file cache 而已,雖然我有原本打算使用 Redis 去實作,但是我把記憶體留給 MySQL 了..(我沒開 RDS,MySQL 是上在與 Server 同一台的 EC2)
因為有作 output 的 cache,所以我也順便將 HTML minify 囉,因為做 HTML 的 output cache,所以瀏覽人數的紀錄就不能跑 php 做 +1,所以這部分我使用 Ajax 去實作回傳人氣的紀錄!
最後 SEO,以及相關搜尋的設定,robots.txt、Sitemap 不用講,一定會做,這次我還加入了一點點的 schema、Google AMP、JSON-LD 的結構,這些都是去餵 Search Engine 想吃的菜!
其實過程中我學到很多經驗,也嘗試很多架構,這次我使用 AWS 的服務,主要開了一台東京 t2.micro 的 EC2,以及使用 S3 的服務而已,網頁流量,據我看 GA 的即時人數,最高曾經落在 1900 多人,可能有些頁面是使用 S3 吧,所以都撐得住!
這是目前我個人做過最高流量的網站,相對的也是個人里程碑!
以上是我的經驗、心得分享, 回到做網站初衷,我只是個熱愛故鄉的鄉土文化,想為家鄉盡一分力,利用自己的專長技術,支援這個從小的信仰,如此簡單。
文章有點太長,如果看到這裡的朋友,非常感謝您將它看完,如果大家有想要來北港玩的,倒是可以看看網站內容喔!
若是文章不適合再版上討論的話,可以跟我說一下 >"
有問題或疑問的話,非常歡迎各位討論喔:)
(本文發布於 PTT_Soft Job 版,獲作者 吳政賢 授權刊登轉載, 相關作品 , GitHub 資源 ,圖片來源:,未經授權請勿轉載。)

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

The function of HTML is to define the structure and content of a web page, and its purpose is to provide a standardized way to display information. 1) HTML organizes various parts of the web page through tags and attributes, such as titles and paragraphs. 2) It supports the separation of content and performance and improves maintenance efficiency. 3) HTML is extensible, allowing custom tags to enhance SEO.

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

Dreamweaver Mac version
Visual web development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function