Frontend for lablog
.
lablog
is the software behind my blog https://zzi.io.
- Clone the repo.
- Create subdirectories:
pages
andposts
for standalone HTML files - Create subdirectory
public
for static resources, such asfavicon.ico
,robots.txt
,sitemap.txt
, etc. - Run
npm install
- Run
npm run dev
for dev server
-
Prior to building frontend static files, make sure
lablog-backend
server is up and running.Because during build process, buildtools will automatically register new posts at the backend, and modify post information at the backend if post has been modified.
The buildtools also need to get the uuid assigned to each new post to track post changes later.
-
Use
lablog-buildtools
to update posts HTML files andsitemap.txt
file.The build tools will also automatically do
npm run build
for you. -
Run
npm run preview
to preview generated dist from local server.
Deployment of lablog
requires both a static file server (frontend server) and a server capable of running python code(backend API server).
However, If only file server is available (for example deploying to Vercel or Cloudfare Pages), we can still deploy the frontend-only version. In that case the homepage and posts will work, but commenting will not work (users cannot view or post comments).
To deploy the frontend, either directly copy files under dist
directly to the file server, or use lablog-buildtools
to deploy.