สถานที่ตั้ง jekyll hugo astro word markdown

Word to Static Site Generator: แปลงเอกสารสําหรับ Jekyll, Hugo, และ Astro

วิธีการแปลงเอกสาร Word เป็น Markdown สําหรับการสร้างเว็บไซต์แบบสแตติก เช่น Jekyll, Hugo, Astro, และ Eleventy. รวมถึงหน้าหน้า, โครงสร้างไฟล์, และคําแนะนําการนําไปใช้งาน

W
WordToMD ทีม
·

เครื่องสร้างเว็บไซต์แบบสแตติก (SSG) เช่น Jekyll, Hugo, Astro, และ Eleventy ใช้ไฟล์ Markdown ในการสร้างเว็บไซต์ หากทีมงานเนื้อหาของคุณเขียนใน Word การแปลงเนื้อหานั้นเป็น Markdown เป็นขั้นตอนแรกที่สําคัญ คู่มือนี้ครอบคลุม Word ไปยังเว็บไซต์ที่ตั้ง กระบวนการทํางาน

กระบวนการทํางานหลัก

Word (.docx) → Markdown (.md) → SSG build → HTML website

แต่ละลูกศรคือการเปลี่ยนแปลง

  1. WordToMD เปลี่ยนแปลง .docx → .md
  2. ระบบสร้าง SSG ของคุณอ่าน .md และสร้าง HTML
  3. CDN หรือแพลตฟอร์มโฮสติ้ง ให้บริการ HTML

การเพิ่มประเด็นหน้า

เครื่องผลิตสถานที่สแตติกต้องการ หน่วยงาน YAML ในด้านบนของแต่ละไฟล์ Markdown หลังจากการแปลงกับ WordToMD, เพิ่มบล็อคหน้าหน้าก่อนเนื้อหา:

เจคิลล์ / 11

---
layout: post
title: "Your Document Title"
date: 2026-05-25
categories: [tutorial, documentation]
tags: [word, markdown]
permalink: /blog/your-document/
---

ฮูโก้

---
title: "Your Document Title"
date: 2026-05-25
draft: false
tags: ["tutorial", "documentation"]
slug: "your-document"
---

Astro

---
title: "Your Document Title"
date: 2026-05-25
description: "A brief description for SEO."
tags: ["tutorial", "documentation"]
draft: false
---

การจัดทําไฟล์

SSG คาดว่าไฟล์เนื้อหาในรายการเฉพาะ:

SSGรายการโพสต์บล็อก
เจคิลล์_posts/ (ชื่อไฟล์: YYYY-MM-DD-slug.md)
ฮูโก้content/posts/
Astrosrc/content/blog/
11ไดเรคทอรี่ใด ๆ ที่คุณตั้งค่า
Next.jscontent/ or posts/ (ขึ้นอยู่กับการตั้งค่า)

สอดคล้องกับชื่อไฟล์ของเอสเอสจีของคุณ เจคิลล์คือคนที่เข้มข้นที่สุด 2026-05-25-word-to-static-site.md.

หัวข้อและโครงสร้างเนื้อหา

การแสดง SSGs # Heading 1 เป็นหัวข้อหลักของหน้า ตั้งแต่ title หน้าแรกของสนามนี้กําหนดชื่อหน้าแล้ว ใช้ H2 (##) เป็นหัวข้อที่มีเนื้อหาระดับสูงสุดของคุณ และหลีกเลี่ยง H1 ในร่างกาย

ก่อนการแปลง ตรวจสอบว่าเอกสาร Word ของคุณใช้ Heading 1 เพียงสําหรับหัวข้อเอกสาร และ Heading 2 สําหรับส่วนใหญ่ ดู Markdown คู่มือหัวข้อ สําหรับรายละเอียด

รูปภาพในเว็บไซต์สแตติก

รูปภาพจากเอกสาร Word ต้องเป็น:

  1. ส่งออกจาก Word (Save As → Web Page สําเนาภาพเข้าโฟลเดอร์)
  2. ส่งไปในรายการทรัพย์สินสติกของ SSG ของคุณ (e.g, public/images/ สําหรับ Astro/Next.js assets/images/ สําหรับ Jekyll)
  3. หมายใน Markdown:
![Diagram description](/images/diagram.png)

ตาราง

Word ตารางแปลงเป็น GFM syntax ผ่าน WordToMD. All major SSGs render GFM tables. See Markdown ตาราง: คู่มือที่ครบวงจร.

โค้ดบล็อค

สําหรับเอกสารทางเทคนิค ใช้บล็อคโค้ดที่ติดกั้น พร้อมตัวจําแนกภาษาสําหรับการระบุการประโยค:

```python
def convert_document(filepath):
    with open(filepath, 'rb') as f:
        return mammoth.convert_to_markdown(f).value

See [Markdown Code Blocks Guide](/blog/markdown-code-blocks-guide) for all supported languages.

## Validating Markdown Before Build

Before running your SSG build, validate your converted Markdown:

- **markdownlint** — Checks for style consistency and errors
- **Vale** — Prose linting for technical writing
- **Your SSG's dev server** — The fastest way; run `hugo serve`, `jekyll serve`, or `astro dev` and check the rendered output

## Batch Conversion for Large Content Migrations

If you're migrating an existing Word-based content library to an SSG:

1. Use [WordToMD](/#converter) for individual files
2. For dozens of files, see [Batch Convert Word to Markdown](/blog/batch-convert-word-to-markdown) for command-line tools
3. Write a script to add frontmatter and rename files to your SSG's convention

A Python or Node.js script can automate the frontmatter injection after batch conversion.

## SSG-Specific Tips

### Jekyll
- Filename must include the date: `2026-05-25-your-slug.md`
- Use `categories:` for site navigation
- Liquid template tags conflict with certain curly-brace content in Markdown — escape with `{% raw %}...{% endraw %}`

### Hugo
- Hugo has strict frontmatter validation — required fields depend on your theme
- Use `hugo new content/posts/slug.md` to create a properly templated file, then paste converted content

### Astro
- Uses Content Collections with schema validation
- Ensure frontmatter fields match the schema in `src/content/config.ts`
- Astro's MDX support allows components inside Markdown if needed

### Eleventy
- Most flexible SSG — any .md file in any directory is content
- Frontmatter format is configurable (YAML, TOML, JSON)

## FAQ

**Do I need to convert each Word file manually?**
For a few files, manual conversion with [WordToMD](/#converter) is fastest. For a whole content library, [batch conversion](/blog/batch-convert-word-to-markdown) makes more sense.

**My SSG build fails after importing converted Markdown. What's wrong?**
Check for: (1) missing required frontmatter fields, (2) unescaped special characters in frontmatter values, (3) smart quotes in frontmatter strings (replace with straight quotes).

**Can Word documents become MDX files for React-based SSGs?**
Yes. Convert to standard Markdown first, rename to .mdx, then add React component imports at the top if needed. See the basics in [What Is Markdown](/blog/what-is-markdown-guide).

**Which SSG is best for a team that writes in Word?**
If your team is non-technical and writes in Word, a headless CMS (like Contentful or Sanity) with Markdown support may be a better fit than a file-based SSG. The Word → Markdown workflow works well for developers and hybrid teams.

## Conclusion

Static site generators are an excellent home for content that starts in Word. [WordToMD](/#converter) handles the conversion step; your SSG handles the publishing step. Add frontmatter, organize your files per the SSG's conventions, and you have a content pipeline that scales.