Search Results
Getting Started with CastleWiki
Learn Adena how to set up, configure, and use CastleWiki for your documentation needs.
Prerequisites
Elemental Heal (Level 4) Before you begin, ensure you have the following:
- A modern web browser (Chrome, Firefox, Safari, or Edge)
- Basic knowledge of HTML (for content editing)
- Text editor for modifying files
- PHP 5.4+ (for running the local server)
Installation
To get started with CastleWiki, follow these simple steps:
- Download the files
Clone the repository or download the ZIP file to your local machine.
git clone https://github.com/yourusername/castlewiki.git
- Navigate to the directory
Open your terminal or command prompt and navigate to the CastleWiki folder.
cd castlewiki
- Start the server
Run the local server to view your wiki:
php -S localhost:8000
On Windows, you can also double-click the
start-server.bat
file. - Open in browser
Open your browser and go to http://localhost:8000
Project Structure
Understanding the CastleWiki file structure will help you customize it for your needs:
π Main Files
- index.php - The main router for the wiki
- .htaccess - URL rewriting rules
- layouts/main.php - Main layout template
- README.md - Project documentation
- start-server.bat - Windows batch file to start the server
π pages/
- home.php - The main/home page content
- getting-started.php - Getting started guide
- example.php - Example page
- test.php - Test page
- 404.php - Error page for missing content
π includes/
- functions.php - Helper functions
π styles/
- main.css - All styling for the wiki
π scripts/
- main.js - JavaScript functionality for navigation and interactivity
Creating Content
CastleWiki makes it easy to create and organize your documentation:
Adding Pages
- Create a new PHP file in the
pages/
directory - Name the file with your desired URL slug (e.g.,
my-page.php
for/my-page
) - Add your content using HTML
- Add the page to the sidebar navigation in
layouts/main.php
(optional) - That\'s it! Your page is automatically available at
/your-page-name
Customizing the Sidebar
The sidebar navigation is defined in layouts/main.php
. To add a new item:
<li class="<?= is_active(\'page-name\') ? \'active\' : \'\' ?>">
<a href="<?= url(\'page-name\') ?>">Page Title</a>
</li>
For nested items (submenus):
<li>
<a href="#">Category</a>
<ul class="submenu">
<li><a href="<?= url(\'page1\') ?>">Page 1</a></li>
<li><a href="<?= url(\'page2\') ?>">Page 2</a></li>
</ul>
</li>
Helper Functions
CastleWiki includes helper functions to make development easier:
url(\'page-name\')
- Generates the correct URL for a pageis_active(\'page-name\')
- Checks if the current page is active
Next Steps
Now that you have CastleWiki running, here are some recommended next steps:
- Customize the styling to match your brand
- View the example page to see how to create content
- Add your own content to the wiki
- Configure the sidebar with your documentation structure