🏡 index : old_projects/url_shortener.git

author yaqubroli <walchuk2018@icloud.com> 2022-12-23 21:12:45.0 -08:00:00
committer yaqubroli <walchuk2018@icloud.com> 2022-12-23 21:12:45.0 -08:00:00
commit
b5175241eb736ec326baa2ad6dc723e9c0cabb9c [patch]
tree
80ff05fce4a8c1100aa6c65e12f6b6d69211e7f4
parent
07b474f9b7cbadb38d2ed0d1526ca1d89b5f2cf7
download
b5175241eb736ec326baa2ad6dc723e9c0cabb9c.tar.gz

Prettified readme



Diff

 .gitignore |  2 +-
 README.MD  | 48 +++++++++++++++++++++++++-----------------------
 2 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/.gitignore b/.gitignore
index 38c9419..e4d79a2 100644
--- a/.gitignore
+++ a/.gitignore
@@ -1,4 +1,4 @@
target/
target/**
.vscode/
.vscode
target
diff --git a/README.MD b/README.MD
index 91ca920..0a0ca16 100644
--- a/README.MD
+++ a/README.MD
@@ -21,27 +21,27 @@

The parameters specific to the url shortener are:

* [application.html] --- Things related to HTML and templating
    * **template** --- Whether to template at all or not
    * **template_index** --- Whether to template the index.html (/)
    * **template_static** --- Whether to template static html (this is sometimes needed as the submission form is often on a static page, as it is in this repo's example html)
    * **path** --- the path that html will be read from. Might want to make this /var/www/url_shortener, for instance.
    * **static_path** --- the subdirectory of **path** where static is stored. Unlike the above, this is actually displayed as part of the url.
    * **domain** --- The domain you're hosting from, used for templating
* [application.database] --- Things related to connecting to the mSQL database
    * **host**
    * **port** --- Usually 3306.
    * **username**
    * **password**
    * **database**
* [application.html] → Things related to HTML and templating
    * `template` → Whether to template at all or not
    * `template_index` → Whether to template the index.html (/)
    * `template_static` → Whether to template static html (this is sometimes needed as the submission form is often on a static page, as it is in this repo's example html)
    * `path` → the path that html will be read from. Might want to make this /var/www/url_shortener, for instance.
    * `static_path` → the subdirectory of `path` where static is stored. Unlike the above, this is actually displayed as part of the url.
    * `domain` → The domain you're hosting from, used for templating
* [application.database] → Things related to connecting to the mSQL database
    * `host`
    * `port` → Usually 3306.
    * `username`
    * `password`
    * `database`

### HTML files

In your HTML directory, these files are required

* **index.html**
* **url.html** --- The page shown after a URL is submitted
* **paste.html** --- The page shown after a paste is submitted
* `index.html`
* `url.html` → The page shown after a URL is submitted
* `paste.html` → The page shown after a paste is submitted

## Forms

@@ -49,17 +49,17 @@

Here are the fields necessary:

* **content** --- this is the URL to be shortened or the paste to be submitted
* **content_type** --- this is either `Pastebin` or `Url`, make this a hidden value on form
* `content` → this is the URL to be shortened or the paste to be submitted
* `content_type` → this is either `Pastebin` or `Url`, make this a hidden value on form

## Templating

This app has its own inbuilt templating engine. It's extremely simple; include these within your HTML and they will get replaced.

* `{content}` --- The original URL or the paste-text
* `{shortened}` --- The shortened suffix (yourdomain.com/*)
* `{domain}` --- Your domain, as set in the config.toml
* `{count:0}` --- The total number of URLs shortened
* `{count:1}` --- The total number of pastes submitted
* `{count:2}` --- The total number of all entries
* `{content}` → The original URL or the paste-text
* `{shortened}` → The shortened suffix (yourdomain.com/*)
* `{domain}` → Your domain, as set in the config.toml
* `{count:0}` → The total number of URLs shortened
* `{count:1}` → The total number of pastes submitted
* `{count:2}` → The total number of all entries