1
0
Fork
You've already forked smolweb
0
No description
  • PHP 97.1%
  • HTML 2.1%
  • Dockerfile 0.3%
  • Hack 0.3%
  • Shell 0.1%
  • Other 0.1%
2026年01月29日 02:34:00 +01:00
smolweb Add auth 2026年01月29日 02:34:00 +01:00
.gitignore Remove php value for php.ini settings 2026年01月23日 16:08:04 +01:00
build.sh fix build script 2026年01月19日 22:20:29 +01:00
DEVELOPMENT.md alpha 1 2026年01月14日 17:26:55 +01:00
docker-compose.yml . 2026年01月14日 17:11:06 +01:00
Dockerfile . 2026年01月14日 17:11:06 +01:00
hosted_by_codeberg_88x31.png Add license and badge 2026年01月14日 17:07:49 +01:00
INSTALL.md Fix install 2026年01月19日 22:24:48 +01:00
LICENSE Add license and badge 2026年01月14日 17:07:49 +01:00
README.md Add counter docs 2026年01月19日 17:43:30 +01:00
screenshot1.webp add screenshot 2026年01月14日 17:33:41 +01:00

Hosted by Codeberg

SmolWeb

SmolWeb is a collection of tools to make it easier to build a website with plain PHP.

/smolweb/example/

Blog

/smolweb/blog

Url routes:

  • /smolweb/blog/rss

    Returns the rss feed based on data.json

Php:

require_once __DIR__ . '/smolweb/blog/blog.incl.php';
$html = SmolBlog::getHtml('2020年12月01日');
// => html string of the /smolweb/blog/2020-12-01.txt parsed as markdown.
$data = SmolBlog::data();
$firstTitle = $data->items[0]->title;
// => string used as the title in blog listings

Data:

  • /smolweb/_data/blog/

    Add blog posts here, in markdown, with the filename following this format: 2020年12月01日.txt

  • /smolweb/_data/blog/data.json

    Add the filename (without .txt) and title, so that it works with the rss generator

Image

/smolweb/img.php

github.com/mosbth/cimage

Add full size images in /smolweb/img/myimg.jpg or png, then add ?sa=jpg&h=720 to the end in the html img src, img.php will resize the image and cache it.

Data:

To add or remove images add them here: /smolweb/_data/img/

Webring

/smolweb/ring

Use to build your personal web ring just like webmasters did in the 2000s.

Special thanks to iceconey14 for the inspiration from their github.com/iceconey14/phpringring

Url routes:

  • /smolweb/ring/list.php

    Returns json list of id, url, title, icon

  • /smolweb/ring/next.php?id=1

    Redirects to the next url after id 1

  • /smolweb/ring/prev.php?id=1

    Redirects to the url before id 1

  • /smolweb/ring/random.php

    Redirects to a random url

Data:

To add or change the list of urls edit the file /smolweb/_data/ring.csv

Counter

Count each visit to your webpage

Url routes:

  • /smolweb/counter/digital.php

    Returns an svg of the counter and ups the counter as well.

Php:

require_once __DIR__ . '/smolweb/counter/counter.incl.php';
$n = SmolCounter::number();
// => current number
$n = SmolCounter::setNumber(2);
// => set number to 2
$n = SmolCounter::tick();
// => returns current number and saves it plus one

Data:

The counter is located at /smolweb/_data/counter.txt if it doesn't exist, it starts at 0.

Shop

/smolweb/shop

Make a small store front for people to purchase your stuff, uses Mollie as payment processor.

Url routes:

  • /smolweb/shop/purchase.php Must be a POST request with the following form data:

    cart[0][id]
    cart[0][quantity]
    cart[1][id]
    cart[1][quantity]
    ...
    name
    email
    phone
    address_street
    address_city
    address_postcode
    address_country
    
  • /smolweb/shop/cart.js.php

    Depends on AlpineJS and the Persist Plugin

    Reads all products and creates a cart list, with easy add to cart functionality

    <script src="/smolweb/shop/cart.js"></script>
    <script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/persist@3.x.x/dist/cdn.min.js"></script>
    <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
    

Php:

require_once __DIR__ . '/smolweb/shop/shop.incl.php';
$data = SmolShop::data();
$firstTitle = $data->products[0]->title;
// => string used as the title in product listings

Data:

  • /smolweb/_data/shop/shop.json

    Set prices, add remove products

  • /smolweb/_data/shop/order_mail_template.txt

    Markdown template for emails to be sent

  • /smolweb/_data/shop/orders.csv

    Spreadsheet of orders

  • /smolweb/_data/shop/config.incl.php

    Add Mollie api credentials here if you want to use the shop, otherwise purchasing will error.

License

I Hate AI License

https://ihateailicense.eu/