Crates.io | texted |
lib.rs | texted |
version | 1.1.1 |
source | src |
created_at | 2024-04-20 21:00:34.982237 |
updated_at | 2024-11-15 04:23:07.576078 |
description | A markdown blog platform that lets you in control of your data |
homepage | https://gitlab.com/thiagomg/texted |
repository | https://gitlab.com/thiagomg/texted |
max_upload_size | |
id | 1214873 |
size | 560,427 |
Why did I create one blog system instead of using some existing blog platform?
Using brew:
brew tap thiagomg/texted
brew install texted
Or using cargo
cargo install texted
# Let's create a new directory for our new blog
mkdir ~/my-awesome-blog && cd ~/my-awesome-blog
# And now create the skeleton of a fully functional blog
texted-tool bootstrap --out-dir .
Now, let's run and test it.
# Inside the same ~/my-awesome-blog directory, run
texted
And open in your browser http://127.0.0.1:8001/
Texted by default caches all urls and posts for best performance. Please quit texted and run again to see new posts in the listing.
If you want to disable rendering cache to see changes in the post content without restarting, change
rendering_cache_enabled = false
in the texted.toml configuration file
# Still inside the same ~/my-awesome-blog directory, run
pushd posts/
# This will create one directory such as 20240428_how_to_write_a_new_blog_post
# with a file index.md inside.
texted-tool post --title "How to write a new blog post" -o dir
# And let's run texted again
popd
texted
You now have a new post available in the post list
How to build?
cargo build --release
How to run?
cargo run --bin texted
You can create your HTML templates using mustache templates. The examples show all supported fields
Templates can have images, css and js, etc. Those support files should live in the public directory
In the file texted.toml
, you can configure the location in the keys:
Posts live in the directory pointed in the configuration key posts_dir
and pages in the key pages_dir
The only difference between pages and posts are:
server-address/list
) while pages are not listedFrom now on, all said about posts directory structure also is the same for pages
There are 2 ways to add posts. Inside posts configured directory, you can create a mardown file or a directory.
Let's say your server is running in your local host, port 8080 (127.0.0.1:8080) and posts are inside the post directory.
File posts are text-only posts (or posts without local images). The file name will be used as url. E.g.
The file post/post_without_images.md
will be accesible using the url http://127.0.0.1:8080/view/post_without_images
Directories containing a file index.md
(configurable in the file texted.toml
), will be treated as a post. E.g.
The directory post/post_with_image
will be accesible using the url http://127.0.0.1:8080/view/post_with_image
Each post or page markdown file contains a header with a unique identification, date and author. It is followed by the post title. The html comment is optional, but some markdown editors screw up the header if not in an html comment, so I added it in the example
<!--
[ID]: # (21c1e9ad-4ebb-4168-a543-fbf77cc35a85)
[DATE]: # (2024-02-12 22:54:00.000)
[AUTHOR]: # (thiago)
-->
# How does it work?
Everything after that is the body of the post
In the post list, what is presented is a part of the post body. To determine when it stops, you add the <!-- more -->
tag.
See post_without_images.md
or post_with_image/index.md
for an example
If you run the texted-post binary, it will create a post skeleton with header, title and sample body to you.