5 releases (3 breaking)
0.4.0 | Sep 17, 2023 |
---|---|
0.3.1 | Nov 24, 2022 |
0.3.0 | Oct 31, 2022 |
0.2.0 | Oct 29, 2022 |
0.1.0 | Jul 27, 2022 |
#2639 in Command line utilities
99KB
2K
SLoC
Features
- Add post to posts directory
- Copy image to images directory
- Rename image to "{post-slug}-header.{extension}"
- Easy to use
- Configuration file ( RON )
- Save configuration file in config system directory
#6
,#2
,#9
- The ability to show the logs
#5
,#11
- Modify
#24
- Title
- Description
- Slug (Will rename the post file, images folder, link, header. in one click 🦀)
- Post header (Just enter the new image and will copy it to images directory and rename it 💪)
- Last modified date (in one click)
- Draft status (in one click)
Installation
Assets
You can install Alepc from release page
Cargo
You can install Alepc by Cargo with following command
cargo install alepc
From source code
To compile Alepc from source code, you need Cargo
git clone https://github.com/aleecers/alepc
cd alepc
cargo build --release
after the build you can find binary file in ./target/release/alepc
Logging
To show logs run Alepc with RUST_LOG
environment variable with trace
value
Configuration
Alepc will create empty configuration file in config system directory, to know where its see #2
.
You can change the configuration file to your needs.
Below is the table of configuration you can used in configuration file, the examples is whoe you can use it in configuration file.
Global configuration
Key | Type | Description | Default |
---|---|---|---|
posts_path |
String | Path of posts | ../Aleecers.github.io/src/pages/blog/ |
images_path |
String | Path to images directory | ../Aleecers.github.io/public/images/ |
blog_site_path |
String | Path of blog in the site | /blog/ |
images_site_path |
String | Path of images in the site | /images/ |
posts_layout |
String | Layout path of posts ( path start from posts_path ) |
../../layouts/blog.astro |
repository_url |
String | Repository url | https://github.com/aleecers/alepc |
date_format |
String | Date format | %Y/%m/%d |
Example
Note: The first parentheses belong to the file itself, if you want to use the above configuration in a file that already has configurations added, delete the first parentheses
(
posts_path: "../Aleecers.github.io/src/pages/blog/",
images_path: "../Aleecers.github.io/public/images/",
blog_site_path: "/blog/",
)
select_action
configuration
Key | Type | Description | Default |
---|---|---|---|
select_action_message |
String | The question of select action | What do you want to do ❓ |
new_post_choice |
String | Create a new post choice in select | Create a new post ✍ |
update_existing_post |
String | Update an existing post choice | Update existing post 🖌️ |
version_choice |
String | Version choice | Alepc Version ⚙ |
Example
Note: The first parentheses belong to the file itself, if you want to use the above configuration in a file that already has configurations added, delete the first parentheses
(
select_action: (
select_action_message: "What do you want to do ❓",
new_post_choice: "Create a new post ✍",
)
)
create_post_settings
configuration
Key | Type | Description | Default |
---|---|---|---|
minimum_title_length |
Integer | Minimum length of post title | 7 |
maximum_title_length |
Integer | Maximum length of post title | 30 |
title_message |
String | Ask for post title message | Title of post 📝 |
minimum_description_length |
Integer | Minimum length of post description | 10 |
maximum_description_length |
Integer | Maximum length of post description | 255 |
description_message |
String | Ask for post description message | Description of post 📝 |
minimum_tags_count |
Integer | Minimum tags on post | 1 |
maximum_tags_count |
Integer | Maximum tags on post | 3 |
tags_message |
String | Ask for post tags message | Tags of post (separated by comma) |
separated_tags_by |
Char | separated tags by | , |
minimum_single_tag_length |
Integer | Minimum single tag length | 3 |
maximum_single_tag_length |
Integer | Maximum single tag length | 8 |
slug_message |
String | Ask for post slug message | Slug of post |
minimum_slug_length |
Integer | Minimum length of post slug | 5 |
maximum_slug_length |
Integer | Maximum length of post slug | 20 |
image_message |
String | Ask for post image message | Image of post |
Example
Note: The first parentheses belong to the file itself, if you want to use the above configuration in a file that already has configurations added, delete the first parentheses
(
create_post_settings: (
minimum_title_length: 7,
maximum_title_length: 30,
title_message: "Title of post 📝",
)
)
modify_post_settings
configuration
Key | Type | Description | Default |
---|---|---|---|
post_name_question |
String | The question of post name | What's the post you want to modify it (Write the slug) |
choice_action |
String | Choice modify action | What do you want to update? |
update_the_date_question |
String | Update date question | Update modified date |
update_draft_status_question |
String | Update draft status question ( Will add the currently status in the end) | Update draft status |
show_all_question |
String | Show all fields to update it question | Show all |
new_post_slug |
String | New post slug question (Wheen show_all) | New post slug |
new_post_title |
String | New post title question (Wheen show_all) | New post title |
new_post_descrioption |
String | New post descripation question (Wheen show_all) | New post description |
new_post_image |
String | New post image question (Wheen show_all) | New post image |
new_post_tags |
String | New post tags question (Wheen show_all) | New post tags |
new_post_draft |
String | New post draft status question (Wheen show_all) | Do you want to change draft status? |
keep_old_value_message |
String | Message to keep old value | Press enter to keep it 🤏 |
Example
Note: The first parentheses belong to the file itself, if you want to use the above configuration in a file that already has configurations added, delete the first parentheses
(
modify_post_settings: (
post_name_question: "What's the post you want to modify it (Write the slug)",
choice_action: "What do you want to update?",
update_the_date_question: "Update modified date",
)
)
Images
Home | Creation |
---|---|
Modification | Modify all |
---|---|
License
GNU General Public License version 3 of the license for more see https://www.gnu.org/licenses/
Dependencies
~12–28MB
~401K SLoC