A Simple gradle plugin to manage your static web pages.
- You can create a local backup of your project any time to have your up-to-dated contents.
- have full sitemap of your html files just by one command.
- delete them all generated sitemap files by one command.
- Your project will be your web contents directory which shall not be your root directory this will make your workspace separated from your root project. (You don't need to push files behind your workspace to GitHub).
- clone your static contents repository add remote and then pull to sync your project just by one command!
- add your changed files, commit and publish just by one command!
- supports some git tasks such as init, add, remote add, commit, pull, push separately.
- the plugin can create your project directory and init git.
NOTE: Your root project shall not be your workspace, Your workspace is the directory that you define in root project and the plugin can handle it as root of your website!
- Add plugin to build.gradle of your root project as below:
plugins{
id("io.github.kodedevel.cmplugin") version "1.1"
}- this is were your project will go
cmpConfig{
workspaceDir = "path-to-your-workspace-directory"
}cmpConfig{
backupDir = "path-to-your-backup-directory"
}- Define baseUrl of your website to create sitemaps.
cmpConfig{
baseUrl = "your-website-address"
} cmpConfig{
...
git{
username = "Your-Git-Username"
}
...
} cmpConfig{
...
git{
origin = "origin-of-your-branch" //e.g main
}
...
}- If you have defined git access token as system variable u can call it by defining its name in configuration file as below:
cmpConfig{
...
git{
accessTokenSystemVarName = "your-system-access-token-variable-name"
}
...
}- You can have several sitemap files in category
- Your category name must be one of your url parts, for example if your url is https://example.com/a/b/c/file.html your category name must be a or b or c.
cmpConfig{
...
sitemap{
categories= arrayOf("first-category", "second-category", /* And so on... */)
}
...
}- You can exclude pages from being added to sitemap files.
cmpConfig{
...
sitemap{
exclude = arrayOf("fileA.html", "fileB.html", "fileC.html", /*and so on ... */)
}
...
}- below is some important commands to use in gradle:
createBackup create a local backup from the project
cleanBackup clean local backup
-
initGit create a git project and its corresponding workspace directory
-
automatePush automatically does necessary tasks to push project to the github repository
-
automateClone automatically does necessary tasks to clone and sync project from repository
-
autoCreateSitemaps automatically creates sitemap file(s) and sitemapindex for the project
-
cleanSitemaps clean all generated sitemap files.