Interlinker is a lightweight Django web application that improves SEO and user navigation by automatically inserting internal links into your blog posts or reviews.
It works by parsing your website’s sitemap.xml, extracting URLs, and matching their slugs against keywords in your content.
Up to 10 relevant keywords per post are automatically interlinked.
- Upload or fetch a
sitemap.xml(URL or file). - Extract and store all internal links in a database.
- Normalize slugs (e.g.,
cold-wallets→cold wallets) for keyword matching. - Paste your blog post/review (plain text or HTML).
- Automatically interlink up to 10 keywords with matching URLs.
- Clean, minimal HTML & CSS frontend using Django templates.
- Admin interface to inspect stored links.
-
Install Docker Engine (Linux) or Docker Desktop (macOS) and ensure
makeis available (brew install makeon macOS if needed). -
Copy the sample environment file:
cp .env.example .env
Adjust values if you need a non-default port, secret key, or database.
-
Build and start the stack:
make up
On macOS or Linux systems where Docker runs rootless, disable sudo by appending
USE_SUDO=0(for examplemake up USE_SUDO=0). -
Open the app at http://127.0.0.1:8000/ and upload a sitemap to begin.
-
Install Docker Desktop for Windows and either:
- Use the bundled Git Bash shell (preferred), or
- Enable WSL 2 and work from an Ubuntu/WSL prompt.
If you stay on PowerShell or Command Prompt, install GNU Make (
choco install make).
-
Copy the sample environment file:
copy .env.example .env
(Use
cpinstead when running inside Git Bash or WSL.) -
Start the stack (Git Bash / WSL):
make up USE_SUDO=0
PowerShell alternative:
mingw32-make up USE_SUDO=0
-
Visit http://127.0.0.1:8000/ to confirm the app is running.
Useful helpers (all platforms):
make logsto tail container logs.make migrateto apply database migrations inside the running container.make downto stop the stack.
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
python manage.py migrate
python manage.py runserverThe repository also ships with bin/devserver, which loads .env or .env.example, applies migrations, and boots the Django dev server in one command:
./bin/devserverWindows users should run the script from Git Bash or WSL; if you prefer PowerShell, execute python manage.py migrate followed by python manage.py runserver instead.
- Navigate to Upload Sitemap.
- Provide a sitemap URL (
https://yoursite.com/sitemap.xml) or upload a file. - Links are parsed and stored in the database.
- Navigate to Links to browse stored links.
- Search and filter by domain or keyword.
- Navigate to Interlink.
- Paste your review/blog post text (plain or HTML).
- Choose a domain.
- Set a maximum number of links (default = 10).
- The app returns:
- A preview with clickable internal links.
- A textarea containing copyable HTML.
interlinker_project/
├── interlinker/ # Django app
│ ├── models.py # Domain & Link models
│ ├── services.py # Sitemap parsing & interlinking logic
│ ├── forms.py # Forms for sitemap & interlinking
│ ├── views.py # Views for UI
│ ├── templates/interlinker/ # HTML templates
│ └── static/css/style.css # Basic CSS
├── interlinker_project/ # Project config
│ ├── settings.py
│ ├── urls.py
│ ├── wsgi.py / asgi.py
└── manage.py
In settings.py, ensure you have:
STATIC_URL = 'static/'
STATICFILES_DIRS = [BASE_DIR / 'static']- Debug sitemap fetch issues by checking HTTP status codes in
services.py. - Some sites block bots — try with your own site or use
https://docs.python.orgfor testing. - Use
make shellordocker exec -it interlinker_app /bin/shto inspect the running container. - Run tests with
pytest(default settings pick up.env.exampleso SQLite is used locally).
- Install dev tooling:
pip install -r requirements-dev.txt - Run linting:
ruff check - Execute tests:
DJANGO_SECRET_KEY=test-secret DJANGO_DEBUG=true pytest
- Copy
.env.exampleto.envand setDJANGO_SECRET_KEY,DATABASE_URL, and trusted hosts/origins. - Build the container:
docker build -t interlinker .
Run locally with Postgres:docker run --env-file .env -p 8000:8000 interlinker. - The bundled
entrypoint.shruns migrations andcollectstaticon startup; setSKIP_COLLECTSTATIC=1if static assets are baked at build time. - Deploy to Cloud Run or similar by pushing the image, setting environment variables, and pointing a managed Postgres instance at
DATABASE_URL.
This project is licensed under the MIT License – feel free to use and modify.
Built with ❤️ by Patrick Mutabazi.