A view counter for pages in Bookstack
📥 Installation
Follow these steps to install the view counter on your BookStack instance.
- Move Public Assets
Copy the backend script and JavaScript file to your public directory, then create the storage folder.
# Move files to public directory
cp counter.php view-counter.js /var/www/bookstack/public/
# Create the storage directory
mkdir /var/www/bookstack/public/view_counts- Update View Template
Copy the blade template to the BookStack views directory.
cp show-blade.php /var/www/bookstack/resources/views/pages/- Set Permissions
Ensure the web server (www-data) has ownership and the correct read/write permissions.
# Set ownership
sudo chown -R www-data:www-data /var/www/bookstack/public/view_counts
sudo chown -R www-data:www-data /var/www/bookstack/resources/views/pages/show-blade.php
# Set access permissions (755)
sudo chmod -R 755 /var/www/bookstack/public/view_counts
sudo chmod -R 755 /var/www/bookstack/resources/views/pages/show-blade.php