| File | Date | Author | Commit |
|---|---|---|---|
| .github | 2 days ago |
|
[12e3b4] minor changes |
| .gitignore | 2 days ago |
|
[c7fa7f] initial commit |
| Makefile | 2 days ago |
|
[c7fa7f] initial commit |
| README.md | 2 days ago |
|
[c7fa7f] initial commit |
| go.mod | 2 days ago |
|
[6fd4e7] minor changes |
| go.sum | 2 days ago |
|
[6fd4e7] minor changes |
| main.go | 2 days ago |
|
[c7fa7f] initial commit |
A plug n play, cross-platform sitemap management tool.
Download from Releases
# Clone repository
git clone https://github.com/abraham-ny/sitemaptool.git
cd sitemaptool
# Initialize Go module
make init
# Download dependencies
make deps
# Build
make build
# Install globally
make install
# 1. Clone the repository
git clone https://github.com/abraham-ny/sitemaptool.git
cd sitemaptool
# 2. Initialize Go module
go mod init github.com/abraham-ny/sitemaptool
# 3. Install dependencies
go get github.com/spf13/cobra@v1.8.0
go mod tidy
# 4. Build
go build -o smx main.go
# 5. Run
./smx help
make init # Initialize module
make deps # Download dependencies
make build # Build for current platform
make test # Run tests
make install # Install globally
smx config
smx config base_url https://yoursite.com
smx config output_dir ./public/sitemaps
smx config ping_on_update true
# Basic
smx add https://yoursite.com/page1
# With options
smx add https://yoursite.com/page2 --changefreq daily --priority 0.8
smx create
smx stats
smx ping
smx version
Config file location: ~/.sitemaptool/config.json
{
"output_dir": "./sitemaps",
"base_url": "https://example.com",
"sitemap_prefix": "sitemap",
"ping_on_update": false,
"ping_engines": [
"https://www.google.com/ping?sitemap=",
"https://www.bing.com/ping?sitemap="
],
"default_changefreq": "weekly",
"default_priority": 0.5,
"respect_robots": true,
"vcs_aware": true,
"robots_path": "./robots.txt",
"check_updates": true
}
make build-all
Push a tag to trigger automated builds:
git tag v1.0.0
git push origin v1.0.0
# .github/workflows/update-sitemap.yml
name: Update Sitemap
on:
push:
branches: [main]
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download smx
run: |
wget https://github.com/abraham-ny/sitemaptool/releases/latest/download/smx-linux-amd64
chmod +x smx-linux-amd64
sudo mv smx-linux-amd64 /usr/local/bin/smx
- name: Update sitemap
run: |
smx config base_url https://yoursite.com
smx add https://yoursite.com/new-page
# Add to crontab
0 2 * * * cd /path/to/site && /usr/local/bin/smx add https://yoursite.com/daily-page
http.HandleFunc("/webhook/new-content", func(w http.ResponseWriter, r *http.Request) {
url := r.FormValue("url")
cmd := exec.Command("smx", "add", url)
cmd.Run()
})
MIT License
Pull requests welcome! Please ensure tests pass and code is formatted.