Skip to content

peterszarvas94/lytepage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lytepage

1. Install

go install github.com/peterszarvas94/lytepage@latest

1. Initialize a new project

lytepage init my-app

2. Write content

content/hello/world.md

---
title: "Amazing article"
---

## Hello world

How awesome this site is!

Learn:

- go
- templ

3. Write template

templ PostPage(post *fileutils.FileData) {
  <h1>
    { post.Matter.Title }
  </h1>
  <div class="markdown-body">
    @fileutils.HtmlString(post.Html)
  </div>
}

4. Generate (for static hosting)

make gen

The generated public/hello/world/index.html:

<h1>Amazing article</h1>
<div class="markdown-body">
	<h2>Hello world!</h2>

	<p>How awesome this site is!</p>

	<p>Learn:</p>

	<ul>
		<li>go</li>
		<li>templ</li>
	</ul>
</div>

5. Run locally

SSR mode:

make ssr

Static mode:

make static

Now localhost:8080/hello/world is serving your content

Dev mode - soon!

About

lytepage - generate static site with go, markdown and templ

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published