Skip to content

Latest commit

聽

History

History
63 lines (40 loc) 路 2.1 KB

File metadata and controls

63 lines (40 loc) 路 2.1 KB

English | 涓枃

Deno-Fresh Serverless Blog Application Demo

A blog application deployable on serverless platforms, built with Deno-Fresh. See my own blog

Features

  • Blog reading experience by embedding static HTML pages (static pages should be exported from Markdown editors like Typora or VSCode)
  • Preloading resources during deployment鈥攇enerates a blog index upon initial deployment to improve retrieval performance and reduce data traffic
  • Search functionality for blog posts

How to Use

  1. You should include Front-Matter metadata at the beginning of your Markdown blog posts. The format is as follows:

    --- 
    title: Why Is the Sky Blue? 馃く 
    time: 20251125 
    keywords: [common sense, natural science, universe, physics] 
    preface: This article explains from a scientific perspective why the Earth's sky appears blue, relating directly to sunlight wavelengths and Rayleigh scattering... 
    ---
    
  2. When exporting to HTML, configure your Markdown editor to embed the Front-Matter text within meta tags in the html-head. Common Markdown editors like Typora offer such functionality.

  3. These blog HTML files should be stored in the location: ./data/{language}/{blog_name}/{blog_name.html}. If you are not using an image hosting service, you can store your images in the {blog_name}folder.

  4. Before running the blog application, execute:

    deno task build

    This will run the command configured in deno.json:

    {
        ...
        "tasks": {
            "build": "deno run -A dev.ts build && deno run -A build.ts zh",
        },
        ...
    }

    In build.ts, a directory index will be generated for all current blog posts.

  5. Run the following command to start the blog application:

    deno run -A main.ts

Deployment

It is recommended to deploy this application for free on Deno's official Deno Deploy. No additional workflow configuration is needed鈥攕imply link to your GitHub repository, and it will work seamlessly.