How athachai29/athachai works
Main Components
• Client (User’s Browser): The entry point that requests pages, assets, and markdown content.
• Static Web Server/Hosting Environment: This is the platform (e.g., GitHub Pages, Netlify, or any static hosting) that serves the content.
• HTML Pages & Routing: The site’s root index.html along with pages in “pages/about” and “pages/articles” folders. Note that the routing mechanism may involve clean URLs without the ".html" extension.
• Markdown Content: Located in the “contents” folder, these markdown files are potentially processed (or directly rendered) via the JavaScript library.
• JavaScript Library (zero-md.js): This library helps in rendering markdown content to HTML in the browser.
• Styling: CSS files in the “styles” folder which dictate the visual presentation (general styles in index.css and specific markdown-related styles in markdown-styles.css).
• Media Assets: The “images” folder, which holds images used for styling, content, or visual content in the website.
Relationships and Interactions Between Components
• The Web Client loads the main index.html from the static hosting server.
• index.html references external stylesheets (the CSS files) and the JS file (zero-md.js) to ensure proper styling and dynamic markdown conversion.
• The user navigates to different sections (such as “about” or “articles”); each section is a separate HTML page with its own content, some pages may use markdown files from the “contents” folder.
• The JavaScript setup (zero-md.js) might dynamically fetch relevant markdown files from “contents” when a corresponding article page is accessed.
• Routing logic ensures the website URLs look clean (using techniques as described in the README reference).
Important Architectural Patterns and Design Principles
• Component Separation: Clearly distinguishing between static assets (HTML, CSS, images, JS) and content (markdown files and page-specific HTML).
• Clean URL Routing: The existence of a CNAME and reference article on URL rewriting to hide ".html" extensions shows web-routing design attention.
• Client-Side Processing: Using a zero-dependency JavaScript library to render markdown on the fly indicates a client-side rendering approach for some content.
• Minimalistic Architecture: Since this is a static website, there is no server-side backend component; everything is pre-generated or processed within the browser.
Relevant Technologies and Frameworks
• HTML, CSS, and JavaScript as the core client-side technologies.
• zero-md.js as the JavaScript library to handle markdown rendering.
• Static hosting (implied by files like CNAME and the simple structure).
• Markdown for content management, enabling writing in a simpler format which is then rendered to HTML.
Details
• Flow: from user request → web server delivery → client-side loading of HTML, CSS, JS → dynamic processing of markdown files.